在 Ubuntu 中使用 Gstreamer 通过 RTP 协议流式传输 Mp4 视频

vgo*_*129 2 ubuntu rtp video-streaming gstreamer gst-launch

我正在尝试从本地目录获取视频文件,启用来自服务器的流并从客户端捕获这些帧。我使用了以下管道:

服务器端:

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
Run Code Online (Sandbox Code Playgroud)

客户端:

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
Run Code Online (Sandbox Code Playgroud)

设置这些后,我没有看到任何显示(甚至没有启动应用程序屏幕)

要添加上述信息,我在 Ubuntu-12.04 的命令行中运行这些命令

San*_*mar 6

下面是接收器的管道

发件人:

gst-launch-1.0 -v filesrc 位置 = video.mp4 !解码器!x264enc!rtph264支付!udpsink 主机=192.168.1.159 端口=5000

将在接收器端使用此上限输出 CAPS:

caps =“应用程序/ x-rtp,媒体=视频,时钟速率= 90000,编码名称= H264,有效负载= 96,ssrc = 3394826012,时间戳偏移= 2215812541,seqnum偏移= 46353”

接收者:

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 !解码器!视频转换!自动视频接收器同步=假

因此,您将能够进行流式传输,并且视频将流畅且干净。在上面的管道中,如果您使用的是 gst-launch-0.10,则将 videoconvert 替换为 ffmpegcolorspace