<p>For H264</p>

<pre><code>ffmpeg -i input -c:v libx264 -intra output
</code></pre>

<p>For H265, seems no alias or preset has been set yet</p>

<pre><code>ffmpeg -i input -c:v libx265 -x265-params frame-threads=4:keyint=1:ref=1:no-open-gop=1:weightp=0:weightb=0:cutree=0:rc-lookahead=0:bframes=0:scenecut=0:b-adapt=0:repeat-headers=1 output
</code></pre>

<p>H265 code <s>stolen</s>borrowed from <a href="https://superuser.com/q/935930/114058">here</a>.</p>

CC BY-SA 3.0
2015-11-22T10:01:45.200Z
The commands for h265 can be used for h264 as well including some tuning ? Also, can I use `frame-threads=1` instead of 4 ? Thanks :)
user3450548
CC BY-SA 3.0
2015-11-22T10:08:47.583Z
Should be no problem, on both counts.
Gyan
CC BY-SA 3.0
2015-11-22T11:01:34.357Z
Thank you :) Also I was wondering if `repeat-headers=1` is really necessary.
user3450548
CC BY-SA 4.0
2020-03-02T14:59:25.153Z
Since `keyint=1` seems to generate the same file, are the other parameters necessary (`scenecut=0` only speeds up the processing by saving the frame comparison analysis for instance)?
Géry Ogam
CC BY-SA 4.0
2023-05-23T20:52:56.147Z
for ffmpeg 5.0 you'll need to do `-g 1` instead of `-intra`. I.e `ffmpeg -i input -c:v libx264 -g 1 output`
Eek
CC BY-SA 3.0
2015-11-22T06:30:22.337Z
2015-11-22T06:30:22.337Z
2017-03-20T10:04:28.637Z
Gyan
<p>Which params I can use to obtain a transcode all-i based? No B and P frames?</p>

<p>I know that this is not efficient for compression purposes but this is not my case now.</p>

<p>I guess i have to fiddle a bit with <strong>-x264-params</strong> or <strong>-x265-params</strong> but I don't know the switches to do it :)</p>

<ffmpeg><h.264><h.265>
ffmpeg encode in all-i mode h264 and h265 streams
user3450548
# ffmpeg encode in all-i mode h264 and h265 streams

(Asked by: username_0 on 2015-11-21)

Which params I can use to obtain a transcode all-i based? No B and P frames?

I know that this is not efficient for compression purposes but this is not my case now.

I guess i have to fiddle a bit with **-x264-params** or **-x265-params** but I don't know the switches to do it :)

**Tags:** ffmpeg, h.264, h.265


---

## 1 answers

### Answer by username_1 on 2015-11-22. Score: 11 | Accepted answer

For H264
ffmpeg -i input -c:v libx264 -intra output

For H265, seems no alias or preset has been set yet
ffmpeg -i input -c:v libx265 -x265-params frame-threads=4:keyint=1:ref=1:no-open-gop=1:weightp=0:weightb=0:cutree=0:rc-lookahead=0:bframes=0:scenecut=0:b-adapt=0:repeat-headers=1 output

H265 code stolenborrowed from here.

> **Comments:**
> **username_0**: The commands for h265 can be used for h264 as well including some tuning ? Also, can I use `frame-threads=1` instead of 4 ? Thanks :)  
> **username_1**: Should be no problem, on both counts.  
> **username_0**: Thank you :) Also I was wondering if `repeat-headers=1` is really necessary.  
> **username_2**: Since `keyint=1` seems to generate the same file, are the other parameters necessary (`scenecut=0` only speeds up the processing by saving the frame comparison analysis for instance)?  
> **username_3**: for ffmpeg 5.0 you'll need to do `-g 1` instead of `-intra`. I.e `ffmpeg -i input -c:v libx264 -g 1 output`  

---

