RTMP streaming

Petteri Matilainen pmatil at gmail.com
Mon Nov 16 04:51:34 PST 2015


Hello all,

I'm rather new to gstreamer and am working on a project to get H264
video from my Logitech C920 webcam with uvch264src and stream it using
the rtmpsink in gstreamer. So far I have tested some pipelines but it
doesn't really work (yet).

I'm using Raspberry Pi 2 and Raspbian Jessie. The reason I'm posting
here instead of the embedded list is that I have more general
questions than Rpi specific for now.

Currently I'm using gstreamer version 1.4.4 from APT. I have compiled
newer versions myself too but ran into problems with gst-omx.

Anyway, the C920 outputs H264 stream and PCM audio stream. I'm not
interested in the audio for now. I use uvch264src to get the stream
from the camera and pipe it straight into flv container and into RTMP
server (crtmpserver) on the same machine. Then from there open html
page and play the stream using jwplayer.

Here's the pipeline:

gst-launch-1.0 -v -e uvch264src  name=src auto-start=true \
 src.vfsrc ! queue !
video/x-raw,format=\(string\)YUY2,width=320,height=240,framerate=10/1
! fakesink \
 src.vidsrc ! queue ! video/x-h264,width=1280,height=720,framerate=30/1 \
 ! flvmux ! rtmpsink location='rtmp://10.1.7.52:1935/live/teststream live=1'

(Adding h264parse does nothing.)

The C920 outputs 2 video streams, viewfinder and the actual vidsrc.
Low-res viewfinder goes into fakesink. The result of this pipeline is:
http://pastebin.com/byVJ8PbB The ^C you see is me interrupting the
script as it does nothing.

The RTMP does not get received by crtmpserver at all. I have tested
crtmpserver with another capture and pipe and it works great. The
reason I would like to use gstreamer is that uvch264src supports
setting the encoding quality of the C920's H264 encoder.

(BTW, I tried to pipe gstreamer output to avconv using fdsink but that
causes avconv to crash with error av_interleaved_write_frame(): Broken
pipe. Almost the same pipeline, but no flvmux and rtmpsink replaced
with fdsink. Tried with h264parse too.)

So the questions are: is the pipeline correct? Any tips using
crtmpserver (or any other streaming server)?


More information about the gstreamer-devel mailing list