Motion 3.2.12是否支持RTSP MJPEG ?



我有一个支持RTSP的Zavio P6210 IP摄像机(http://www.zavio.com/product.php?id=85)。我在相机上的设置是:(profile1)

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

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

当我传递这个URL到VLC媒体播放器,流工作正常。然而,当我开始运动时,我总是得到这个错误消息:

[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或我在某个地方犯了错误?

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");
}
?>

问题是您需要dave先生的动议(motionmrdave)。为了节省时间,您可能需要首先备份当前的motion config file(s)。一旦完成,然后删除现有的"motion"安装。

sudo add-apt-repository ppa:motionmrdave/motion
sudo apt-get update
sudo apt-get install motion -y

恢复运动配置文件。重启motion,您的RTSP应该工作良好。

最新更新