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
This one give me follow results:Code:-y -i "10 Minutes Countdown.webm" -an -r 1 -ss 1 -f image2 test_out\f%%d.png
There is acceptable for rounding precision. ( 1.917 or 2.000 does not matter )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
but why first 2 frames is so strange ?
-ss 1 optional - without it result is same but starting from 0.
Variant 2
this variant give me exact what i need. but command line is too long. for long video need split for several runs.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 ........
AND processing by this way is too slow.
+ Reply to Thread
Results 1 to 7 of 7
-
Last edited by mogadanez; 3rd May 2012 at 08:03.
-
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 -
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.
-
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)
Cu Selur -
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
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.
-
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)
Similar Threads
-
Extract all frames from video files
By nic3 in forum EditingReplies: 6Last Post: 25th Dec 2016, 15:21 -
how to extract I (Intra) P (predictive) & B (Bidirect) Frames from video?
By tnwmn in forum Newbie / General discussionsReplies: 4Last Post: 27th Feb 2012, 21:57 -
How extract frames in MPEG-4
By ahrouhi in forum EditingReplies: 1Last Post: 1st Nov 2010, 01:27 -
[FFMPEG] mpg > jpg , not all frames is outputted
By squadjot in forum Video ConversionReplies: 3Last Post: 2nd Jan 2010, 17:58 -
FFMPEG: Extracting multiple frames at different intervals
By roden in forum Newbie / General discussionsReplies: 0Last Post: 27th Sep 2007, 11:35