How can I record an rtsp video stream to a file from a linux command line?
I have a net cam which provides a rtsp stream via the default 554 port.
I can view the stream perfectly using VLC (GUI mode) when I open rtsp://192.168.1.7/1234
(the "1234" is the [default] password the device requires to be in the url, for those who want to restrict access to the stream)
What I need is to have a cli-only linux box record the stream.
Googling a bit found this suggestion:
mplayer -noframedrop -dumpfile out.rm -dumpstream rtsp://192.168.1.7/1234
However, this results in:
MPlayer UNKNOWN-4.2.1 (C) 2000-2009 MPlayer Team
141 audio & 304 video codecs
Playing rtsp://192.168.1.7:554/1234.
Resolving 192.168.1.7 for AF_INET6...
Couldn't resolve name for AF_INET6: 192.168.1.7
Connecting to server 192.168.1.7[192.168.1.7]: 554...
rtsp_session: unsupported RTSP server. Server type is 'un开发者_开发百科known'.
Resolving 192.168.1.7 for AF_INET6...
Couldn't resolve name for AF_INET6: 192.168.1.7
Connecting to server 192.168.1.7[192.168.1.7]: 554...
http_read_response read 0 (i.e. EOF).
No stream found to handle url rtsp://192.168.1.7:554/1234
Exiting... (End of file)
I tried this both on a Debian and on an OS X 10.6 machine.
Any ideas?
Thanks!
I've used openRTSP to perform this task. It can be used to dump the audio/video elementary streams into separate files, or if you have compatible codecs, you may be able to write it to an mpeg4 file.
精彩评论