VideoHelp Forum
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. Member
    Join Date
    May 2012
    Location
    United States
    Search PM
    i use follow video to test


    I need extract frames exact on each second.
    So:
    f1.png should be 00:00:01.000
    f2.png should be 00:00:02.000
    and so on.

    i have two variants of command line

    Variant 1
    Code:
    -y -i "10 Minutes Countdown.webm"  -an -r 1 -ss 1 -f image2 test_out\f%%d.png
    This one give me follow results:

    f1.png - 00:00:01.000
    f2.png - 00:00:01.042
    f3.png - 00:00:01.917
    f4.png - 00:00:02.917
    f5.png - 00:00:03.917
    f6.png - 00:00:04.875
    There is acceptable for rounding precision. ( 1.917 or 2.000 does not matter )
    but why first 2 frames is so strange ?

    -ss 1 optional - without it result is same but starting from 0.




    Variant 2

    Code:
    -y -i "10 Minutes Countdown.webm"  -an -f image2 -ss 1 -vframes 1 test_out2\f1.png -ss 2 -vframes 1 test_out2\f2.png -ss 3 -vframes 1 test_out2\f3.png -ss 4 -vframes 1 test_out2\f4.png  ........
    this variant give me exact what i need. but command line is too long. for long video need split for several runs.
    AND processing by this way is too slow.
    Last edited by mogadanez; 3rd May 2012 at 08:03.
    Quote Quote  
  2. 1. quick&dirty solution: save all frames, delete all the frame you don't want,..
    (ffmpeg -i "Path to input" "Path to outputfolder\output%d.png", mencoder or Avisynth&Imagewriter, or Virtual Dub should be able to produce the clip->png transition)
    Pro: works and is relatively fast
    Contra: high hdd space requirement, needs automated way to delete unwanted images

    2. write a long avisynth script with a lot of ImageWriter(file="Output folder\Basename",start=0375,end=0375,type="png") entries run through the avisynth script with i.e. AVSMeter
    Quote Quote  
  3. Selur , if you are using avisynth can't you just do SelectEvery? So you don't need to delete images

    e.g

    FFVideoSource()
    AssumeFPS(24)
    SelectEvery(24,0)
    ImageWriter("Output%03d.png", 0,1000) # use different endpoint if you want

    What I don't get is the frames are perfect 00:00:00:00, 00:00:01:00, etc... but at 41 seconds, it becomes 00:00:41:042 ? (no longer 000 at the end). The internal timebase is corrected for 24.0 with AssumeFPS, not 24000/1001 as the original, and SelectEvery makes it so it's exactly 1 FPS

    EDIT: OK I see 00:00:41:000 doesn't exist in original file because of the original timebase of 23.976 (24000/1001)
    Last edited by poisondeathray; 4th May 2012 at 10:17.
    Quote Quote  
  4. there are probably a lot more ways this can be done in avisynth,..

    OK I see 00:00:41:000 doesn't exist in original file because of the original timebase of 23.976 (24000/1001)
    that's the main problem behind the idea, there isn't really always a frame that is exactly at a specific second so one will always be a bit off on some frames just through the rounding.

    Cu Selur
    Quote Quote  
  5. I think there might be rounding errors in his overlay information for the video. It doesn't conform to 24.0 or 24000/1001, but the encoded video timebase is 24000/1001. On frame 960, for a 24.0 clip it should read 00:00:40.000 (which his does), but 00:00:41:000 should exist on frame 984 (his is missing the frame). And on a 24000/1001 clip it should read 00:00:40.040 on frame 960 , not 00:00:40.000

    On a 24.0 clip, there should be frames with whole seconds with none missing

    You can check with these

    Code:
    blankclip(length=5000)
    assumefps(24000,1001)
    showtime
    or

    Code:
    blankclip(length=5000)
    assumefps(24)
    showtime

    So there are workarounds in avisynth, but I still don't understand why ffmpeg screws up the first few frames ? (ffmbc had same behaviour too)
    Last edited by poisondeathray; 4th May 2012 at 10:49.
    Quote Quote  
  6. that's probably a seeking+decoding problem,... (if it's a VP8 source you would have far more problems,.. since ffmpeg should behave like ffmpegsource, see: https://forum.videohelp.com/threads/345279-VP8-vs-x264)

    Cu Selur
    Quote Quote  
  7. Originally Posted by Selur View Post
    that's probably a seeking+decoding problem,... (if it's a VP8 source you would have far more problems,.. since ffmpeg should behave like ffmpegsource, see: https://forum.videohelp.com/threads/345279-VP8-vs-x264)

    Cu Selur
    Do you mean ffmpeg seeking & decoding issue? It does the same behaviour with lossless encode or I-frame made video

    Or did you mean the timebase discrepancy? I tested using ffmpegsource2, with the flv (i didn't even bother with the VP8 version, because of your testing in those threads). Also indexed raw avc show discrepancy in the overlay

    But even on properly made video, ffmpeg still has those messed up first few frames (There's 2 different issues here, the overlay error, and the original issue with ffmpeg)
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!