0
votes

I hav a Zavio P6210 IP camera (http://www.zavio.com/product.php?id=85) which supports RTSP. My settings on the camera are : (profile1)

  • encoding : MJPEG
  • resolution : 640 x 1180
  • Maximum fps : 30
  • quality : standard

Authentication is disabled on my camera. In /etc/motion/motion.conf I've set the netcam_url to rtsp://192.168.1.52:554/video.pro1

When I pass this URL into VLC Media Player, the stream works fine. However, when I start motion, I always get this error messages :

[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)

I don't have a clue how to fix this error. Does Motion 3.2.12 not support RTSP MJPEG or am J making a mistake somewhere ?

Any help will be much appreciated.

2
Try to point to 8080 port in netcam_urldeimus
I've set the RTSP port in the camera to 8080 and changed the 'netcam_URL' to rtsp://192.168.1.52:8080/video.pro1 in motion, unfortunately without any succeskvthie0

2 Answers

0
votes

rtsp will be native and stable in motion one day, you can already compile a non official rtsp compatible motion version from github, I didn't try, I like distro packages, work is in progress on this for some time now, until this day I wrote and use a simple rtsp2jpeg snapshot virtual camera php wrapper script, so I can use rtsp only cameras as classic jpeg snapshot based cameras.

Use it as if it was a jpeg snapshot url. for each request It uses ffmpeg to grab a snapshot from a rtsp stream, writes it to ram, pushes it to the requesting client and deletes it

It also crops the image so that motion is happy with a real modulo 16 almost full hd resolution, may be you wont need it, depends, I do need it only on one of my full hd cam.

U will certainly have to tweak the ffmpeg command as needed to work with your camera ...

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

?>

Best Regards

0
votes

The problem is that you would need MrDave's motion(motionmrdave). To save time you might want to first backup your current motion config file(s). Once done then remove your existing "motion" installation.

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

Restore the motion config file(s). Restart motion and your RTSP should work fine.