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

NVENC encoder video quality issue #3896

Open
JerryZhang19 opened this issue Mar 26, 2025 · 0 comments
Open

NVENC encoder video quality issue #3896

JerryZhang19 opened this issue Mar 26, 2025 · 0 comments

Comments

@JerryZhang19
Copy link

🐛 Describe the bug

Using hardware accelerated video encoding(NVENC) will result in low quality, blocky video. Setting ffmpeg encoder option to 'slow' or 'lossless' does not help

Here is a configuration that is expected to produce a high quality video:

self.writer.add_video_stream(frame_rate= 60.0, height=1080, width=3648, format='yuv444p' , encoder="h264_nvenc", encoder_option= {"preset":"slow", "profile":"high444p"}, encoder_format='yuv444p' , hw_accel="cuda")

However, the generated video is very low quality and its size is very small


In the tutorial,
https://pytorch.org/audio/main/tutorials/nvenc_tutorial.html

It was menteioned that higher resolution videos will have artifacts and tuning encoder_options may help. What would be the correct way to tune the encoder_option if "preset"="lossless" won't help

Versions

4090d, driver 12.2
pytorch 2.6.0, CUDA 12.4.127
ffmpeg 6.1.2 compiled with nv-codec-headers 11.1.5.3

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

No branches or pull requests

1 participant