Page 1 of 1

Loop recording IP Camera

Posted: 24 Apr 2022 16:15
by Remex
Hello,
I want to record my IP camera but I have no idea what to do when my storage is out of space. I thought about recording 1 hour videos and just delete that which are useless. Is it possible to do a loop for example for 1 hour? I'll turn on recording and then VLC will end it after hour and start new after that and that will be looped. Or maybe you have better idea to store my video from IP camera, because software specifed to IP cameras doesn't recognize my camera, I can only record screen or capture camera by rtsp.


P.S.
I'm doing it at my raspberry pi 4 with 2gb ram

Re: Loop recording IP Camera

Posted: 25 Apr 2022 19:20
by chubinou
you can use the "run-time" property to define for how long the recording should run, note that it doesn't seems to work with some v4l2 devices

something like this

vlc <yourinput> --run-time 10 ':sout=#transcode{vcodec=h264,acodec=aac}:file{dst=/home/your/output.mkv}'

look for vlc streaming / stream output documentation online.

otherwise *maybe* you can achieve this with logrotate (https://linux.die.net/man/8/logrotate) by stoping/starting VLC each time it rotates