VLC recording rtsp stream
Asked Answered
P

2

5

I have a problem with recording rtsp stream with VLC player. Actually my method works in MacOS X, but doesn't in Windows. Command line:

vlc -vvv rtsp://admin:[email protected]/live/h264/ --sout="#transcode{vcodec=mp4v,vfilter=canvas{width=800,height=600}}:std{access=file,mux=mp4,dst=C:\123.mp4}"

On MacOS it works fine, but under Windows it creates unreadable file. MediaInfo output:

General
Complete name                            : C:\123.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 1.08 MiB

Any suggestions?

Polestar answered 12/2, 2013 at 8:28 Comment(0)
I
9

Seems like your destination URL is not correct. Try this:

vlc -vvv rtsp://admin:[email protected]/live/h264/ --sout="#transcode{vcodec=mp4v,vfilter=canvas{width=800,height=600}}:std{access=file,mux=mp4,dst=C:\\123.mp4}"
Interlink answered 11/3, 2014 at 8:35 Comment(0)
M
6

For Linux users, ffmpeg alone works straight away.

If you want to watch the stream while recording, write to a .mkv instead of a .mp4.

This example will overwrite the file video.mp4 in your home folder without asking due to the -y param, and the original codecs are kept.

ffmpeg -i rtsp://192.168.42.1/live -vcodec copy -acodec copy -y ~/video.mp4

NB: This example url is for an Ambarella Xiaomi Mijia 4K camera, like many wifi ip cameras, you have to activate the stream via telnet first, for this particular model the command to be sent before reading the stream via rtsp://:

echo '{"msg_id":257,"token":0}' | telnet 192.168.42.1 7878
Maldives answered 3/2, 2021 at 16:10 Comment(1)
Is it possible to set up ffmpeg to continuously save the stream and loop after 10GB?Euhemerus

© 2022 - 2024 — McMap. All rights reserved.