使用 FFMPEG 录制 Axis 摄像机流时出现错误

发布于 2024-11-18 19:32:59 字数 688 浏览 6 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只为一人 2024-11-25 19:32:59

当服务器和相机之间的连接中断或降级时,我以前见过这个问题。我们通过无线连接从摄像机获取数据,周期性延迟是一个问题。检查网络和拉流服务器的运行状况。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文