ffmpeg streams and image corruption

Forum for questions and support relating to the 1.26.x releases only.
Locked
sjthespian
Posts: 5
Joined: Tue Nov 13, 2012 11:20 pm

ffmpeg streams and image corruption

Post 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!
Attachments
016-capture.jpg
016-capture.jpg (75.64 KiB) Viewed 4347 times
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: ffmpeg streams and image corruption

Post 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.
-
sjthespian
Posts: 5
Joined: Tue Nov 13, 2012 11:20 pm

Re: ffmpeg streams and image corruption

Post 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.
tkalfaoglu
Posts: 65
Joined: Wed Nov 22, 2006 6:19 am

Re: ffmpeg streams and image corruption

Post by tkalfaoglu »

if your camera permits, can you reduce the FPS from its interface?
sjthespian
Posts: 5
Joined: Tue Nov 13, 2012 11:20 pm

Re: ffmpeg streams and image corruption

Post 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.
tkalfaoglu
Posts: 65
Joined: Wed Nov 22, 2006 6:19 am

Re: ffmpeg streams and image corruption

Post 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
Locked