将 RTSP 流保存到文件



>我无法从流中保存音频,我只能在文件中获取视频。我怀疑我不需要管道中的两个filesink,或者两个不同的多路复用器存在一些问题。

我尝试使用autoadiosinkautovideosink,它们工作成功。

autoadiosinkautovideosink管道:

gst-launch-1.0 rtspsrc location=rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov latency=0 droponlatency=1 name=rtp_source ! queue ! rtph264depay ! decodebin ! videoconvert ! autovideosink rtp_source. ! queue ! decodebin ! autoaudiosink

保存到文件filesink管道:

gst-launch-1.0 rtspsrc location=rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov latency=0 droponlatency=1 name=rtp_source ! queue ! rtph264depay ! decodebin ! vp8enc ! webmmux ! filesink location=BigBuckBunny_115k.webm rtp_source. ! "application/x-rtp, media=(string)audio" ! queue ! decodebin ! vorbisenc ! oggmux ! filesink location=BigBuckBunny_115k.webm

我还想在生成的文件中获取音频。

您只需重用现有的复用器 - 以便将 vorbis 也放入 webmmux 中:

gst-launch-1.0 rtspsrc location=rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov 
latency=0 droponlatency=1 name=rtp_source ! queue ! rtph264depay ! decodebin ! 
vp8enc ! webmmux name=mux ! filesink location=BigBuckBunny_115k.webm rtp_source. ! 
application/x-rtp, media=(string)audio" ! queue ! decodebin ! vorbisenc ! mux.

最新更新