[KPhotoAlbum] Would like an option to not extract multiple frames for video thumbnails

Robert Krawitz rlk at alum.mit.edu
Mon Jun 26 17:13:39 BST 2017

On Mon, 26 Jun 2017 17:59:38 +0200, Johannes Zarl-Zierl wrote:
> Hi Robert,
> On Sonntag, 18. Juni 2017 21:02:16 CEST Robert Krawitz wrote:
>> The video thumbnail process is unpleasantly slow and CPU-intensive;
>> I'd prefer to simply be able to extract the first frame of the video
>> and use that.  But before I hare off and do that, I'd like to get
>> other thoughts on this and possible alternatives.
> Sorry for not coming back to you sooner (and I haven't forgotten about your patches, either). I wanted to take the time to think about the issue and answer afterwards. As I don't see that happening for the foreseeable future, here are my ad-hoc thoughts:
> Thought A:
> I just saw that we call ffmpeg with the "-ss" parameter after "-i". This means that we do an accurate seek[1]. Changing this could possibly improve performance.

My own experience has been that it can make a significant difference.

> Thought B:
> If we make this configurable, my gut instinct for the UI would be:
> Let the user decide how many frames per minute to extract.
> The downside to this is that I'm not sure if we always know the video duration when we start the thumbnail extraction. So a (configurable but) fixed number of frames is probably better from the implementation point of view.

Depends on the video type.  For MP4's and such it can be determined
easily; for streaming containers (such as TS) it might not.

Another option would be X frames per limit, with an upper limit of Y
total.  This obviously will result in the entire video not being
thumbnailed, but I'm not sure how necessary that is.

> Thought C:
> Changing the number of video thumbnails to 1 means that the "select the next thumbnail" won't work anymore.

Right, which I don't care about.

> Thought D:
> With a low number of video thumbnails, choosing a good offset becomes ever more important. Taking e.g. the first/last frame of a video is almost guaranteed to give you a bad preview image.

Depends on the video.  In my case I have a lot fewer videos than
stills (by close to 3 orders of magnitude) and even the first frame
will usually tell me enough.  People who add titles to their videos
might typically start that on the first frame, making it easier.

As usual, different people have different needs here, which is why I
think it should be configurable.  In my case, I don't normally shoot
many videos, but when I do, it greatly slows down the thumbnailing
process (and my entire system, since ffmpeg is using lots of threads).
Robert Krawitz                                     <rlk at alum.mit.edu>

***  MIT Engineers   A Proud Tradition   http://mitathletics.com  ***
Member of the League for Programming Freedom  --  http://ProgFree.org
Project lead for Gutenprint   --    http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton

More information about the Kphotoalbum mailing list