将 RTSP 流保存到文件

Save RTSP stream to file

我无法从流中保存音频我只能在文件中获取视频。我怀疑我在管道中不需要两个 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

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

您只需重用现有的 mux - 这样 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.