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?

1 Answer 1

2

Use

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

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

3
  • Thanks for the quick answer. I tried it, but received the same result. Commented Jan 31, 2017 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. Commented Jan 31, 2017 at 16:59
  • Much Appreciated! Commented Jan 31, 2017 at 17:09

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.