开发者

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 continu开发者_JAVA百科e, and the recording app try to reconnect.

What can you recommend?


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}'


What is the source, why it is losing connection? If you can't avoid it, create some kind of 'reconnector' and use it every time connection breaks. Then, you'll have pieces of video. Later, glue that pieces together...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