0

I need to transcode mpeg2 video via H264 codec and GOP structure should be IP. I use the following command for this:

ffmpeg -i INPUT -vcodec libx264 -x264-params keyint=2:scenecut=-1:ref=1 -acodec copy -y out.mpg

Then checked it with ffprobe:

ffprobe -i out.mpg -show_frames | grep key_frame

And received the following results:

key_frame=1
key_frame=1
key_frame=1
key_frame=1
key_frame=1
key_frame=1
key_frame=1
key_frame=1
key_frame=0
key_frame=1
key_frame=0
key_frame=1
key_frame=0
key_frame=1
key_frame=0
key_frame=1
key_frame=0
key_frame=1
key_frame=1
key_frame=1
key_frame=1
key_frame=0
key_frame=1
key_frame=1
key_frame=1
key_frame=1
key_frame=1

Can you please explain how to correct transcoding H264 and set GOP IP Pattern?

2

Use

ffmpeg -i INPUT -vcodec libx264 -g 2 -acodec copy -y out.mpg

As per the x264 docs, scenecut=0 disables scenecut evaluation.

  • Thanks for the quick answer. I tried it, but received the same result. – Ivan Kolesnikov Jan 31 '17 at 16:55
  • 1
    Works here. Run ffprobe out.mpg -show_entries frame=key_frame -select_streams v -of compact=p=0. Audio frames are also reported in your command. – Gyan Jan 31 '17 at 16:59
  • Much Appreciated! – Ivan Kolesnikov Jan 31 '17 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.