Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How can I keep the flow (protocol rtsp, codec h264) in file (container mp4)? That is, on input an endless stream (with CCTV camera), and the output files in mp4 format size of 5-10 minutes of recording time.

OS: debian, ubuntu Software: vlc, ffmpeg (avconv)

Currently this scheme is used:

cvlc rtsp://admin:admin@10.1.1.1:554/ch1-s1 --sout=file/ts:stream.ts
ffmpeg -i stream.ts -vcodec copy -f mp4 stream.mp4

But it can not record video continuously (between restarts vlc is a loss of about 10 seconds of live video)

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

VLC does not support segmenting the output file. You can try to use directly ffmpeg as it supports output segmentation:

ffmpeg -i rtsp://admin:admin@10.1.1.1:554/ch1-s1 -c copy -map 0 -f segment -segment_time 600 -segment_format mp4 "out%03d.mp4"
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.