rigaya / NVEnc

NVENCによる高速エンコードの性能実験
https://rigaya34589.blog.fc2.com/blog-category-17.html
Other
1.07k stars 112 forks source link

AV1 not working? #515

Closed VisionHDR closed 1 month ago

VisionHDR commented 1 year ago

Hello, i tried to encode AV1 with 4090 card.

I used:

nvencc64 -i inputfile.mkv --avsw --codec av1 --output-depth 10 --videoformat ntsc --level 5.1 --profile high --tier 1 --mv-precision q-pel --ref 5 --nonrefp --output-buf 128 --lookahead 32 --gop-len 24 --no-b-adapt --no-i-adapt --aq --colormatrix bt2020nc --colorprim bt2020 --transfer smpte2084 --chromaloc 2 --repeat-headers

The bitrate settings and output file are added later on. But it does not work. What's the issue? Thanks.

rigaya commented 1 year ago

AV1 encoding does not support "--chromaloc 2".

Please remove "--chromaloc 2" and will work fine.

VisionHDR commented 1 year ago

Thanks a lot. Does --vpp-pad works with AV1?

rigaya commented 1 year ago

Does --vpp-pad works with AV1?

Yes, --vpp-pad should work with AV1.

VisionHDR commented 1 year ago

The command still does not work with AV1 and a 4090.

I see your options documentation and you mention "tier" is only for HEVC, and then you also show "av1: 0,1". Can you explain? AV1 supports tier setting, or not? If it does, why you set [HEVC only] ?

--tier <string> [HEVC only]
Specify the tier of the codec.

hevc:  main, high
av1 :  0, 1

This command fails encoding AV1 in a 4090 (and also in an Intel ARC)

nvencc64.exe -i videofile.mkv --avsw --log-level error,core_progress=info --vpp-colorspace (custom option here) --codec av1 --output-depth 10 --videoformat ntsc --level 5.1 --profile high --tier 1 --mv-precision q-pel --ref 5 --nonrefp --output-buf 128 --lookahead 32 --gop-len 24 --no-b-adapt --no-i-adapt --aq --colorprim bt2020 --colormatrix bt2020nc --transfer smpte2084 --repeat-headers

For the metadata, this is added to the command: --master-displayG(8500,39850)B(6550,2300)R(35400,14600)WP(15635,16450)L(10000000,50)--max-cll1000,400``

For the bitrate: --vpp-resize (custom option for resize) --preset P7 --vbr (custom number) --max-bitrate (custom number) --aq-temporal

For the output: --audio-copy --chapter-copy --key-on-chapter --sub-copy -o output.mkv or --audio-codec aac --audio-bitrate 256 -o output.mp4

any of the combinations for output fails. I set "custom option" and "custom numbers" since i have different values there but does not matter which ones i use, the encoding fails.

rigaya commented 1 year ago

--tier might not work for AV1, just keep it default.

You also don't need --profile high, default main profile is enough for YUV420 10bit (high is for YUV444).

Anyway I don't have problem with your options. I suggest to start from simple options and add extra options later.

ArturAlekseev commented 5 months ago

Just a question about rate VBR quality. I'v read that AV1 should compress aroud 30% better than H265. But with "same" settings (VBR quality 18, Preset P7 - Quality, Adaptive Quantization Temporal, lookahead 32), AV1 result is 2x larger than H265 (4K cartoon). What can be wrong?

rigaya commented 1 month ago

VBR quality values for HEVC and AV1 encoding in not necessarily the same so increasing VBR quality value shall work fine.

I’ll close this issue as the major topic has been resolved.