Hello Experts,
Can you please share me the gstreamer commands to stream from rpi3 camera to another rpi3 board ?
I am using the latest new raspian stretch image.
Can you please help on this ?
It needs to be done through only gstreamer commands as I need to use gstreamer in another applications.
Re: Raspberry pi camera streaming
Any help please.
-
- Posts: 950
- Joined: Tue Dec 15, 2015 4:55 pm
- Location: Detroit, MI USA
Re: Raspberry pi camera streaming
I am not familiar with gstreamer, but if you have streaming or camera preview up and running on the local/hosting rpi, I have used realVNC to remotely view the screen. It used to be a beta option you had to enable to be able to watch streaming video preview stuff. Not sure if it's still beta or just a regular feature now.
Robotics tips, hacks, book extras https://youtube.com/practicalrobotics
Re: Raspberry pi camera streaming
Thanks for the reply.
I have to initiate the gstreamer in one rpi board and want to stream the camera to another rpi board. (this raspberry pi board also should receive by gstreamer command)
Place 1 -> RPI3_1 (with camera -> 192.168.0.50)
raspivid -n -t 0 -rot 180 -w 640 -h 480 -fps 30 -b 1000000 -o - | gst-launch-1.0 -e -vvvv fdsrc ! h264parse ! rtph264pay pt=96 config-interval=5 ! udpsink host=192.168.0.53 port=5000
Place 2 -> RPI3_2 (without camera -> 192.168.0.53)
Here I need gstreamer commands to receive the camera streaming.
I need to test with the latest raspian image.
I have to initiate the gstreamer in one rpi board and want to stream the camera to another rpi board. (this raspberry pi board also should receive by gstreamer command)
Place 1 -> RPI3_1 (with camera -> 192.168.0.50)
raspivid -n -t 0 -rot 180 -w 640 -h 480 -fps 30 -b 1000000 -o - | gst-launch-1.0 -e -vvvv fdsrc ! h264parse ! rtph264pay pt=96 config-interval=5 ! udpsink host=192.168.0.53 port=5000
Place 2 -> RPI3_2 (without camera -> 192.168.0.53)
Here I need gstreamer commands to receive the camera streaming.
I need to test with the latest raspian image.
Re: Raspberry pi camera streaming
Any help from raspberry pi team or community members please ?
I think, it should be straight forward, I did google, not able to get the commands.
I think, it should be straight forward, I did google, not able to get the commands.
Re: Raspberry pi camera streaming
I use these gstreamer pipelines when the Raspberry with camera is not connected to HDMI monitor and I want to see live video on laptop (192.168.178.62).
On Pi:
On laptop:
So change 192.168.178.62 to the IP address of your 2nd Pi, and run gst-launch-1.0 on it:
The camera Pi pipeline adds timeoverlay. If you don't like that, remove it:

P.S:
You can find more Raspberry gstreamer related information here:
https://stamm-wilbrandt.de/en/Raspberry ... #gstreamer
On Pi:
Code: Select all
gst-launch-1.0 -v rpicamsrc num-buffers=-1 ! video/x-raw,width=640,height=480, framerate=41/1 ! timeoverlay time-mode="buffer-time" ! jpegenc ! rtpjpegpay ! udpsink host=192.168.178.62 port=5200
On laptop:
Code: Select all
$ sudo /sbin/iptables -I INPUT 1 -p udp --dport 5200 -j ACCEPT
$ gst-launch-0.10 -v udpsrc port=5200 ! application/x-rtp, encoding-name=JPEG,payload=26 ! rtpjpegdepay ! jpegdec ! autovideosink
So change 192.168.178.62 to the IP address of your 2nd Pi, and run gst-launch-1.0 on it:
Code: Select all
$ gst-launch-1.0 -v udpsrc port=5200 ! application/x-rtp, encoding-name=JPEG,payload=26 ! rtpjpegdepay ! jpegdec ! autovideosink
The camera Pi pipeline adds timeoverlay. If you don't like that, remove it:

