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?
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).
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With