Changes between Version 1 and Version 2 of Seeking


Ignore:
Timestamp:
Jul 24, 2012, 11:57:13 PM (7 years ago)
Author:
burek
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Seeking

    v1 v2  
    1010}}}
    1111
     12[[Image(out1.jpg)]]
     13
    1214This example will produce 1 image frame (out1.jpg) somewhere around 3rd minute from the beginning of the movie. The input will be parsed '''using keyframes''', which is '''very fast'''. The drawback is that it will also finish the seeking at some keyframe, not necessarily located at specified time (00:03:00), so the seeking will not be as accurate as expected.
    1315
     
    2022}}}
    2123
    22 This example will also produce 1 image frame (out2.jpg) precisely at 3rd minute from the beginning of the movie. The input is parsed '''very slowly''', frame by frame. The advantage is that you'll get the frame at exactly 3rd minute, but the drawback is that it will take a lot of time until it finally reaches that time point. The bigger the seeking time is, the longer you will have to wait.
     24[[Image(out2.jpg)]]
     25
     26This example will also produce 1 image frame (out2.jpg) precisely at 3rd minute from the beginning of the movie.
     27
     28''Note the time difference on the clocks between the images out1.jpg and out2.jpg. The first one shows  "00:02:05:05" and the second shows "00:02:05:06".''
     29
     30The input is parsed '''very slowly''', frame by frame. The advantage is that you'll get the frame at exactly 3rd minute, but the drawback is that it will take a lot of time until it finally reaches that time point. The bigger the seeking time is, the longer you will have to wait.
    2331
    2432= Fast and accurate seeking =
     
    3038}}}
    3139
     40[[Image(out3.jpg)]]
     41
    3242This approach is combining the best characteristics of both fast and accurate ways of seeking in FFmpeg. Shortly, we first seek very fast somewhere before the 3rd minute and then we slow down and seek frame by frame to the 3rd minute. This works because FFmpeg will first seek by keyframes, until it reaches at 00:02:30, when it will stop at the last keyframe found (somewhat before 00:02:30, depending on the [http://en.wikipedia.org/wiki/Group_of_pictures gop size]/keyframes interval of the input) and then it will slowly seek the next 00:00:30 seconds to the desired time point. The result should be the same as in "Accurate seeking" section, only a lot faster.
    3343
    34 For the reference, compare the attached images of out1.jpg, out2.jpg and out3.jpg
     44''Note that both out2.jpg and out3.jpg show the same time on the clock "00:02:05:06"''