P.S:
You can find more Raspberry gstreamer related information here:
https://stamm-wilbrandt.de/en/Raspberry ... #gstreamer
https://github.com/Hermann-SW/RSA_numbers_factored
https://stamm-wilbrandt.de/GS_cam_1152x192@304fps
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/
https://stamm-wilbrandt.de/GS_cam_1152x192@304fps
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/
Re: Raspberry pi camera streaming
Thanks for your reply.
When I run the below command in one rpi, getting the below error.
Got the below error on another camera rpi.
Can you please let me know how to install the rpicamsrc ?
Thanks for the help.
I am referring to this link for rpicamsrc pipeline building.
https://pastebin.com/S1zGK9kP
When I run the below command in one rpi, getting the below error.
Code: Select all
pi@raspberrypi:~ $ gst-launch-1.0 -v udpsrc port=5200 ! application/x-rtp, encoding-name=JPEG,payload=26 ! rtpjpegdepay ! jpegdec ! autovideosink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
WARNING: from element /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0: Could not initialise Xv output
Additional debug info:
xvimagesink.c(1760): gst_xv_image_sink_open (): /GstXvImageSink:autovideosink0-actual-sink-xvimage:
Could not open display (null)
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:03.083189207
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
pi@raspberrypi:~ $
Code: Select all
pi@raspberrypi:~/$
pi@raspberrypi:~/gst-rpicamsrc $ gst-launch-1.0 -v rpicamsrc num-buffers=-1 ! video/x-raw,width=640,height=480, framerate=41/1 ! timeoverlay time-mode="buffer-time" ! jpegenc ! rtpjpegpay ! udpsink host=192.168.178.62 port=5200
WARNING: erroneous pipeline: no element "rpicamsrc"
pi@raspberrypi:~/$
Thanks for the help.
I am referring to this link for rpicamsrc pipeline building.
https://pastebin.com/S1zGK9kP
Re: Raspberry pi camera streaming
And also, I have used the below commands for streaming, looks like working except one error.
RPI1:
raspivid -t 999999 -h 720 -w 1080 -fps 25 -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! udpsink host=192.168.0.89 port=5000
RPI2:
gst-launch-1.0 -v udpsrc port=5000 ! gdpdepay ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink sync=false
Error: "xvimagesink.c(1760): gst_xv_image_sink_open (): /GstXvImageSink:autovideosink0-actual-sink-xvimage:
Could not open display (null)"
BTW, I am using the lite version of raspian image. Do we need X server for the gstreamer output ?
I think, no, we can also should be able to stream in non-X window system.
Can you please help on this ?
RPI1:
raspivid -t 999999 -h 720 -w 1080 -fps 25 -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! udpsink host=192.168.0.89 port=5000
RPI2:
gst-launch-1.0 -v udpsrc port=5000 ! gdpdepay ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink sync=false
Error: "xvimagesink.c(1760): gst_xv_image_sink_open (): /GstXvImageSink:autovideosink0-actual-sink-xvimage:
Could not open display (null)"
Code: Select all
pi@raspberrypi:~ $
pi@raspberrypi:~ $ gst-launch-1.0 -v udpsrc port=5000 ! gdpdepay ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink sync=false
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
WARNING: from element /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0: Could not initialise Xv output
Additional debug info:
xvimagesink.c(1760): gst_xv_image_sink_open (): /GstXvImageSink:autovideosink0-actual-sink-xvimage:
Could not open display (null)
Setting pipeline to PLAYING ...
New clock: GstSystemClock
BTW, I am using the lite version of raspian image. Do we need X server for the gstreamer output ?
I think, no, we can also should be able to stream in non-X window system.
Can you please help on this ?
Re: Raspberry pi camera streaming
The following commands are worked.
RPI1: (camera connected)
raspivid -t 999999 -h 720 -w 1080 -fps 25 -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! udpsink host=192.168.0.89 port=5000
RPI2:
gst-launch-1.0 -v udpsrc port=5000 ! gdpdepay ! rtph264depay ! avdec_h264 ! videoconvert ! fbdevsink sync=false
Thanks everyone for your help.
RPI1: (camera connected)
raspivid -t 999999 -h 720 -w 1080 -fps 25 -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! udpsink host=192.168.0.89 port=5000
RPI2:
gst-launch-1.0 -v udpsrc port=5000 ! gdpdepay ! rtph264depay ! avdec_h264 ! videoconvert ! fbdevsink sync=false
Thanks everyone for your help.
Re: Raspberry pi camera streaming
I met rpicamsrc author Jan Schmidt (thaytan) on GStreamer 2017 conference in Prague.titusece wrote: ↑Tue May 15, 2018 2:04 pmCan you please let me know how to install the rpicamsrc ?
Thanks for the help.
I am referring to this link for rpicamsrc pipeline building.
https://pastebin.com/S1zGK9kP
Please take his code from github, you will find installation instructions in README file:
https://github.com/thaytan/gst-rpicamsrc
I did compare performance of gstreamer pipelining. PIPEing raspivid to gstreamer pipeline was worst, v4l2 was better, best was rpicamsrc.
https://github.com/Hermann-SW/RSA_numbers_factored
https://stamm-wilbrandt.de/GS_cam_1152x192@304fps
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/
https://stamm-wilbrandt.de/GS_cam_1152x192@304fps
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/