ranger-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ranger-users] Video files: thumbnail previews


From: Joshua Landau
Subject: Re: [Ranger-users] Video files: thumbnail previews
Date: Tue, 30 Jul 2013 16:24:33 +0100

On 30 July 2013 06:27, niku <address@hidden> wrote:
Joshua, I had not read your mail before making a reply in another
thread. Did you try the following?

        ffmpeg -ss 10 -i INPUT_FILE -vframes 1 -y OUTPUT.png

This works blazingly fast on my system. (Less than 0.1 second for the
files I tried.)

I gather that the difference is because in some cases all frames upto
the 10th second are decoded, and in some they are not. FFmpeg looks
like black art. You have to know precisely what you want and how
ffmpeg works, but once you know these things, you can do almost
anything with your video and audio files!

You use -ss _after_ the input file, and that makes ffmpeg read the
file to go frame by frame to construct what would be seen at 10th
second exactly. That is precise, but that is not what we want. Since
we don’t need accuracy, we can use -ss _before_ the input file, which
just looks for keyframes†, and seeks for the 10th second as, for
example, mplayer would do. This is much faster, as no preceding frames
are decoded. (btw, I learnt that mplayer and ffmpeg originate from the
same code base, and even now share much of the code.)

See `Nicolas George-2'’s first message on this page:
http://ffmpeg-users.933282.n4.nabble.com/Reducing-seek-time-when-start-time-offset-ss-is-large-td1460307.html

https://en.wikipedia.org/wiki/Key_frame

I very much know about this but when I tried it the speed was identical to the previous incarnation. I avoided mentioning it because mentioning too much oft causes confusion ;).

If I put the -ss where the -itsoffset was the time is near identical¹ (if I put it after the -i INPUT_FILE it takes much, much longer). I'd guess that the difference between our results is to do with the quality of the video files, the ability to process in hardware, my slow hard drive and my aged CPU.

Either way ffmpegthumbnailer works relatively fast² and well (and my hack, too), and ffmpegthumbnailer skips to 10% automatically, a better prospect in my opinion. Hence go with that.

¹ 15.80s user 0.34s system 152% cpu 10.607 total
² For me it's about a second, so 10x faster. I expect it'd be at least comparable to the best ffmpeg options for you.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]