H.264 stream from GStreamer on Raspberry pi 3

3,250 views
Skip to first unread message

Hasan Tekin

unread,
Nov 27, 2016, 5:22:22 AM11/27/16
to meetecho-janus
Hi everyone,

Is there anyone who could successfully stream live h264 video stream with low latency from gstreamer source? I tried various pipelines. Some worked well for local but not remote and some worked well for only remote connections.

Kindly share your experiences on h264 streaming via gstreamer.

Chet Lemon

unread,
Nov 29, 2016, 4:12:00 AM11/29/16
to meetecho-janus
Hey, I'm not sure about remote, but I've got an h.264 working with really low latency local. The key for me was to take advantage of some of the attributes in the x264enc block. For example, "speed-preset=ultrafast" and "tune=zerolatency"

Hasan Tekin

unread,
Nov 29, 2016, 10:17:31 AM11/29/16
to meetecho-janus
I used those too but still no luck. Is it a Raspberry Pi? If so, what is the memory allocated for GPU? And can you please share your gstreamer pipeline?

Thank you.

Chet Lemon

unread,
Nov 29, 2016, 4:21:20 PM11/29/16
to meetecho-janus
I'm actually using an intel compute stick and ROS, But sure. My pipe is:
v4l2src device=/dev/video0/ ! video/x-raw,width=1280,height=720 ! tee name=t t. ! queue ! x264enc speed-preset=ultrafast tune=zerolatency byte-stream=true bitrate=3000 threads=1 ! h264parse config-interval=1 ! rtph264pay ! udpsink host=127.0.0.1 port=8004 t. ! queue ! videoconvert

I wouldnt worry about the tee's though, those are to satisfy ROS's gscam requirements. This branch of it might be more relevant to you:
v4l2src device=/dev/video0/ ! video/x-raw,width=1280,height=720 ! x264enc speed-preset=ultrafast tune=zerolatency byte-stream=true bitrate=3000 threads=1 ! h264parse config-interval=1 ! rtph264pay ! udpsink host=127.0.0.1 port=8004

What does yours look like?




On Sunday, November 27, 2016 at 2:22:22 AM UTC-8, Hasan Tekin wrote:

Hasan Tekin

unread,
Nov 30, 2016, 7:56:51 AM11/30/16
to meetecho-janus
From old to new;

raspivid --verbose --nopreview -hf -vf --width 640 --height 480 --framerate 15 --bitrate 1000000 --profile baseline --timeout 0 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=127.0.0.1 port=8004



raspivid --nopreview -hf -vf --width 640 --height 480 --intra 10 --framerate 20 --bitrate 2000000 --profile baseline --timeout 0 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=127.0.0.1 port=8004



gst-launch-1.0 rpicamsrc preview=false iso=800 awb-mode=off bitrate=500000 hflip=true vflip=true exposure-mode=10 blocksize=8192 ! video/x-h264,width=640,height=480,framerate=48/1 ! h264parse ! rtph264pay config-interval=10 pt=96 ! udpsink host=127.0.0.1 port=8004



gst-launch-1.0 rpicamsrc preview=false awb-mode=off bitrate=4500000 hflip=true vflip=true exposure-mode=10 iso=3200 blocksize=216 ! video/x-h264,width=640,height=480,framerate=24/1 ! h264parse ! rtph264pay config-interval=100 pt=126 ! udpsink host=127.0.0.1 port=8004

I indeed have not much idea about qp-min=18  pass=5 quantizer=25 settings.

gst-launch-1.0 rpicamsrc ! x264enc tune=zerolatency speed-preset=ultrafast qp-min=18  pass=5 quantizer=25 ! video/x-h264,width=640,height=480,framerate=42/1 ! rtph264pay ! udpsink host=127.0.0.1 port=8004 sync=false

I also used v4l2src device=/dev/video0/ but nothing much changed. While tinkering I find some properties works well but another day, they don't. So, I can't really go much further.

And thank you for your share. I'll learn and try more things.
Reply all
Reply to author
Forward
0 new messages