Linux IP 摄像机:用于录制 H.264 的开源软件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20520495/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-07 01:36:23  来源:igfitidea点击:

IP camera: open source software for recording H.264

linuxvideo-streamingh.264ip-camera

提问by Martin Vegter

I have an IP camera (Axis M1054) and I would like to record video stream. I would probably start with continuous recording, but then I would like to switch to clips triggered by motion detection (with pre-rec of couple seconds before the trigger occured), recording being encoded in MPEG4 (H.264), not in MJPEG.

我有一台 IP 摄像机(Axis M1054),我想录制视频流。我可能会从连续录制开始,但随后我想切换到由运动检测触发的剪辑(在触发发生前几秒钟进行预录制),录制以 MPEG4 (H.264) 编码,而不是 MJPEG。

Is there a free open source Linux software that can do it? I did not find anything by searching the Internet. Can you recommend something that works and you successfully use? Or am I stuck with commercial software?

有没有免费的开源 Linux 软件可以做到这一点?我没有通过搜索互联网找到任何东西。你能推荐一些有效的并且你成功使用的东西吗?还是我被商业软件困住了?

I have no problem replacing the camera if different model would work better with Linux.

如果不同型号在 Linux 上工作得更好,我可以更换相机。

回答by auselen

What about giving a try to open source openh264backed by Cisco? It supports Long Term Reference (LTR) frameswhich might help you with motion detection.

尝试一下由Cisco支持的开源openh264怎么样?它支持哪些可以帮助您进行运动检测。Long Term Reference (LTR) frames

回答by Markus Schumann

Your camera streams H.264 over RTP controlled by RTSP. You need a RTP client to connect to the camera in order to get to the streams. http://www.live555.comprovides a RTSP client library with a variety of sample code. First I would try http://www.live555.com/openRTSP/from the command line. I have successfully used live555 to record a variety of IP cameras.

您的相机通过 RTSP 控制的 RTP 流式传输 H.264。您需要一个 RTP 客户端连接到摄像机才能访问流。 http://www.live555.com提供了一个带有各种示例代码的 RTSP 客户端库。首先,我会从命令行尝试http://www.live555.com/openRTSP/。我已经成功地使用live555录制了各种IP摄像机。

You could also use the FFMPEG library: Receiving RTSP stream using FFMPEG library

您还可以使用 FFMPEG 库: Receiving RTSP stream using FFMPEG library

FFMPEG also takes care of muxing (creating a container file) or decoding.

FFMPEG 还负责混合(创建容器文件)或解码。

回答by BraveNewCurrency

I've found Motionto be a great program for motion detection and cataloging.

我发现Motion是一个很棒的运动检测和编目程序。

It seems to work with remote cameras, although the docs are a bit sketchy. It's probably worth a try.

似乎适用于远程摄像机,尽管文档有点粗略。这可能值得一试。

回答by user3163748

I use the linux Motion software combined with the command line version of VLC for my IP cameras. (2 are MJPG streams, one is RTSP with H264). The motion software triggers a script to have VLC record lossless in the cameras native format. My setup does not however support pre-recording. It actually results in missing the frame that initially triggered the motion which is fine for my use since the first frames of motion are not where I'd see the faces or license plates.

我将 linux Motion 软件与 VLC 的命令行版本结合用于我的 IP 摄像机。(2 个是 MJPG 流,一个是带有 H264 的 RTSP)。运动软件触发一个脚本,让 VLC 以摄像机的原始格式无损记录。但是,我的设置不支持预录制。它实际上导致丢失最初触发运动的帧,这对我来说很好用,因为运动的第一帧不在我看到人脸或车牌的地方。