Page 1 of 1

FFMPEG + Rotate = Low Frame Rate

Posted: Mon Apr 16, 2018 8:34 pm
by canbikehere
I posted a while back around an issue I was having with an h.264 camera and Zoneminder; long story short I have been unable to get anything reasonable as a frame rate from the main stream using FFMPEG. LibVLC works fine, but doesn't work with h.264 passthrough.

I narrowed the issue down today to the 'Rotate' function in ZM. If I have the stream set up with 'Normal' rotation everything works perfectly, the framerate easily matches what it is configured to on the camera, CPU utilization is reasonable, etc. However if I change the rotation in Zoneminder to 'Right' (which is what I need for this particular camera) the frame rate drops down to almost nothing, though it does vary. Setting the I-frame interval on the camera to a very short time helps though the max frame rate is still extremely limited.

TLDR;
- 'Source' set to 'Normal' rotation = everything works properly
- 'Source' set to 'Right' rotation = Zoneminder can't even come close to keeping up with the camera

Running iconnor's StorageAreas branch, 1.31.40...

Re: FFMPEG + Rotate = Low Frame Rate

Posted: Mon Apr 16, 2018 10:30 pm
by iconnor
Interesting. I use rotate on a few cameras and don't have any trouble. I'll take a closer look

Re: FFMPEG + Rotate = Low Frame Rate

Posted: Mon Apr 16, 2018 11:44 pm
by canbikehere
Some details:

- ZM can easily reach the camera frame rate with libvlc whether rotation is enabled or not (just no h.264 passthru)
- The frame rate drop isn't entirely consistent; it tends to be variable. I haven't been able to find a rhyme or reason as to this variability. At best I can reach 5ish FPS but at times it will be less than 1 FPS. Camera is configured for 12 FPS.
- If I set the 'group of pictures' setting on the camera to 0.25 seconds I was able to pretty consistently get around 4-5 FPS with rotation enabled. The default setting on the camera is 3.0 seconds; with rotation enabled it seems like I get a frame every "group of pictures" seconds.
- VLC running on my computer has no trouble achieving the full frame rate of the camera, right up to its maximum
- When the frame rate drops the zmc process CPU usage drops too; this isn't a case of running out of CPU resources
- The stream in question is set up as nodect
- The stream in question is a 1920x1080 h.264 stream
- Plenty of shm space on the server

I'm happy to open an RTSP port to a specific external IP if it'd help troubleshoot. The camera is a GeoVision GV-EFD2100.

Re: FFMPEG + Rotate = Low Frame Rate

Posted: Wed Apr 18, 2018 1:00 am
by xenoxaos
I'm not having any issues with frame rate and ffmpeg with h.264 passthrough. The only thing I'm seeing an issue with is doing a mouse over of the thumbnail from the event lists (which I'm still digging into myself).

Re: FFMPEG + Rotate = Low Frame Rate

Posted: Wed Apr 18, 2018 7:27 am
by canbikehere
What is the resolution of your camera? I have no issues with the substream on this camera, which I'm using for motion detection. The main stream at full HD resolution is another story though...