Dump RTSP to file like rtmpdump

拈花ヽ惹草 提交于 2019-12-25 02:50:56

问题


How to dump an RTSP stream to a file?

For RTMP I can do this:

rtmpdump --quiet --start=0 --stop=10 -rtmp=[Path to stream] --flv=dump.f4v

I need to do the same for RTSP. I'm on OS X and have access to VLC, python and ffmpeg.

I only need to save a small 10 second sample of the stream to test a server.


回答1:


It is not useful to "dump" an "RTSP stream" to a file. RTSP is a bidirectional conversation between a client and the server. The byte content changes every time it is run, so you can't replay the captured data in any meaningful way.

If your question is simply about checking if a server is working, both vlc or ffplay can act as an RTSP client. In this scenerio, you must already have configured the server with a media file (typically in .mov or .mp4 format). See the server instructions for how to accomplish this.

Starting the ffplay client will have the form:

ffplay rtsp://192.168.1.2/movie/blade.mp4




回答2:


With FFmpeg or its fork Libav you can indeed dump a "RTSP stream":

avconv -i "rtsp://[Path to stream].sdp" -acodec copy -vcodec copy -f mp4 dump.mp4

Later you can playback the dump with:

avplay dump.mp4

You can also use "mplayer" or "vlc" for playback.




回答3:


You can dump it with FFmpeg using the following command.

ffmpeg -i "[Path to stream]" -t 10 -c copy dump.f4v



来源:https://stackoverflow.com/questions/15543014/dump-rtsp-to-file-like-rtmpdump

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!