Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-22T10:01:45.200Z
Answers.Text: 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 :)
Answers.UserDisplayName: user3450548
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-22T10:08:47.583Z
Answers.Text: Should be no problem, on both counts.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-22T11:01:34.357Z
Answers.Text: Thank you :) Also I was wondering if `repeat-headers=1` is really necessary.
Answers.UserDisplayName: user3450548
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-02T14:59:25.153Z
Answers.Text: 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)?
Answers.UserDisplayName: Géry Ogam
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-23T20:52:56.147Z
Answers.Text: 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`
Answers.UserDisplayName: Eek
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-22T06:30:22.337Z
Answers.LastActivityDate: 2015-11-22T06:30:22.337Z
Answers.LastEditDate: 2017-03-20T10:04:28.637Z
Answers.UserDisplayName: Gyan
Body: <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>
  
Tags: <ffmpeg><h.264><h.265>
Title: ffmpeg encode in all-i mode h264 and h265 streams
UserDisplayName: user3450548
ThreadText: # 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 ~~stolen~~borrowed from [here](https://superuser.com/q/935930/114058).
  
  > **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`  
  
  ---
  
  