user14107: 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? 

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


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

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

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

<p>Then checked it with ffprobe:</p>

<blockquote>
  <p>ffprobe -i out.mpg -show_frames | grep key_frame</p>
</blockquote>

<p>And received the following results:</p>

<blockquote>
  <p>key_frame=1 <br>key_frame=1 <br>key_frame=1 <br>key_frame=1 <br>key_frame=1<br>
  key_frame=1<br> key_frame=1<br> key_frame=1<br> key_frame=0<br> key_frame=1<br>
  key_frame=0 <br>key_frame=1<br> key_frame=0 <br>key_frame=1 <br>key_frame=0<br>
  key_frame=1<br> key_frame=0 <br>key_frame=1<br> key_frame=1<br> key_frame=1<br>
  key_frame=1 <br>key_frame=0 <br>key_frame=1<br> key_frame=1<br> key_frame=1<br>
  key_frame=1 <br>key_frame=1</p>
</blockquote>

<p>Can you please explain how to correct transcoding H264 and set GOP IP Pattern? </p>
 1871: <p>Use</p>

<pre><code>ffmpeg -i INPUT -vcodec libx264 -g 2 -acodec copy -y out.mpg
</code></pre>

<hr>

<p>As per the x264 docs, <code>scenecut=0</code> disables scenecut evaluation.</p>
