GstMotionDetect on Jetson TK1

From RidgeRun Developer Wiki
Revision as of 20:57, 16 March 2018 by Jcaballero (talk | contribs)

Evaluating gst-motion-detect

This wiki shows the steps to use the evaluation version of RidgeRun's Motion Detect GStreamer plugin.

1. Copy the binary to the proper location in the TK1 board:

cp libgstmotion.so /usr/lib/arm-linux-gnueabihf/gstreamer-0.10/

2. Now check that the plugin is properly loaded by gstreamer:

gst-inspect-0.10 motion

This command should display the plugin information.

3. Finally execute the test pipeline. For this pipeline to work you will need a camera connected to the TK1 with support for 640x480@30fps, by default the pipeline uses /dev/video0.

gst-launch-0.10 v4l2src ! 'video/x-raw-yuv, width=(int)640, height=(int)480, framerate=(fraction)30/1, format=(fourcc)YUY2' ! ffmpegcolorspace ! 'video/x-raw-yuv, width=(int)640, height=(int)480, framerate=(fraction)30/1, format=(fourcc)NV12' ! motion window-x1=0 window-y1=0 window-x2=639 window-y2=479 sample-width=640 sample-height=480 bg-timeout=30 bg-frames=2 frames-offset=0 frames-to-motion=1 threshold=3 sensitivity=4 enable=true  ! 'video/x-raw-yuv, width=(int)640, height=(int)480, framerate=(fraction)30/1, format=(fourcc)NV12' ! ffmpegcolorspace ! 'video/x-raw-yuv, width=(int)640, height=(int)480, framerate=(fraction)30/1, format=(fourcc)YUY2' ! xvimagesink

This pipeline detects motion within a 640x480 window, you can play with the motion properties to change the area of detection. Also take into account that the ideal threshold and sensitivity of detection will depend on the camera used and the environment lighting conditions.

When the plugin detects motion you will see the following messages in the terminal:

******* SENDING START MOTION SIGNAL *******
******* SENDING STOP MOTION SIGNAL *******


Building gst-motion-detect