5

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 :)

1 Answer 1

11

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.

5
  • 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 :) Commented Nov 22, 2015 at 10:01
  • Should be no problem, on both counts.
    – Gyan
    Commented Nov 22, 2015 at 10:08
  • Thank you :) Also I was wondering if repeat-headers=1 is really necessary. Commented Nov 22, 2015 at 11:01
  • 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
    Commented Mar 2, 2020 at 14:59
  • 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
    Commented May 23, 2023 at 20:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.