Reputation: 6762
I am using FFMPEG to record the video stream (h264 / AAC in MP4) provided by an AXIS camera (P1346).
I need to make recordings at specific times. To achieve this, I use a PHP script which is executed every minute (with cron), checks in the database whether a recording should be started or not.
To record the stream, I use proc_open with the following command line:
/usr/local/bin/ffmpeg -i 'rtsp://192.168.0.103:554/axis-media/media.amp?udp&buffer_size=65535' -vcodec copy -acodec copy -t 3600 -y '/path/to/video/folder/file.mp4'
Problem is, it works in most cases, but the recording fails every now and then. Have anyone ever tried to record AXIS streams in command line, and faced bugs while doing it?
Thank you in advance.
Regards,
Mathieu
N.B.: I have encountered the same difficulties using VLC.
EDIT: Network errors can be a good explanation on why the recordings sometimes suddenly interrupt; however, I still don't understand why the whole video file is corrupted after that.
Upvotes: 1
Views: 3940
Reputation: 36
I have seen this issue before when the connection between the server and the camera is interrupted or degraded. We were pulling a feed from a camera over a wireless connection and the periodic latency was an issue. Check the health of the network and the server pulling the stream.
Upvotes: 2