|
From: | Joshua Landau |
Subject: | Re: [Ranger-users] Video files: thumbnail previews |
Date: | Tue, 30 Jul 2013 16:24:33 +0100 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |