GstMotionDetect on Jetson TK1: Difference between revisions
Jcaballero (talk | contribs) |
m (Spalli moved page GstMotionDetect on Tegra K1 (TK1) to GstMotionDetect on Jetson TK1: NVIDIA asked us to use Jetson instead of Tegra) |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
=Evaluating gst-motion-detect= | =Gst Motion Detect 0.10= | ||
==Evaluating gst-motion-detect 0.10== | |||
This section shows the steps to use the evaluation version of RidgeRun's Motion Detect GStreamer plugin. | This section shows the steps to use the evaluation version of RidgeRun's Motion Detect GStreamer plugin. | ||
Line 28: | Line 29: | ||
</pre> | </pre> | ||
=Building gst-motion-detect= | ==Building gst-motion-detect 0.10== | ||
This section shows how to build gst-motion-detect-0.10 plugin for TK1. After obtaining the source code from RidgeRun, clone it in the TK1 board and run: | This section shows how to build gst-motion-detect-0.10 plugin for TK1. After obtaining the source code from RidgeRun, clone it in the TK1 board and run: | ||
<pre> | <pre> | ||
Line 37: | Line 38: | ||
</pre> | </pre> | ||
Note: In case that a visual feedback of the detected movement is desired, the debug option can be enabled running the configure step as follows: | |||
<pre> | <pre> | ||
./configure --prefix /usr --libdir /usr/lib/arm-linux-gnueabihf/ --enable-debug | ./configure --prefix /usr --libdir /usr/lib/arm-linux-gnueabihf/ --enable-debug | ||
Line 45: | Line 46: | ||
<pre> | <pre> | ||
gst-inspect-0.10 motion | gst-inspect-0.10 motion | ||
</pre | </pre> | ||
=Gst Motion Detect 1.0= | |||
==Building gst-motion-detect 1.0== | |||
This section shows how to build gst-motion-detect-1.0 plugin for TK1. After obtaining the source code from RidgeRun, clone it in the TK1 board and run: | |||
<pre> | |||
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev | |||
./autogen.sh | |||
./configure --prefix /usr --libdir /usr/lib/arm-linux-gnueabihf/ | |||
make | |||
sudo make install | |||
</pre> | |||
After the install, you should be able to inspect the plugin as follows: | |||
<pre> | |||
gst-inspect-1.0 motiondetect | |||
</pre> | |||
==Testing gst-motion-detect 1.0== | |||
The plugin can be tested with the following pipeline. To work it requires a camera device in /dev/video0. | |||
<pre> | |||
gst-launch-1.0 v4l2src ! 'video/x-raw, width=(int)640, height=(int)480, format=(string)I420, framerate=(fraction)30/1' ! videoconvert ! 'video/x-raw, width=(int)640, height=(int)480, format=(string)NV12, framerate=(fraction)30/1' ! motiondetect window-x1=0 window-y1=0 window-x2=639 window-y2=479 sample-width=640 sample-height=480 bg-timeout=30 bg-frames=20 frames-offset=10 frames-to-motion=2 threshold=3 sensitivity=6 motion-trace=true ! videoconvert ! xvimagesink | |||
</pre> | |||
The motion-trace property enable visual feedback of the motion detected by the plugin. | |||
[[Category:Jetson]] |
Latest revision as of 19:21, 18 October 2018
Gst Motion Detect 0.10
Evaluating gst-motion-detect 0.10
This section 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 0.10
This section shows how to build gst-motion-detect-0.10 plugin for TK1. After obtaining the source code from RidgeRun, clone it in the TK1 board and run:
./autogen.sh ./configure --prefix /usr --libdir /usr/lib/arm-linux-gnueabihf/ make sudo make install
Note: In case that a visual feedback of the detected movement is desired, the debug option can be enabled running the configure step as follows:
./configure --prefix /usr --libdir /usr/lib/arm-linux-gnueabihf/ --enable-debug
After the install, you should be able to inspect the plugin as follows:
gst-inspect-0.10 motion
Gst Motion Detect 1.0
Building gst-motion-detect 1.0
This section shows how to build gst-motion-detect-1.0 plugin for TK1. After obtaining the source code from RidgeRun, clone it in the TK1 board and run:
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev ./autogen.sh ./configure --prefix /usr --libdir /usr/lib/arm-linux-gnueabihf/ make sudo make install
After the install, you should be able to inspect the plugin as follows:
gst-inspect-1.0 motiondetect
Testing gst-motion-detect 1.0
The plugin can be tested with the following pipeline. To work it requires a camera device in /dev/video0.
gst-launch-1.0 v4l2src ! 'video/x-raw, width=(int)640, height=(int)480, format=(string)I420, framerate=(fraction)30/1' ! videoconvert ! 'video/x-raw, width=(int)640, height=(int)480, format=(string)NV12, framerate=(fraction)30/1' ! motiondetect window-x1=0 window-y1=0 window-x2=639 window-y2=479 sample-width=640 sample-height=480 bg-timeout=30 bg-frames=20 frames-offset=10 frames-to-motion=2 threshold=3 sensitivity=6 motion-trace=true ! videoconvert ! xvimagesink
The motion-trace property enable visual feedback of the motion detected by the plugin.