I
I
Ilya2019-05-13 14:42:55
linux
Ilya, 2019-05-13 14:42:55

ffmpeg how not to lose record on unexpected shutdown?

The camera is recorded using ffmpeg:
ffmpeg -i "rtsp://ip/video.mp4" output.mp4
If you stop the recording process manually (ctrl + c), then everything is saved normally and opens accordingly.
But if the computer is turned off from the power supply or, for example, the terminal is closed, then the file is not received correctly and does not open.
How can I record a stream from the camera (it is in mjpeg), so that when the light is turned off, the recording file remains alive?
Dividing the file into fragments is not an option, since the last fragment will also be lost.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Rsa97, 2019-05-13
@Rsa97

Connect the UPS and shut down the system normally

D
Dmitry Shitskov, 2019-05-13
@Zarom

Try with a different container. For example, avi or asf

M
Moskus, 2019-05-14
@Moskus

This is possible if you write to the TS container. However, I also recommend splitting what you save into parts. Perhaps you will need some more light shamanism with the parameters, I haven’t done this for a long time, I don’t remember.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question