开发者

How can I record an rtsp video stream to a file from a linux command line?

开发者 https://www.devze.com 2022-12-27 05:26 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消