James Bennet
James Bennet

Reputation: 223

Dump RTSP to file like rtmpdump

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.

Upvotes: 1

Views: 4709

Answers (3)

Maximus
Maximus

Reputation: 559

You can dump it with FFmpeg using the following command.

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

Upvotes: 1

phobie
phobie

Reputation: 2564

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.

Upvotes: 1

goldibehr
goldibehr

Reputation: 71

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

Upvotes: 1

Related Questions