user26100: I need to transcode a video to another one with the following properties:

GOP size is always fixed at a given value
Only IDR frames are used as key-frames (not I-slices)
SPS/PPS/VPS frames are repeated every time before the IDR frame.

Is there a way to do this with ffmpeg?
Also, it would be great if you can also tell me of a simple way of verifying all this (perhaps using ffprobe?).

user1871: Minimal command line, for a GOP size of 2 seconds:
ffmpeg -i input -force_key_frames expr:gte(t,n_forced*2) -c:v libx265 -x265-params open-gop=0:scenecut=0:repeat-headers=1 output.hevc
Verification:
ffmpeg -i output.hevc -c copy -bsf:v trace_headers -f null -

After each line containing key frame e.g.,
Packet: 18115 bytes, key frame, no pts, dts 2319977, duration 40000.

You should see the VPS/SPS/PPS. The first Slice Segment Header that follows should have a NAL unit type of 20 which is IDR_N_LP.
ffprobe can't invoke bitstream filters.

26100: <p>I need to transcode a video to another one with the following properties:</p>

<ul>
<li>GOP size is always fixed at a given value</li>
<li>Only IDR frames are used as key-frames (not I-slices)</li>
<li>SPS/PPS/VPS frames are repeated every time before the IDR frame.</li>
</ul>

<p>Is there a way to do this with ffmpeg?</p>

<p>Also, it would be great if you can also tell me of a simple way of verifying all this (perhaps using ffprobe?).</p>
 1871: <p>Minimal command line, for a GOP size of 2 seconds:</p>

<p><code>ffmpeg -i input -force_key_frames expr:gte(t,n_forced*2) -c:v libx265 -x265-params open-gop=0:scenecut=0:repeat-headers=1 output.hevc</code></p>

<p>Verification:</p>

<pre><code>ffmpeg -i output.hevc -c copy -bsf:v trace_headers -f null -
</code></pre>

<p>After each line containing key frame e.g.,</p>

<pre><code>Packet: 18115 bytes, key frame, no pts, dts 2319977, duration 40000.
</code></pre>

<p>You should see the VPS/SPS/PPS. The first <code>Slice Segment Header</code> that follows should have a NAL unit type of <code>20</code> which is IDR_N_LP.</p>

<p>ffprobe can't invoke bitstream filters.</p>
