I'm looking a way to extract every second (2nd) I-Frame using ffmpeg and save them as a new timelapse video.
So far I managed to save all I-frames by the following command:
ffmpeg -i $FILE -vf "select='eq(pict_type,I)',setpts=N/FRAME_RATE/TB" -r 29.97 -vcodec libx264 -b:v 62M -an ./enc/${FILE}_cnv.mp4
but I need twice less I-frames in the resulting video. For example, if the I-frames in the original video are 1-8-16-24-32-40..., I need only 1-16-32-48... Is there a way to extract them without making a temporary video with all keyframes?
Update: since no universal solution was found, I decided to cheat with: -vf "select='eq(pict_type,I)*not(mod(n,16))',setpts=N/FRAME_RATE/TB"