Closed Rayn0r closed 6 years ago
I found the code section responsible this, but it's been there since Jan 2nd. If I understood correctly, then a thumbnail is created from the frame with the highest score. Is there a way to postpone this until the page was loaded, or to create the image after the event was closed? In commit 4889f3d0e8866171ca47dfc79f8f2f6e81dd8663 you reworked the logic behind this. Could this be the culprit?
Under the storage tab, have it save a snapshot jpg instead of saving no jpegs. Then ZM won't have to try to generate one.
On my system, ffmpeg generates this image almost instantly, but then my mp4's are not 15 minutes long.
I think you are right though. For long events we should limit how far in thumbnail generation will go.
This might be slightly mitigated on latest builds. We were ignoring the existence of a snapshot image.
After updating to latest git, event pages load almost instantly, when snapshot image is enabled. ffmpeg is not spawned anymore upon opening a page. Thank you very much.
I'm running latest HEAD
75c11431e622ccd274d51812c3e313b0cb204142
on my machine.Upon opening the Event-View it takes 3-4 minutes before the content shows up. When opening the view Apache starts multiple ffmpegs. The command line looks like this:
ffmpeg -ss 634.84 -i /var/cache/zoneminder/events/1/17/06/18/22/00/00/6206-video.mp4 -frames:v 1 /var/cache/zoneminder/events/1/17/06/18/22/00/00/15848-capture.jpg
Running this outside zoneminder with
time
shows:ffprobe /var/cache/zoneminder/events/1/17/06/18/22/00/00/6206-video.mp4
shows this:This is a 15 min file. Since ffmpeg has to decode 10 mins of the video to capture a single frame it takes a while.
Jumping ~70% into the video is probably not a good idea. Since we know the event length, isn't it best to only jump a few seconds into the recording, but no further than the event length?