我正在使用gstreamer
将各种来源流式传输到RTMP
。
它适用于RTSP
和MP4
来源,但当我尝试使用asf
来源时,它可以正常工作。
我正在使用的管道是:gst-launch-1.0 -v filesrc location="C:\\Users\\user1\\Download
s\\Video\\test2.asf" ! asfparse ! asfdemux ! flvmux ! rtmpsink location='rtmp://127.0.0.1:1935/live/test'
我得到的输出是:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstAsfParse:asfparse0.GstPad:src: caps = video/x-ms-asf, parsed=(boolean)true
/GstPipeline:pipeline0/GstASFDemux:asfdemux0.GstPad:sink: caps = video/x-ms-asf, parsed=(boolean)true
/GstPipeline:pipeline0/GstFlvMux:flvmux0: streamable = true
/GstPipeline:pipeline0/GstFlvMux:flvmux0.GstPad:src: caps = video/x-flv, streamheader=(buffer)< 464c..., 1200.... >
/GstPipeline:pipeline0/GstRTMPSink:rtmpsink0.GstPad:sink: caps = video/x-flv, streamheader=(buffer)< 464c.., 1200... >
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0". <<<-------- why?
Execution ended after 0:00:00.001711787
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
使用playbin
可以正常播放文件。
信息流信息:
如果我更改管道以重新编码视频,则流媒体方面没有错误,但VLC
而非gstreamer playbin
都无法播放,它们似乎只是永远尝试。< / p>
用于重新编码和流式传输的管道:
gst-launch-1.0 -v filesrc location="C:\\Users\\user1\\Downloads\\Video\
\test2.asf" ! asfparse ! asfdemux ! decodebin ! x264enc ! flvmux ! rtmpsink location='rtmp://127.0.0.1:1935/live/test2'