Last active
October 12, 2024 01:34
-
-
Save shssoichiro/a46ff01db70243c1719479f6518ea34d to your computer and use it in GitHub Desktop.
Revisions
-
shssoichiro revised this gist
Sep 18, 2022 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,6 +11,8 @@ - 16: Very good quality - 12: Visually lossless unless you pause and zoom in 4x Recommended to subtract 2 from the cq level if encoding HDR content #### Conditional settings - Add `--tune-content=screen` if encoding a recording of your PC screen (this includes both presentations and games) - Change `--enable-keyframe-filtering` to `2` if you're not worried about the fact that it has the potential to break playback or seeking on certain players. -
shssoichiro revised this gist
Sep 18, 2022 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ ### Current aomenc recommended settings for sharpness and detail retention: ``` --cpu-used=4 --cq-level=16 --end-usage=q --lag-in-frames=48 --enable-fwd-kf=1 --aq-mode=1 --deltaq-mode=0 --enable-chroma-deltaq=1 --quant-b-adapt=1 --enable-qm=1 --min-q=1 --enable-keyframe-filtering=0 --arnr-strength=1 --arnr-maxframes=4 --sharpness=3 --enable-dnl-denoising=0 --disable-trellis-quant=0 --threads=64 ``` #### General CQ guidelines: @@ -19,8 +19,8 @@ #### If using Blue's aom-psy fork: - Add `--tune-content=psy` for live action or `--tune-content=animation` for anime - Personally I find that treating 3D CGI (e.g. Pixar) as "live action" is the better option, it does not have the same patterns as anime or cartoons, has much more motion and detail. - Add `--tune=butteraugli` - The latest version of aom-psy supports butteraugli for 10-bit content. If you cannot use butteraugli for some reason, `ipq` is a fallback option. - Change `--deltaq-mode` to `5` if encoding HDR content - Increase `--lag-in-frames` to `64`, `96`, or `120` (higher = more RAM usage, `120` might cause problems for av1an users with a lot of workers. `120` is the max in the forked aomenc.) - Multiples of 32 are good because they provide optimal memory efficiency. A group of frames is 32 frames, so aomenc wants to load in a whole group at a time. Going from e.g. 64 to 65 will increase memory usage by considerably more than e.g. 63 to 64. @@ -39,7 +39,7 @@ Based on the source material: ### FAQs - Why `--cpu-used=4`? - My opinion is that `4` is the best balance of speed and quality. If you need to go faster, you can use `6` but understand compression will take about a 15% hit (it's still much better than x264). If you don't mind encodes taking longer, you can go to `3` which does help a bit with detail preservation. Probably not useful unless you have a high quality source. The gains from going to speeds 2 and below are not generally worth the extra time cost. - Why disable keyframe filtering? - The reason for not using `--enable-keyframe-filtering=1` (which is the default) is that it has a long-standing bug which can cause [very bad quality drops](https://bugs.chromium.org/p/aomedia/issues/detail?id=3211) in certain high motion scenes. - Note that this has been fixed on the aom-psy fork. -
shssoichiro revised this gist
Mar 2, 2022 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,6 +26,16 @@ - Multiples of 32 are good because they provide optimal memory efficiency. A group of frames is 32 frames, so aomenc wants to load in a whole group at a time. Going from e.g. 64 to 65 will increase memory usage by considerably more than e.g. 63 to 64. - `--enable-keyframe-filtering=1` may be used, as it has been fixed in the aom-psy fork. (If you're already using `--enable-keyframe-filtering=2`, then that is still a bit more efficient than `1`.) ### Grain synth advice It's advised to use grain synth to reduce banding even on content with no grain. Based on the source material: - zero grain (cgi, digital cartoons, etc) => grain synth 4-8 - slight grain (digital movies) => grain synth 8-14 - medium grain (film movies) => grain synth 14-26 - heavy grain (old film movies) => grain synth >26 ### FAQs - Why `--cpu-used=4`? -
shssoichiro revised this gist
Feb 28, 2022 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,8 @@ ``` #### General CQ guidelines: - 40: Youtube quality - 30: Watchable, fine for streaming or lower bitrate encodes - 20: Good quality - 16: Very good quality - 12: Visually lossless unless you pause and zoom in 4x -
shssoichiro revised this gist
Feb 28, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ #### Conditional settings - Add `--tune-content=screen` if encoding a recording of your PC screen (this includes both presentations and games) - Change `--enable-keyframe-filtering` to `2` if you're not worried about the fact that it has the potential to break playback or seeking on certain players. - If using av1an, you probably want to set ` --disable-kf` to disable scenecut detection (since av1an does scenecut for us), unless you have a special use case where you know you want aomenc's extra splits. #### If using Blue's aom-psy fork: - Add `--tune-content=psy` for live action or `--tune-content=animation` for anime -
shssoichiro revised this gist
Feb 28, 2022 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,13 +23,15 @@ - Change `--deltaq-mode` to `5` if encoding HDR content - Increase `--lag-in-frames` to `64`, `96`, or `120` (higher = more RAM usage, `120` might cause problems for av1an users with a lot of workers. `120` is the max in the forked aomenc.) - Multiples of 32 are good because they provide optimal memory efficiency. A group of frames is 32 frames, so aomenc wants to load in a whole group at a time. Going from e.g. 64 to 65 will increase memory usage by considerably more than e.g. 63 to 64. - `--enable-keyframe-filtering=1` may be used, as it has been fixed in the aom-psy fork. (If you're already using `--enable-keyframe-filtering=2`, then that is still a bit more efficient than `1`.) ### FAQs - Why `--cpu-used=4`? - My opinion is that `4` is the best balance of speed and quality. If you need to go faster, you can use `6` but understand compression will take about a 15% hit (it's still much better than x264). If you don't mind encodes taking forever, you can go to `3` or `2` for a little extra compressibility. I wouldn't use `0`. Not even once. - Why disable keyframe filtering? - The reason for not using `--enable-keyframe-filtering=1` (which is the default) is that it has a long-standing bug which can cause [very bad quality drops](https://bugs.chromium.org/p/aomedia/issues/detail?id=3211) in certain high motion scenes. - Note that this has been fixed on the aom-psy fork. - What do each of the settings do? - `lag-in-frames` is equivalent to lookahead in x264/x265, it helps make decisions for temporal bitrate allocation e.g. giving more bits to parts of the video that are visible for longer. - `enable-fwd-kf` is the equivalent of Open GOP -
shssoichiro revised this gist
Feb 16, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,4 +41,4 @@ - `sharpness` is a pseudo-Psy-RD setting that allocates more bits to sharp areas of the video to prevent them from blurring. Either 2 or 3 seem to be the sweet spots. Higher than that begins to reduce quality of flat areas of the video by too much. - `--enable-dnl-denoising=0` disables denoising when using grain synthesis. It does nothing if you're not using grain synthesis, but I put it here for those who do use it. - `--disable-trellis-quant=0` does exactly what it sounds like and enables trellis-based quantization. This can help with detail retention. - `--threads=64` lets aomenc use *up to* 64 threads. The default is 1 thread, so you always want to set this, even if using av1an or even if not using tiles. There are still e.g. lookahead threads that you do not want to be bottlenecked waiting on the one encoder thread, and I've found that this does produce a speedup. Unfortunately aomenc only has one `threads` setting, there is no option currently to control lookahead threads separately. -
shssoichiro revised this gist
Feb 3, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,7 +21,7 @@ - Add `--tune=image_perceptual_quality` - If you can use `--tune=butteraugli`, it is preferred. However, it currently only works with 8-bit encoding. - Change `--deltaq-mode` to `5` if encoding HDR content - Increase `--lag-in-frames` to `64`, `96`, or `120` (higher = more RAM usage, `120` might cause problems for av1an users with a lot of workers. `120` is the max in the forked aomenc.) - Multiples of 32 are good because they provide optimal memory efficiency. A group of frames is 32 frames, so aomenc wants to load in a whole group at a time. Going from e.g. 64 to 65 will increase memory usage by considerably more than e.g. 63 to 64. ### FAQs -
shssoichiro revised this gist
Jan 30, 2022 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,6 @@ #### Conditional settings - Add `--tune-content=screen` if encoding a recording of your PC screen (this includes both presentations and games) - Change `--enable-keyframe-filtering` to `2` if you're not worried about the fact that it has the potential to break playback or seeking on certain players. - If using av1an, you probably want to set ` --disable-kf` to disable scenecut detection (since av1an does scenecut for us), unless you have a special use case where you know you want aomenc's extra splits. You might also get a small performance/compression increase by setting `--row-mt=0` if your number of workers is equal to your number of CPU threads. (If number of workers < CPU threads, `--row-mt=1` (the default) will help performance, with a slight compression cost.) -
shssoichiro revised this gist
Jan 30, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,6 +18,7 @@ #### If using Blue's aom-psy fork: - Add `--tune-content=psy` for live action or `--tune-content=animation` for anime - Personally I find that treating 3D CGI (e.g. Pixar) as "live action" is the better option, it does not have the same patterns as anime or cartoons, has much more motion and detail. - Add `--tune=image_perceptual_quality` - If you can use `--tune=butteraugli`, it is preferred. However, it currently only works with 8-bit encoding. - Change `--deltaq-mode` to `5` if encoding HDR content -
shssoichiro revised this gist
Jan 30, 2022 . No changes.There are no files selected for viewing
-
shssoichiro revised this gist
Jan 30, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ - Add `--tune-content=screen` if encoding a recording of your PC screen (this includes both presentations and games) - Increase `--arnr-maxframes` to `15` if encoding anime - Change `--enable-keyframe-filtering` to `2` if you're not worried about the fact that it has the potential to break playback or seeking on certain players. - If using av1an, you probably want to set ` --disable-kf` to disable scenecut detection (since av1an does scenecut for us), unless you have a special use case where you know you want aomenc's extra splits. You might also get a small performance/compression increase by setting `--row-mt=0` if your number of workers is equal to your number of CPU threads. (If number of workers < CPU threads, `--row-mt=1` (the default) will help performance, with a slight compression cost.) #### If using Blue's aom-psy fork: - Add `--tune-content=psy` for live action or `--tune-content=animation` for anime -
shssoichiro revised this gist
Jan 30, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ - Add `--tune-content=screen` if encoding a recording of your PC screen (this includes both presentations and games) - Increase `--arnr-maxframes` to `15` if encoding anime - Change `--enable-keyframe-filtering` to `2` if you're not worried about the fact that it has the potential to break playback or seeking on certain players. - If using av1an, you probably want to set ` --disable-kf` to disable scenecut detection (since av1an does scenecut for us), unless you have a special use case where you know you want aomenc's extra splits. You might also get a small performance/compression increase by setting `--row-mt=0` if your number of workers is equal to your number of CPU threads. #### If using Blue's aom-psy fork: - Add `--tune-content=psy` for live action or `--tune-content=animation` for anime -
shssoichiro revised this gist
Jan 30, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,5 +40,5 @@ - `arnr-strength=1` reduces the strength of Alt-Ref Frame Filtering. The default strength filters quite heavily. We lower this to 1 to retain more detail in the encode. (Some members will advocate for disabling it completely. My personal opinion is that there are still issues with rate distribution when ARNR is disabled that make me prefer to keep it enabled.) - `sharpness` is a pseudo-Psy-RD setting that allocates more bits to sharp areas of the video to prevent them from blurring. Either 2 or 3 seem to be the sweet spots. Higher than that begins to reduce quality of flat areas of the video by too much. - `--enable-dnl-denoising=0` disables denoising when using grain synthesis. It does nothing if you're not using grain synthesis, but I put it here for those who do use it. - `--disable-trellis-quant=0` does exactly what it sounds like and enables trellis-based quantization. This can help with detail retention. - `--threads=64` lets aomenc use *up to* 64 threads. The default is 1 thread, so you always want to set this, even if using av1an or even if not using tiles. There are still e.g. lookahead threads that you do not want to be bottlenecked waiting on the one encoder thread. -
shssoichiro created this gist
Jan 24, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ ### Current aomenc recommended settings for sharpness and detail retention: ``` --cpu-used=4 --cq-level=16 --end-usage=q --lag-in-frames=48 --enable-fwd-kf=1 --aq-mode=1 --deltaq-mode=1 --enable-chroma-deltaq=1 --quant-b-adapt=1 --enable-qm=1 --min-q=1 --enable-keyframe-filtering=0 --arnr-strength=1 --sharpness=2 --enable-dnl-denoising=0 --disable-trellis-quant=0 --threads=64 ``` #### General CQ guidelines: - 30: Youtube-ish quality - 20: Good quality - 16: Very good quality - 12: Visually lossless unless you pause and zoom in 4x #### Conditional settings - Add `--tune-content=screen` if encoding a recording of your PC screen (this includes both presentations and games) - Increase `--arnr-maxframes` to `15` if encoding anime - Change `--enable-keyframe-filtering` to `2` if you're not worried about the fact that it has the potential to break playback or seeking on certain players. - If using av1an, you probably want to set ` --disable-kf` to disable scenecut detection (since av1an does scenecut for us), unless you have a special use case where you know you want aomenc's extra splits. You might also get a small performance/compression increase by setting `--row-mt=0` since av1an removes the need for it. #### If using Blue's aom-psy fork: - Add `--tune-content=psy` for live action or `--tune-content=animation` for anime - Add `--tune=image_perceptual_quality` - If you can use `--tune=butteraugli`, it is preferred. However, it currently only works with 8-bit encoding. - Change `--deltaq-mode` to `5` if encoding HDR content - Increase `--lag-in-frames` to `64`, `96`, or `128` (higher = more RAM usage, `128` might cause problems for av1an users with a lot of workers) - Multiples of 32 are good because they provide optimal memory efficiency. A group of frames is 32 frames, so aomenc wants to load in a whole group at a time. Going from e.g. 64 to 65 will increase memory usage by considerably more than e.g. 63 to 64. ### FAQs - Why `--cpu-used=4`? - My opinion is that `4` is the best balance of speed and quality. If you need to go faster, you can use `6` but understand compression will take about a 15% hit (it's still much better than x264). If you don't mind encodes taking forever, you can go to `3` or `2` for a little extra compressibility. I wouldn't use `0`. Not even once. - Why disable keyframe filtering? - The reason for not using `--enable-keyframe-filtering=1` (which is the default) is that it has a long-standing bug which can cause [very bad quality drops](https://bugs.chromium.org/p/aomedia/issues/detail?id=3211) in certain high motion scenes. - What do each of the settings do? - `lag-in-frames` is equivalent to lookahead in x264/x265, it helps make decisions for temporal bitrate allocation e.g. giving more bits to parts of the video that are visible for longer. - `enable-fwd-kf` is the equivalent of Open GOP - `aq-mode=1` is variance-based spatial AQ. In the psy fork, it also has a low luma bias to help preserve detail in dark areas. - `deltaq-mode` is a form of temporal AQ. chroma-deltaq is intended to be the same for the chroma planes, but it's currently quite naive (equivalent of x264 chroma qp offset). - `enable-qm` enables quantization matrices. This gives a huge compression improvement at no speed cost. It should really be the default, but it's not for some reason. The default qm-min and qm-max are ideal, going lower than 5 for qm-min begins to produce worse video quality. - `min-q=1` prevents the encoder from going into lossless mode, which is currently Very Buggy, so we want to avoid it. - `arnr-strength=1` reduces the strength of Alt-Ref Frame Filtering. The default strength filters quite heavily. We lower this to 1 to retain more detail in the encode. (Some members will advocate for disabling it completely. My personal opinion is that there are still issues with rate distribution when ARNR is disabled that make me prefer to keep it enabled.) - `sharpness` is a pseudo-Psy-RD setting that allocates more bits to sharp areas of the video to prevent them from blurring. Either 2 or 3 seem to be the sweet spots. Higher than that begins to reduce quality of flat areas of the video by too much. - `--enable-dnl-denoising=0` disables denoising when using grain synthesis. It does nothing if you're not using grain synthesis, but I put it here for those who do use it. - `--disable-trellis-quant=0` does exactly what it sounds like and enables trellis-based quantization. - `--threads=64` lets aomenc use *up to* 64 threads. The default is 1 thread, so you always want to set this, even if using av1an or even if not using tiles. There are still e.g. lookahead threads that you do not want to be bottlenecked waiting on the one encoder thread.