1. Overview[edit | edit source]
This article will explain how to stream camera content over network thanks to GStreamer application on top of V4L2 Linux® kernel framework.
This article focus on camera sensor which doesn't output compressed image or video content but raw content such as YUV, RGB or Raw-bayer images.
Remote sending of images with a decent framerate requires compression in order to respect a reasonable bandwidth on network. This could be achieved compressing to JPEG image format or video formats like VP8 or H264.
Find below some examples of command lines allowing to capture a continuous stream of raw images then compress to JPEG, VP8 or H264 stream while playing it using various multimedia players, either local or remote.
2. Local streaming[edit | edit source]
Here is an example of a local preview loopback using gst-launch to capture raw pictures then compress to JPEG then decode and display.
image/jpeg" ! decodebin ! autovideosinkgst-launch-1.0 v4l2src device=/dev/video3 ! video/x-raw, format=YUY2, width=640, height=480, framerate=30/1 ! encodebin profile="
3. UDP streaming[edit | edit source]
An internet connection is required, for example by plugging an ethernet cable on the:
STM32MP257x-EV1 Evaluation board ![]() |
CN17 Ethernet connector 1 |
Get the IP address aa.bb.cc.dd of the host PC using ifconfig command:
aa.bb.cc.dd Bcast:10.201.23.255 Mask:255.255.252.0 inet addr:127.0.0.1 Mask:255.0.0.0ifconfig | grep "inet" inet addr:
Then fill the host= udpsink property with this IP address on the remote side in order to send UDP JPEG stream:
image/jpeg" ! rtpjpegpay ! udpsink host=aa.bb.cc.dd port=5000gst-launch-1.0 v4l2src device=/dev/video3 ! video/x-raw, format=YUY2, width=640, height=480, framerate=30/1 ! encodebin profile="
Then play the UDP JPEG stream on host PC:
JPEG ! rtpjpegdepay ! jpegparse ! decodebin ! videoconvert ! autovideosinkgst-launch-1.0 udpsrc port=5000 ! application/x-rtp, encoding-name=
A new window will popup on host PC displaying the camera content.
Same can be done with a lower bandwidth thanks to video compression. Here is an example with VP8:
video/x-vp8" ! rtpvp8pay ! udpsink host=aa.bb.cc.dd port=5000gst-launch-1.0 v4l2src device=/dev/video3 ! video/x-raw, format=YUY2, width=640, height=480, framerate=30/1 ! encodebin profile="
Then play the UDP VP8 stream on host PC:
VP8 ! rtpvp8depay ! decodebin ! videoconvert ! autovideosinkgst-launch-1.0 udpsrc port=5000 ! application/x-rtp, encoding-name=