Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update presets for NVENC encoder #7375

Merged
merged 1 commit into from Mar 1, 2022
Merged

Update presets for NVENC encoder #7375

merged 1 commit into from Mar 1, 2022

Conversation

nyanmisaka
Copy link
Member

Changes

  • Use p1 to p7 presets on NVENC encoder for more fine tuning options.

Issues
https://www.reddit.com/r/jellyfin/comments/t2oxl6/h264_nvenc_encoding/

@github-actions
Copy link

Changes in OpenAPI specification found. Expand to see details.

What's New


POST /Plugins/SecurityInfo

Updates plugin security info.

@TheTyrius
Copy link
Contributor

Hi excuse me asking this here, but reading about the p1-p7 presets I was wondering what "tuning info" (https://docs.nvidia.com/video-technologies/video-codec-sdk/nvenc-video-encoder-api-prog-guide/#encoder-tuning-info-and-preset-configurations) jellyfin was using for NVENC. According to the docs this should probably be "high quality" for transcoding. I was unable to locate such in the source, is it set somewhere (and I missed it?) or does it fallback to some default (I didn't find such in the docs, but I would guess hq is the default anyway, as low latency/lossless are more specialized by their nature). Since you had a look at the profiles, do you have any insights regarding the tuning?

@crobibero crobibero merged commit aec1ee5 into master Mar 1, 2022
@crobibero crobibero deleted the presets-nvenc branch March 1, 2022 03:15
@nyanmisaka
Copy link
Member Author

Hi excuse me asking this here, but reading about the p1-p7 presets I was wondering what "tuning info" (https://docs.nvidia.com/video-technologies/video-codec-sdk/nvenc-video-encoder-api-prog-guide/#encoder-tuning-info-and-preset-configurations) jellyfin was using for NVENC. According to the docs this should probably be "high quality" for transcoding. I was unable to locate such in the source, is it set somewhere (and I missed it?) or does it fallback to some default (I didn't find such in the docs, but I would guess hq is the default anyway, as low latency/lossless are more specialized by their nature). Since you had a look at the profiles, do you have any insights regarding the tuning?

  -preset            <int>        E..V....... Set the encoding preset (from 0 to 18) (default p4)
     default         0            E..V.......
     slow            1            E..V....... hq 2 passes
     medium          2            E..V....... hq 1 pass
     fast            3            E..V....... hp 1 pass
     hp              4            E..V.......
     hq              5            E..V.......
     bd              6            E..V.......
     ll              7            E..V....... low latency
     llhq            8            E..V....... low latency hq
     llhp            9            E..V....... low latency hp
     lossless        10           E..V.......
     losslesshp      11           E..V.......
     p1              12           E..V....... fastest (lowest quality)
     p2              13           E..V....... faster (lower quality)
     p3              14           E..V....... fast (low quality)
     p4              15           E..V....... medium (default)
     p5              16           E..V....... slow (good quality)
     p6              17           E..V....... slower (better quality)
     p7              18           E..V....... slowest (best quality)
  -tune              <int>        E..V....... Set the encoding tuning info (from 1 to 4) (default hq)
     hq              1            E..V....... High quality
     ll              2            E..V....... Low latency
     ull             3            E..V....... Ultra low latency
     lossless        4            E..V....... Lossless

https://github.com/FFmpeg/nv-codec-headers/blob/84483da70d903239d4536763fde8c7e6c4e80784/include/ffnvcodec/nvEncodeAPI.h#L203-L270

https://github.com/FFmpeg/FFmpeg/blob/316e0ff752c782439843cc63d0eb8b9c998e47de/libavcodec/nvenc.c#L164-L202

ffmpeg has default "hq" as tuning info and we leave it as is since it's sufficient for our use case.

@TheTyrius
Copy link
Contributor

I see, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants