FFMPEG + Rotate = Low Frame Rate

Forum for questions and support relating to the 1.31.x releases only.
Locked
canbikehere
Posts: 16
Joined: Tue Feb 27, 2018 6:09 pm

FFMPEG + Rotate = Low Frame Rate

Post 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...
User avatar
iconnor
Posts: 2900
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: FFMPEG + Rotate = Low Frame Rate

Post by iconnor »

Interesting. I use rotate on a few cameras and don't have any trouble. I'll take a closer look
canbikehere
Posts: 16
Joined: Tue Feb 27, 2018 6:09 pm

Re: FFMPEG + Rotate = Low Frame Rate

Post 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.
xenoxaos
Posts: 4
Joined: Thu Apr 05, 2018 7:06 am

Re: FFMPEG + Rotate = Low Frame Rate

Post 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).
Attachments
Before Mouse Over.png
Before Mouse Over.png (114.58 KiB) Viewed 2881 times
On Mouse Over.png
On Mouse Over.png (128.71 KiB) Viewed 2881 times
canbikehere
Posts: 16
Joined: Tue Feb 27, 2018 6:09 pm

Re: FFMPEG + Rotate = Low Frame Rate

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