Feature Request: RTSP Support for netcams
Description
In addition to HTTP serving up files, these streams are generally available over RTSP for IP cameras. The folks over at
LIVE555 Streaming Media have a helper application (
openRTSP) which reads such a stream very nicely. The MPlayer project has adopted this and
libnemesi as library options for dealing with RTSP streams. Could such support be added to the usual 'http get' option?
I have noticed the suggestion of
VideoFourLinuxLoopbackDevice for other functionality requests (e.g.
FeatureRequest2009x04x17x063655 ) and I see how this could be another solution. Any thoughts on inclusion of the Real Time Streaming Protocol as a feature to simplify this?
Thanks for your consideration.
--
NicholasLipari - 23 Jun 2009
Follow up
I've also found the following
patch that would (for now) work around the need for RTSP Support. Works well for my version of the ACTi camera (ACM-5001).
Your request looks good , but we need to finish to fix some features before adding all this kind of features as input plugins , output plugins , encoders , etc ...
--
AngelCarpintero - 09 Jul 2009
It has been 4 years or so, can we add this please?
--
RomanGaufman - 22 Feb 2013
I would like to see such a feature as well. Please implement it.
--
DanielLettau - 07 Apr 2013
I agree, it would be a very useful implementation for nowadays cameras.
--
GerardoCaudillo - 30 Jul 2013
The Hyperbolic fork in GIT implements RTSP
Credit where due. The Hyperbolic fork added the RTSP support last month while I was working it and appears to do it better so I snipped my branch.
--
MrDave - 17 Nov 2013
@MrDave where can I find the fork?
--
HarryKim - 07 Dec 2013
https://github.com/hyperbolic2346/motion
--
MrDave - 05 Jan 2014
Good fork ! I can try to integrate in main git version with other patches
Thanks !
--
AngelCarpintero - 24 Feb 2014
Pushed to GIT version. Looks that is not working with some ffmpeg version , until i find a way to make it work backward it will only work if new functions are supported by ffmpeg libraries installed.
--
AngelCarpintero - 28 Feb 2014
Hola chicos! Anybody made recording rtsp with motion in motion possible?
--
AntonPjatkin - 13 Mar 2014
Yes, current GIT version works.
--
AngelCarpintero - 13 Mar 2014
Thank you,
AngelCarpintero,
I see you are helping many people out on this forum, super cool!
I took this release from link above (
https://github.com/hyperbolic2346/motion)
built and installed, tested with MJPEG stream - works fine, but on RTSP stream I get following reply from Motion:
[1] [ALR] [NET] netcam_start: Network Camera thread starting... for url (rtsp://xxx.xxx.xxx.xxx/axis-media/media.amp)
[1] [ALR] [NET] rtsp_connect: unable to open input(rtsp://xxx.xxx.xxx.xxx/axis-media/media.amp): -1094995529 - Invalid data found when processing input
Any hints?
--
AntonPjatkin - 16 Mar 2014
I did try just a few RTSP streams , not sure what is the issue , looks you are connecting to Axis product , maybe ffmpeg you are using has not a decoder for that stream , try to check what is the stream from that url.
maybe auth issue ?
Hint :
rtsp://login:password@YourCamIP/axis-media/media.amp - new cams(f/w 5+)
rtsp://login:password@YourCamIP/mpeg4/media.amp - old cams
--
AngelCarpintero - 18 Mar 2014
I tried URL including passwords, still same error,
I believe it's stuck in ffmpeg.
What about latest Motion versions, do they include RTSP support? Or if I keep using hyperbolic release, which ffmpeg version is proved to work with it? Thanks for your time!
--
AntonPjatkin - 18 Mar 2014
latest Git version of motion supports ffmpeg GIT
--
AngelCarpintero - 20 Mar 2014
I was able to get this to work with the latest GIT sources for both motion and ffmpeg. Saving motion videos caused it to crash but I can live with multiple jpegs. It also didn't work reliably with my other cameras (non-rtsp), so I still run motion 3.2.12 for them. Thanks!
--
JonZeeff - 23 Apr 2014
Has this beeing solved now in the Version 3.2.12? If so I would be glad if you guys could give me advice where I have to enter my RTSP stream of my Hikvision ("rtsp://192.168.1.199:554/ISAPI/streaming/channels/101?auth=YWRtaW46MTIzNDU= ") and what I need to install apart from motion for this. Noob friendly step to step instructions please.
--
AnastasiusNadelholz - 23 Aug 2014
Hi I would really like if rtsp streams were included too. I tried compiling from the fork on github but it would just error every time.
--
AdamGunderson - 13 Sep 2014
It looks like the fork at
https://github.com/hyperbolic2346/motion isn't passing the username properly. That causes the -1094995529 error. I've fixed this by changing netcam_rtsp.c as follows (replace these four lines around line 372):
ptr = mymalloc(strlen(url->service) + strlen(netcam->connect_host)
+ 5 + strlen(url->path) + 5 + strlen(cnt->conf.netcam_userpass) + 1);
sprintf((char *)ptr, "%s://%s@%s:%d%s", url->service, cnt->conf.netcam_userpass,
netcam->connect_host, netcam->connect_port, url->path);
That'll likely break any cameras that don't have a password, but since all mine do it's a quick fix.
--
RzTen1 - 11 Nov 2014
That change above requires you to set netcam_userpass in the config file. Inline usernames and passwords still won't work with that patch.
--
RzTen1 - 11 Nov 2014
Hi, maybe my comment is out-of-date, but I have tried now and, for me, this don't work !!
I have compiled from source all need for motion (ffmpeg 2.6, vp8, yasm 1.3, mysql, motion-Git-8619d7c17ce112e7196975905c6e840f345141ba ... with more difficulties, finally all compiled fine.
I have modified the netcam_rtsp as
RzTen1 suggested but in the log I view:
netcam_start: Network Camera thread starting... for url (rtsp://10.0.x.x)
rtsp_connect: unable to open input(rtsp://pippo:password@10.0.x.x:554): -1482175736 - Server returned 4XX Client Error, but not one of 40{0,1,3,4}.
When I start motion from cli, I read:
[0] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc/motion/motion.conf
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "control_port"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "control_localhost"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "control_html_output"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "control_authentication"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "sql_query"
[0] [NTC] [ALL] config_thread: Processing config file /etc/motion/thread1.conf
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "netcam_http"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "despeckle"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "gap"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "max_mpeg_time"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "output_all"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "output_normal"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "output_motion"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "ppm"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "ffmpeg_cap_new"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "ffmpeg_cap_motion"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "locate"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "jpeg_filename"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "webcam_port"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "webcam_quality"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "webcam_motion"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "webcam_maxrate"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "webcam_localhost"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "webcam_limit"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "sql_log_image"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "sql_log_mpeg"
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "sql_query"
[0] [NTC] [ALL] motion_startup: Using default log level (NTC) (6)
[0] [NTC] [ALL] motion_startup: Motion Git-8619d7c17ce112e7196975905c6e840f345141ba Started
[0] [NTC] [ALL] motion_startup: Logging to file (/var/log/motion/motion.log)
I am running a ubuntu server with kernel 3.13.0-48-generic 32bit ...
I put username:password in thread1.conf as:
netcam_userpass pippo:password
and netcam_url rtsp://10.0.89.9.
May there are some people that can help me ?
Thank in advance
Emilio
--
EmilioDefranco - 20 Apr 2015
Ok, the errors when start motion is related to the new syntax of the motion.conf (and threadxx.conf). It is resolved, but rtsp not working in any case. openRTSP and vlc open without problem my camera streaming with the form rtsp://user:password@ip, but motion continue give me the error above mentioned ...
Emilio
--
EmilioDefranco - 21 Apr 2015
Dear All,
Is there any progress?
also, I faced with motion crash when rtsp stream unavailable:
Sep 4 12:43:41 stor02 motion: [9] [ALR] [NET] rtsp_connect: unable to open input(rtsp://1.2.3.4:7070/stream1): -60 - Operation timed out
Sep 4 12:43:53 stor02 kernel: pid 89427 (motion), uid 0: exited on signal 11 (core dumped)
--
DmitryTsarev - 04 Sep 2015
I just bought four cameras and the ony stream is accessible via rtsp://192.168.1.4:554/live.sdp
Is this protocol supported currently?
--
MariuszCiszewski - 23 Sep 2015
Hello!
I now have an IP Cam under rtsp://admin:admin@192.168.178.88:554/11 is reached, you can now do something in motion to get a signal ???
Because at the moment I get no picture and almost all IPcam come with the H264 standard on the Makt !!!
Best regards
Steffen
--
SteffenEwald - 18 Jan 2016
current status:
- only MJPEG via RTSP working, H264 does not
- if stream disapeared - motion can't re-connect and crushing
--
DmitryTsarev - 29 Jan 2016