Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gstreamer stream h264 File

Tags:

gstreamer

I'm trying to stream a h264 encoded movie file from a server to multiple clients at once by sending the RTP Stream to the broadcast address.

The solution I've got works but is very slow. Playing the video locally works fine.

Here's my Server:

gst-launch-0.10 -v filesrc location=/home/zeroc8/Videos/bunny.mov \
! qtdemux ! h264parse ! rtph264pay pt=96 ! udpsink host=192.168.1.255 port=5000

This is the Client:

gst-launch-0.10 udpsrc port=5000 \
caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)\"J01AHqkYGwe83gDUBAQG2wrXvfAQ\\,KN4JyA\\=\\=\", payload=(int)96, ssrc=(uint)786848209, clock-base=(uint)101553131, seqnum-base=(uint)64602" 
! rtph264depay ! ffdec_h264 ! ffmpegcolorspace ! autovideosink

Am I doing something bad here? Why is this so slow?

like image 988
zeroc8 Avatar asked Mar 26 '14 09:03

zeroc8


People also ask

What is the decoding scheme used in GStreamer?

GStreamer uses a decoding scheme where a stream passes through different components in series, from source to sink output. You can choose anything as a source: a file, a device, the output (sink) also may be a file, a screen, network outputs, and protocols (like RTP).

How do I convert an MP4 file to H264?

The input accepts the mp4 file, which goes through the mp4 demuxer — qtdemux, then through the h264 parser, then through the decoder, the converter, and finally, the output. You can replace autovideosink with filesink with a file parameter and output the decoded stream directly to the file.

Is it possible to encapsulate raw H264 stream from remote DVR?

Trying to encapsulate a raw h264 stream captured from remote DVR into a .mp4 container. I am able to do this with ffmpeg on the Pi however would like to use gstreamer since it comes pre-installed on raspbian and has native GPU hardware support for h264 encoding (ie. omxh264enc/omxh264dec) which I will need later.

What type of data does the H264 element encode?

This element encodes raw video into H264 compressed data, also otherwise known as MPEG-4 AVC (Advanced Video Codec). The property controls the type of encoding.


1 Answers

Just got the answer from the gstreamer mailing list. In case anyone else is having the same problem, adding the gstrtpjitterbuffer element fixes it.

gst-launch-0.10 udpsrc port=5000 \
caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)\"J01AHqkYGwe83gDUBAQG2wrXvfAQ\\,KN4JyA\\=\\=\", payload=(int)96, ssrc=(uint)786848209, clock-base=(uint)101553131, seqnum-base=(uint)64602" \ 
! gstrtpjitterbuffer latency=1000 
! rtph264depay ! ffdec_h264 ! ffmpegcolorspace ! autovideosink
like image 101
zeroc8 Avatar answered Sep 24 '22 02:09

zeroc8