[FFmpeg-user] How to output real frame number instead of sequentially added image numbers

tracey jaquith tracey at archive.org
Tue Jan 22 23:55:06 CET 2013

Hi Bernard,

This kind of was a maddeningly needed/wanted feature for me, too 8-)
and actually one step further -- I wanted the actual seconds as close as
possible from the start for each frame extracted.  (If this works for you, you
could tailor it to taste for either frame# (easier) or seconds-from-start like
it will do by default).  I'm nearly certain there is no option to do what you suggest
but OTOH I love to be wrong so I don't need to code 8-)

This isn't really ready for primetime (I'm hacking around by stashing some new globals to
get information in the detection/identify part of the code) but it seems
to work pretty nicely.  Very recently, I was using avidemux to make an .idx
(index) file for MPEG1/MPEG2/MPEG-TS and then parsing it to find
the timestamp of GOP for a given frame number to go from
   "frame number" => "seconds from start"
(but now with the updated/current patch, I get very close to the number of seconds
 directly with the patched ffmpeg).


I would second an option (and would be happy to work on a more robust unhacky
solution/patch for consideration?) to output the #seconds or frame number
of each output frame

(My build and patch applying scripts, overall, is here, given the kinds of things
 we do at my work (h.264 and ogv theora creation, vpx/WebM possible)):


hope that helps!

On Jan 22, 2013, at 12:56 AM, bernard vrh <bernard.vrh at gmail.com> wrote:

> How to output real frame number instead of sequentially added image numbers
> Hello,
> I trying to generate scene change keyframes from input video file.
> Using   %d.jpeg   output a series of jpeg frames as images named in
> sequential order.. and such labeled images (keyframes) do not
> representing real time code or reflecting time position of keyframe
> images in input video clip.
> the only parameter which works is %d
> My example:
> ffmpeg  -i "C:\myfilename.avi"  -vf select="eq(pict_type\,I)" -vsync 2
> -s 200x112  -f image2  "D:\myoutput_frames\%d.jpeg"
> Please suggest which parameter should be used instead of  %d  to
> output video time code stamp  or video frame number,  zero or one
> based relative to input video clip.
> Kind regards,
> Bernard
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user

More information about the ffmpeg-user mailing list