gpt4 book ai didi

linux - Motion 3.2.12是否支持RTSP MJPEG

转载 作者:太空宇宙 更新时间:2023-11-04 03:32:36 26 4
gpt4 key购买 nike

我有一台支持 RTSP 的 Zavio P6210 IP 摄像机 ( http://www.zavio.com/product.php?id=85 )。我对相机的设置是:(配置文件1)

  • 编码:MJPEG
  • 分辨率:640 x 1180
  • 最大帧速率:30
  • 质量:标准

我的相机上禁用了身份验证。在/etc/motion/motion.conf 中,我将 netcam_url 设置为 rtsp://192.168.1.52:554/video.pro1

当我将此 URL 传递到 VLC Media Player 时,流工作正常。但是,当我开始运动时,我总是收到以下错误消息:

[0] Processing thread 0 - config file /etc/motion/motion.conf
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3482368 LIBAVFORMAT_BUILD 3478785
[0] Thread 1 is from /etc/motion/motion.conf
[1] Thread 1 started
[0] motion-httpd/3.2.12 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[1] Invalid netcam_url (rtsp://192.168.1.52:554/video.pro1)
[1] Could not fetch initial image from camera
[1] Motion continues using width and height from config file(s)
[1] Resizing pre_capture buffer to 1 items
[1] Started stream webcam server in port 8081
[1] Retrying until successful connection with camera
[1] Invalid netcam_url (rtsp://192.168.1.52:554/video.pro1)
[1] Retrying until successful connection with camera
[1] Invalid netcam_url (rtsp://192.168.1.52:554/video.pro1)

我不知道如何修复这个错误。 Motion 3.2.12 不支持 RTSP MJPEG 还是 J 在某个地方犯了错误?

任何帮助将不胜感激。

最佳答案

有一天,rtsp 将成为原生且稳定的运动,您已经可以从 github 编译一个非官方 rtsp 兼容运动版本,我没有尝试,我喜欢发行包,这方面的工作已经进行了一段时间,直到今天我编写并使用了一个简单的 rtsp2jpeg 快照虚拟相机 php 包装脚本,因此我可以仅使用 rtsp 相机作为基于经典 jpeg 快照的相机。

像使用 jpeg 快照 URL 一样使用它。对于每个请求,它使用 ffmpeg 从 rtsp 流中抓取快照,将其写入 ram,将其推送到请求客户端并删除它

它还会裁剪图像,以便运动对真正的模 16 几乎全高清分辨率感到满意,也许您不需要它,取决于,我确实只需要它在我的一个全高清摄像机上。

您肯定需要根据需要调整 ffmpeg 命令才能与您的相机配合使用...

<?php

$now = DateTime::createFromFormat('U.u', microtime(true))->format("Ymd-Hisu");

$imagepath="/var/run/shm/cam7-$now-".mt_rand().".jpg";

exec('/usr/bin/ffmpeg -y -i "rtsp://192.168.1.7:554/user=user&password=iwonttellu&channel=1&stream=0.sdp" -f image2 -vframes 1 -vf "crop=1920:1072:0:4" '.$imagepath);

if (file_exists($imagepath)) {
header("Content-type: image/jpeg");
header("Content-Length: " . filesize($imagepath));
readfile($imagepath);
unlink($imagepath);
}else{
header("HTTP/1.0 404 Not Found");
}

?>

最诚挚的问候

关于linux - Motion 3.2.12是否支持RTSP MJPEG,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32689877/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com