Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recording lossy video stream

I'm trying to record live video stream to a file.

I tried with VLC using

vlc {INPUT} --sout '#std{access=file,mux=ts,dst=file.mp4}'

I tried with ffmpeg using

ffmpeg {INPUT} -vcodec copy -acodec copy file.mp4

Both records just fine, but the source tends to loose connection for 1-2seconds, and then recording just stops >.< leaving me with half finished recording :(

I want the recording to continue, and the recording app try to reconnect.

What can you recommend?

like image 581
tomas Avatar asked Oct 19 '25 20:10

tomas


1 Answers

Ok I've found a solution myself.

If I set VLC on loop and instruct it to append the file, it reconnects to the stream and continue recording (no black video while connection is lost tho)

the command is:

cvlc {INPUT} --loop --sout '#std{access=file{append},mux=ts,dst=file.mp4}'
like image 162
tomas Avatar answered Oct 22 '25 06:10

tomas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!