使用 FFMPEG 录制 Axis 摄像机流时出现错误
我正在使用 FFMPEG 录制 AXIS 摄像机 (P1346< /a>)。
我需要在特定时间进行录音。为了实现这一点,我使用每分钟执行一次的 PHP 脚本(使用 cron),在数据库中检查是否应该开始记录。
为了录制流,我使用 proc_open 和以下命令行:
/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'
问题是,它在大多数情况下都有效,但录制时不时会失败。有没有人尝试过在命令行中记录 AXIS 流,并在执行过程中遇到错误?
先感谢您。
此致,
Mathieu
N.B.:我在使用 VLC 时也遇到了同样的困难。
编辑:网络错误可以很好地解释为什么录音有时会突然中断;但是,我仍然不明白为什么整个视频文件在那之后就被损坏了。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当服务器和相机之间的连接中断或降级时,我以前见过这个问题。我们通过无线连接从摄像机获取数据,周期性延迟是一个问题。检查网络和拉流服务器的运行状况。
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.