I want to encode after seeking to a certain position, and i want to make the first frame a key-frame, here the command i used:
ffmpeg -ss 300 -i howimet.mp4 -acodec libfaac -ar 48000 -ab 128k -ac 2 -vcodec libx264 -vf "scale=480:270" -f mpegts -force_key_frames 300 -t 120 howimet2.ts
the -force_key_frames is set to seek position to make a key frame there. I use the following script (from here) to check if the first frame is key-frame
ffprobe -show_frames -v quiet howimet2.ts | awk -F= ' /pict_type=/ { if (index($2, "I")) { i=1; } else { i=0; } }
/pkt_pts_time/ { if (i && ($2 >= 0)) print $2; }
' | head -n 1
The result show the first key-frame is not locate at second 0.
I guess my command is not correct. what am I missing?