i want to extract the first image from every second of video. i have a command line, based on the video's timecode, that works correctly when the video is progressive, but not when interlaced (only the first field is output in that case, creating a half-height image). i've tried various combinations of bwdif
with select
but the filter chains i create either cause errors or still return a half-sized image. can someone help me with the syntax ?
here is my call w/a filter that works correctly for progressive video source :
ffmpeg -i $infile -vf "select='if(eq(n\,0),1,floor(t)-floor(prev_selected_t))" -vsync 0 $outfile
the following still return only half-height images for interlaced source :
... -vf "bwdif=0,select='if(eq(n\,0),1,floor(t)-floor(prev_selected_t))'"
... -vf "bwdif=0,select='between(mod(n\,$ips)\,1\,2)'"
-- $ips
is images per second
... -vf "select='between(mod(n\,$ips)\,1\,2)',bwdif=0"
...and on a related note, is there some truly complete, exhaustive documentation anywhere on the select
filter ? (no, i don't consider 'ffmpeg filters' chapter 16.16 exhaustive).
thanks.
yadif
for deinterlacing?yadif
andbwdif
will deinterlace. however, i still need to specify the constraint that i want only the first frame of each second (which is the first two fields of an interlaced video). that is whatselect
does.