Streaming Mp4 video through RTP protocol using Gstreamer in Ubuntu

9.5k views Asked by At

I'm trying to fetch the video file from my local directory,enable the stream from server and capture these frames from my Client side.I have used the following pipelines:

Server side:

gst-launch -v  filesrc location=/home/gokul/Videos/Econ_TestVideo/radioactive.mp4 ! qtdemux ! rtpmp4vpay ! udpsink host=192.168.7.61 port=5000 sync=true


Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstRtpMP4VPay:rtpmp4vpay0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config=(string)000001b001000001b58913000001000000012000c48d8800f528045a1443000001b24c61766335332e33352e30, payload=(int)96, ssrc=(uint)3003638799, clock-base=(uint)1542273545, seqnum-base=(uint)49176
/GstPipeline:pipeline0/GstRtpMP4VPay:rtpmp4vpay0.GstPad:sink: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, profile=(string)simple, level=(string)1, codec_data=(buffer)000001b001000001b58913000001000000012000c48d8800f528045a1443000001b24c61766335332e33352e30, width=(int)1280, height=(int)720, framerate=(fraction)91/3, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/GstRtpMP4VPay:rtpmp4vpay0: timestamp = 1542273545
/GstPipeline:pipeline0/GstRtpMP4VPay:rtpmp4vpay0: seqnum = 49176
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config=(string)000001b001000001b58913000001000000012000c48d8800f528045a1443000001b24c61766335332e33352e30, payload=(int)96, ssrc=(uint)3003638799, clock-base=(uint)1542273545, seqnum-base=(uint)49176
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

Client side:

gst-launch -v udpsrc port=5000 caps="application/x-rtp" ! rtpmp4vdepay ! mpeg4videoparse ! queue ! ffdec_mpeg4 ! ffmpegcolorspace !  xvimagesink


Setting pipeline to PAUSED ...
/GstPipeline:pipeline0/GstUDPSrc:udpsrc0.GstPad:src: caps = application/x-rtp, media=(string)video, payload=(int)96, clock-rate=(int)1, encoding-name=(string)MP4V-ES
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

After setting these,i'm not seeing any display(Not even the launch application screen)

To add to the above info,i'm running these command in command line in Ubuntu-12.04

2

There are 2 answers

0
vgokul129 On BEST ANSWER

Finally i will be able to see some video in launch screen.I have used the following pipeline.But the video is not clear.

SERVER:

gst-launch-0.10 -v filesrc location=/home/gokul/video.mp4 ! qtdemux name=d ! queue ! rtpmp4vpay ! udpsink port=5000

CLIENT:

gst-launch-0.10 udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)243, config=(string)000001b0f3000001b50ee040c0cf0000010000000120008440fa282fa0f0a21f, payload=(int)96, ssrc=(uint)4291479415, clock-base=(uint)4002140493, seqnum-base=(uint)57180" ! rtpmp4vdepay ! ffdec_mpeg4 ! xvimagesink sync=false

So can anyone suggest me how to enhance the video image in the client side,by modifying of adding some of the pipeline parameters.

1
Sandeep Kumar On

Below is the pipeline for receiver

Sender:

gst-launch-1.0 -v filesrc location = video.mp4 ! decodebin ! x264enc ! rtph264pay ! udpsink host=192.168.1.159 port=5000

will output CAPS use this caps at the receiver side:

caps="application/x-rtp, media=video, clock-rate=90000, encoding-name=H264, payload=96, ssrc=3394826012, timestamp-offset=2215812541, seqnum-offset=46353"

Receiver:

gst-launch-1.0 -v udpsrc port=5000 caps="application/x-rtp, media=video, clock-rate=90000, encoding-name=H264, payload=96, ssrc=3394826012, timestamp-offset=2215812541, seqnum-offset=46353" ! rtph264depay ! decodebin ! videoconvert ! autovideosink sync=false

hence you will be able to stream and video will be smooth and clean. In above pipeline if you are using gst-launch-0.10 then replace videoconvert with ffmpegcolorspace