Page 1 of 1

ffmpeg streams and image corruption

Posted: Fri Sep 20, 2013 11:56 pm
by sjthespian
As I mentioned in another post, I'm using ffmpeg to capture images and detect motion from Ubiquiti AirCams. Some of my cameras are working perfectly, but others are giving me false motion detection with images that look like the one attached.

The only smoking gun I can find is messages like the following in the logs:

Code: Select all

Sep 20 16:17:20 zm zmc_m6[17042]: WAR [Buffer overrun at index 26, image 696386, slow down capture, speed up analysis or increase ring buffer size]
Sep 20 16:17:20 zm zmc_m6[17042]: WAR [Buffer overrun at index 26, image 696416, slow down capture, speed up analysis or increase ring buffer size]
Sep 20 16:17:20 zm zmc_m6[17042]: WAR [Buffer overrun at index 26, image 696446, slow down capture, speed up analysis or increase ring buffer size]
I have tried increasing the ring buffer size and tweaked the fps to no avail. I don't believe it is a shared memory issue as the max seg size is already up to 2GB and I'm not seeing any shmget errors in the logs. It's possible that it's just ffmpeg mis-intrepreting the stream, but I don't really have a way to tell.

Does anyone have any tips on how to track this down and fix it? At the moment, ZM is fairly useless to me for motion detection because of this problem and the corrupted images.

Thanks!

Re: ffmpeg streams and image corruption

Posted: Sat Sep 21, 2013 7:58 am
by Magic919
I had something like this once and it was duplicate processes. I had to stop ZM and then look for the remaining process and kill them. Worked ok after that.

Re: ffmpeg streams and image corruption

Posted: Sat Sep 21, 2013 11:21 pm
by sjthespian
I think I found the solution. If you're using an ffmpeg stream you have to leave the FPS boxes empty in the camera General tab. I changed that last night on all of my Ubiquti cameras and haven't had a single glitched frame yet.

Unfortunately I can't say the same thing for my TrendNET TV-I262PI, now I have to figure out the magic settings to get it working reliably. I had it working with snapshots, but the frame rate was horrible. I found the magic URL to get mpeg4 from it but it is occasionally glitchy.

Re: ffmpeg streams and image corruption

Posted: Sun Sep 22, 2013 5:08 am
by tkalfaoglu
if your camera permits, can you reduce the FPS from its interface?

Re: ffmpeg streams and image corruption

Posted: Sun Sep 22, 2013 11:40 pm
by sjthespian
tkalfaoglu wrote:if your camera permits, can you reduce the FPS from its interface?
Yep, I'm also going to play with the resolution to see if that will make a difference. It's a shame to have a 1MP camera if I can only use 640x480 @10FPS (for example) though.

Re: ffmpeg streams and image corruption

Posted: Mon Sep 23, 2013 5:29 am
by tkalfaoglu
If that's any relief, I didn't have to reduce the resolution on my FI9805; just the frame rate.. It seems to behave well at 5FPS at 1280x720
-t