Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSTP/RTSP broken in current master #23

Open
drewzh opened this issue Jun 10, 2014 · 7 comments
Open

RSTP/RTSP broken in current master #23

drewzh opened this issue Jun 10, 2014 · 7 comments

Comments

@drewzh
Copy link

drewzh commented Jun 10, 2014

Motions records perfectly for a good hour, producing great videos, performance is miles better than using HTTP for me with my cheap chinese IP cam, then, all of a sudden, errors start pouring in and my system becomes slower and slower until it eventually dies a horrible SSH unreachable death.

Network camera is perfectly reachable whilst these errors are occuring, I can start multiple streams fine, even from the same box motion is running on (raspberrypi running Arch Linux). It takes around 2 hours for the system to become completely unresponsive and motion stops recording entirely.

I've gone back to http method in the meantime but I'm eagerly awaiting working RTSP support as I get a massive performance increase.

The logs looks like so..

Jun 09 20:30:51 alarmpi motion[325]: [1] [ERR] [NET] netcam_handler_loop: Error getting jpeg image
Jun 09 20:30:51 alarmpi motion[325]: [1] [ERR] [NET] netcam_read_rtsp_image: invalid frame!: Broken pipe
Jun 09 20:30:51 alarmpi motion[325]: [1] [ERR] [NET] netcam_handler_loop: Error getting jpeg image
Jun 09 20:30:51 alarmpi motion[325]: [1] [ERR] [NET] netcam_read_rtsp_image: invalid frame!: Broken pipe
Jun 09 20:30:51 alarmpi motion[325]: [1] [ERR] [NET] netcam_handler_loop: Error getting jpeg image
Jun 09 20:30:51 alarmpi motion[325]: [1] [ERR] [NET] netcam_read_rtsp_image: invalid frame!: Broken pipe
Jun 09 20:30:51 alarmpi motion[325]: [1] [ERR] [NET] netcam_handler_loop: Error getting jpeg image
Jun 09 20:30:51 alarmpi motion[325]: [1] [ERR] [NET] netcam_read_rtsp_image: invalid frame!: Broken pipe
Jun 09 20:30:52 alarmpi motion[325]: [1] [ERR] [NET] netcam_handler_loop: Error getting jpeg image
Jun 09 20:30:53 alarmpi motion[325]: [1] [ERR] [NET] netcam_read_rtsp_image: invalid frame!: Broken pipe
Jun 09 20:30:53 alarmpi motion[325]: [1] [ERR] [NET] netcam_handler_loop: Error getting jpeg image
Jun 09 20:30:54 alarmpi motion[325]: [1] [ERR] [NET] netcam_read_rtsp_image: invalid frame!: Broken pipe
Jun 09 20:30:55 alarmpi motion[325]: [1] [ERR] [NET] netcam_handler_loop: Error getting jpeg image
Jun 09 20:30:55 alarmpi motion[325]: [1] [ERR] [NET] netcam_read_rtsp_image: invalid frame!: Broken pipe
Jun 09 20:30:55 alarmpi motion[325]: [1] [ERR] [NET] netcam_handler_loop: Error getting jpeg image
Jun 09 20:30:56 alarmpi motion[325]: [1] [ERR] [NET] netcam_read_rtsp_image: invalid frame!: Broken pipe
Jun 09 20:30:56 alarmpi motion[325]: [1] [ERR] [NET] netcam_handler_loop: Error getting jpeg image
Jun 09 20:30:57 alarmpi motion[325]: [1] [ERR] [NET] netcam_read_rtsp_image: invalid frame!: Broken pipe
Jun 09 20:30:57 alarmpi motion[325]: [1] [ERR] [NET] netcam_handler_loop: Error getting jpeg image
Jun 09 20:30:58 alarmpi motion[325]: [1] [ERR] [NET] netcam_read_rtsp_image: invalid frame!: Broken pipe

@Mr-Dave
Copy link

Mr-Dave commented Jun 14, 2014

I'd invite testers to try my fork for RTSP fixes. If functional, I can see if I can figure out how to create a pull request for the trunk.

@tosiara
Copy link

tosiara commented Jun 14, 2014

@drewzh , yes, similar issues have been discussed in mail list: http://sourceforge.net/p/motion/mailman/message/32337736/. Looks like we need "rtsp reconnect" functionality to restore disconnected stream. I tried, but unsuccessfully. Wish someone with ffmpeg+RTSP knowledge can sort this out

@Mr-Dave , I'm happy to do the tests. However, I tried to go through your code changes and so far there is a lot of noise, like space/tab indentions, which makes it hard to understand - what significant changes have been done? But I will try to build your fork to see if makes any improvement for RTSP

@drewzh
Copy link
Author

drewzh commented Jun 14, 2014

@Mr-Dave I've actually compiled and I'm currently running your branch. The errors indicated in this ticket seem to have subsided with your code and I've found no issues when it's working.

Unfortunately the resource issue still exists, I'm going to revert to HTTP and see if it still exists. Unfortunately it's difficult to track down as I have to monitor it for hours. I can't get valgrind to run on the raspberry pi to detect memory leaks.

Anybody have a suggestion?

@Mr-Dave
Copy link

Mr-Dave commented Jun 14, 2014

Sorry about the noise. My code editor thinks it knows better and my first time with git. Issues addressed in my branch are added RTSP basic authentication, RTSP reconnect, new configure and compiler flags for identification of ffmpeg. Regarding resources, try to INCREASE your frame rate in your config. The motion sleep function currently implemented is very precise but also very CPU intensive.

@drewzh
Copy link
Author

drewzh commented Jun 14, 2014

My pi runs steady at around 50-60% CPU at 640x320@5fps , at the moment I'm thinking it's probably a memory issue but haven't yet found the time to test again. I have seen it climb to 80% memory usage (used by motion) and shortly after i was unable to get a response. I'm going to have another play tomorrow, but thanks for the tip about the sleep function affecting CPU usage.

@drewzh
Copy link
Author

drewzh commented Jun 19, 2014

@Mr-Dave your latest master fixes this issue, thanks very much for your contribution; you've made my home security work again! 👍

@tosiara
Copy link

tosiara commented Jun 23, 2014

@drewzh cool, thanks for testing. I'm going also review functional changes (so far only related to netcam and rtsp) and create experimental branch
@Mr-Dave keep coding! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants