Motion-Project / motion

Motion, a software motion detector. Home page: https://motion-project.github.io/
GNU General Public License v2.0
3.62k stars 546 forks source link

netcam_start: Invalid netcam_url #99

Closed RaMaier closed 8 years ago

RaMaier commented 8 years ago

I recently bought an Escam HD3100 network camera which I want to operate with motion/motionEye.

When I enter rtsp://172.16.1.66:554/cam/realmonitor?channel=1&subtype=0 in vlc the HD stream is shown correct.

When I try to add a camera with the same IP, the camera is detected and recognized as RTSP camera and I can choose between TCP or UDP camera. After entering user and password all is accepted but no picture is displayed.

The logfile then repeatingly shows: [1] [ALR] [NET] netcam_start: Network Camera thread starting... for url (rtsp://172.16.1.66:554/cam/realmonitor?channel=1&subtype=0) [1] [CRT] [NET] netcam_start: Invalid netcam_url (rtsp://172.16.1.66:554/cam/realmonitor?channel=1&subtype=0) [1] [WRN] [ALL] motion_init: Could not fetch initial image from camera Motion continues using width and height from config file(s) [1] [CRT] [STR] http_bindsock: motion-stream bind() failed, retrying: [1] [ERR] [STR] http_bindsock: motion-stream socket failed, retrying: [1] [CRT] [STR] http_bindsock: motion-stream creating socket/bind ERROR: [1] [ERR] [ALL] motion_init: Problem enabling motion-stream server in port 8081:

What could be the problem with netcam_start: ? VLC prooves that the camera is streaming rtsp on that port.

tosiara commented 8 years ago

First, it looks like motion can't start because TCP port is already used by some app. Check with netstat -atn or specify other port in your config

tosiara commented 8 years ago

I have tested your provided URL and I don't get any error about it being inavlid Please try to start motion with extra logging -d 9 and paste results here

RaMaier commented 8 years ago

I rebooted the RasPi and stopped MotionEye after logging in again. I used 2 ssh windows. On WINDOW1 I checked the used porst with netsat and started MotionEye. While MotionEye was running I again checked the port and the stoped MotionEye again On WINDOW2 I tailed motion.log at the same time.

I copied the outputs of the 2 windows into one file and attached it.

Motioneye - Debug.txt

tosiara commented 8 years ago

You are using some old version of motion:

motion_startup: Motion 3.2.12+git20140228 

Try reporting this issue to motioneye maintainer so they update

RaMaier commented 8 years ago

Thanks for your advise tosira. I contacted MotionEye and they advised to use motion-mrdave.

The initial motion was installed on Raspbian via apt-get. apt-get update / upgrade didn't install a newer version.

I was looking through your page but didn't find instructions for the manual installation. All the links on Readme (https://github.com/Mr-Dave/motion) are not available anymore.

Would you have some instructions / homepage ?

tosiara commented 8 years ago

You must get source code and compile, like this:

git clone https://github.com/Mr-Dave/motion.git
cd motion
autoreconf -fiv
./configure
make
./motion
Mr-Dave commented 8 years ago

You can also uninstall the apt version and install my 3.4.1RC01 via a DEB. This is link to the jessie pi deb. Other platforms and versions are also posted there: http://www.lavrsen.dk/foswiki/pub/Motion/PatchworkForNewRelease/motion_3.4.1raspbianjessierc01-1_armhf.deb

For more instructions on install and compiling:

My brief Instructions are here: https://github.com/Mr-Dave/motion/blob/master/INSTALL

My re-write of the long Instructions are here: http://www.lavrsen.dk/foswiki/pub/Motion/PatchworkForNewRelease/motion_guide.tar.gz

RaMaier commented 8 years ago

I tried it, but make cam back with an error. Attached you find a file with the outcome.

Install Motion.txt Please advise

tosiara commented 8 years ago

Try to edit Makefile and remove following extra LIBs:

/usr/bin/ld: cannot find -ldc1394
/usr/bin/ld: cannot find -lxvidcore
/usr/bin/ld: cannot find -lx264
/usr/bin/ld: cannot find -lvorbisenc
/usr/bin/ld: cannot find -lvorbis
/usr/bin/ld: cannot find -ltheoraenc
/usr/bin/ld: cannot find -ltheoradec
/usr/bin/ld: cannot find -logg
/usr/bin/ld: cannot find -lopencore-amrwb
/usr/bin/ld: cannot find -lopencore-amrnb
/usr/bin/ld: cannot find -lmp3lame
/usr/bin/ld: cannot find -lgsm
RaMaier commented 8 years ago

@tosiara I removed the links but some files still seem to reference to them. Install motion 2.txt

@Mr-Dave Thanks for your advise. Maybe I will try that tonight when I am home.

tosiara commented 8 years ago

I think next option would be to build ffmpeg also from sources. Refer to FAQ: http://www.lavrsen.dk/foswiki/bin/view/Motion/FrequentlyAskedQuestions#Compile_ffmpeg_from_sources

RaMaier commented 8 years ago

@Mr-Dave I installed you version 3.4

apt-get install libpq5 libswscale3 dpkg -i http://www.lavrsen.dk/foswiki/pub/Motion/PatchworkForNewRelease/motion_3.4.1raspbianjessierc01-1_armhf.deb That works seemlessly after installing the other 2 packets. And motion shows:

root@rp2000-Red:/usr/src/motion# motion -h motion Version 3.4.1~rc01, Copyright 2000-2005 Jeroen Vreeken/Folkert van Heusden/Kenneth Lavrsen

And it works. :)

Super. Thank you both very much for your help and support.