0

我正在学习 Gstreamer,首先我使用 gst-launch 工具使用 udpsink 和 udpsrc 元素通过网络流式传输视频文件。

在浏览了 Gstreamer 文档并阅读了其他 stackoverflow 注释后,我得到了一个命令来读取 mp4 文件并将其发送到没有可见错误的 udpsink,另一个命令使用 udpsrc 来使用流数据并将其发送到 xvimagesink 以进行可视化它,但是由于 xvimagesink 应该打开的窗口没有打开。

有人可以帮我解决这个问题吗?

我在这里复制我正在使用的两个 gst-launch 命令,以及生产者和消费者的日志。

gst-launch-1.0 -v filesrc location = ./x264_sample_file.mp4 ! qtdemux ! video/x-h264 ! rtph264pay ! udpsink host=127.0.0.1 port=9001


gst-launch-1.0 -v udpsrc uri=udp://127.0.0.1:9001 ! application/x-rtp,payload=96 ! rtph264depay  ! decodebin ! xvimagesink

生产者日志。

gst-launch-1.0 -v filesrc location = ./Videos/Dark\ Phoenix\ \(2019\)\ \[BluRay\]\ \[1080p\]\ \[YTS.LT\]/Dark.Phoenix.2019.1080p.BluRay.x264-\[YTS.LT\].mp4 ! qtdemux ! video/x-h264 ! rtph264pay ! udpsink host=127.0.0.1 port=9001
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1: caps = video/x-h264
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)4.1, profile=(string)high, codec_data=(buffer)01640029ffe1001867640029acd94078065b011000003e90000bb800f183196001000668e9384cf23c, width=(int)1920, height=(int)800, framerate=(fraction)24000/1001, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, packetization-mode=(string)1, profile-level-id=(string)640029, sprop-parameter-sets=(string)"Z2QAKazZQHgGWwEQAAA+kAALuADxgxlg\,aOk4TPI8", payload=(int)96, ssrc=(uint)606785685, timestamp-offset=(uint)3182951615, seqnum-offset=(uint)8918, a-framerate=(string)23.976023976023978
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, packetization-mode=(string)1, profile-level-id=(string)640029, sprop-parameter-sets=(string)"Z2QAKazZQHgGWwEQAAA+kAALuADxgxlg\,aOk4TPI8", payload=(int)96, ssrc=(uint)606785685, timestamp-offset=(uint)3182951615, seqnum-offset=(uint)8918, a-framerate=(string)23.976023976023978
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:sink: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)4.1, profile=(string)high, codec_data=(buffer)01640029ffe1001867640029acd94078065b011000003e90000bb800f183196001000668e9384cf23c, width=(int)1920, height=(int)800, framerate=(fraction)24000/1001, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)4.1, profile=(string)high, codec_data=(buffer)01640029ffe1001867640029acd94078065b011000003e90000bb800f183196001000668e9384cf23c, width=(int)1920, height=(int)800, framerate=(fraction)24000/1001, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: timestamp = 3182951615
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: seqnum = 8918
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

消费者日志。

gst-launch-1.0 -v udpsrc uri=udp://127.0.0.1:9001 ! application/x-rtp,payload=96 ! rtph264depay  ! decodebin ! xvimagesink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = application/x-rtp, payload=(int)96, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264
/GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:sink: caps = application/x-rtp, payload=(int)96, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264
4

0 回答 0