1

I want to encode some videos in H264 and H265, and I would like to ask for help in order to chose the adequate options in x264/x265.

  • My first priority is video quality. Lossless would be the best quality for example
  • My second priority is fast decoding speed (ie: I would like faster decoding without sacrificing quality)
    • fast decoding for me means that the decoding machine would use less CPU resources reading the resulting video
    • Less RAM consumption would be a plus
    • Latency is not important
  • I don't care that much if the output file ends up bigger. Also, encoding speed is not important

I'm aware of the option -tune fastdecode in both x264 and x265. But apparently the quality gets a bit worse using it.

For x264:

-tune fastdecode is equivalent to --no-cabac --no-deblock --no-weightb --weightp 0 (My source is x264 --fullhelp)

Which options preserve quality ?

For x265:

-tune fastdecode is equivalent to --no-deblock --no-sao --no-weightp --no-weightb --no-b-intra (according to x265 doc)

Again, which options preserve quality ?

I tried to read some documentation on these options, but I'm afraid I'm too stupid to understand if they preserve quality or not.

To explain further what I mean by "preserving quality":

I don't understand what the cabac option does exactly. But let's say for example that it adds some extra lossless compression, resulting in a smaller video file, but the decoding machine would need to do extra work to decompress the file

In that case, the --no-cabac option would skip that extra compression, resulting in no loss of quality, with a bigger file size, and the decoding machine would not need to decompress the extra compression, saving CPU work on the decoding side

In this scenario, I would like to add the --no-cabac option, as it speeds up decoding, while preserving quality.

I hope I could get my point across

Can anyone help me pick the right options ?

Thanks in advance

  • By "fast decoding speed" do you mean low latency? or do you mean low cpu consumption on the decoding machine? By "quality" do you mean high resolution? high frame rate? lack of artifacts? What kind of material are you handling? Talking heads? Action-adventure movies with lots of explosions? Please [edit] your question to explain what you mean more completely. – O. Jones Oct 28 '21 at 18:09

1 Answers1

1

As @O.Jones illuded to "it depends" is the best answer you're going to get. As the author of Compressarr, I can tell you figuring the answer to that question, per video, takes hours.

Basically, encode the video (using best guess values), check it for SSIM against the original. Decide what percentage of similarity is acceptable. (Above 98% is supposed to be an imperceivable difference) Check your file size and repeat with new options as necessary. You can get away with using samples, so you don't have to do the whole thing, but then the final SSIM is only a guess.

Or just use Compressarr and let it automate all that for you. :D

Tod
  • 2,070
  • 21
  • 27
  • Thank you @Tod. I taught that, since `-tune fastdecode` option exists and is is an alias for 4 or 5 other "sub" options. I wanted to pick the "sub" options that are guaranteed to be "lossless". But I guess my question seems to not make sens ^ ^ (maybe encoding options can't be categorized as simply as lossy vs lossless) My understanding of how encoding works is very limited. Thank you for suggesting SSIM and Compressarr, they will be of great help. – user3301993 Nov 16 '21 at 19:26