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

Picture jumps with h264 VBR encoding on Android TV #458

Closed
rainman74 opened this issue Jan 26, 2023 · 7 comments
Closed

Picture jumps with h264 VBR encoding on Android TV #458

rainman74 opened this issue Jan 26, 2023 · 7 comments

Comments

@rainman74
Copy link

rainman74 commented Jan 26, 2023

When using variable bitrate encoding with "--vbr xxxx" or "--qvbr xx" the picture jumps on my Sony Android TV 2022 (Android 9).

It does not jump with h264 VBR on my phone with Android 12, not on Windows, and not with hevc VBR encoded video on the same Android TV.

Could it be that my TV, even though it's from 2022, doesn't support VBR with h264, or could that be a bug in the encoder?

Here is a test video which has the problem under Android TV:
https://user-images.githubusercontent.com/16306963/214855692-dc192ff9-f739-45c0-959b-9c1a616bc1e7.mp4

And this is what it looks like when it jumps:
https://user-images.githubusercontent.com/16306963/214856477-4486b978-e3c5-490d-b4f3-2f5fec47044a.mp4

@quamt
Copy link

quamt commented Jan 26, 2023

Do you have the complete commands used for your encoding?
Which nvenc version do you use?
And which nvidia driver version?

@rainman74
Copy link
Author

rainman74 commented Jan 26, 2023

Do you have the complete commands used for your encoding? Which nvenc version do you use? And which nvidia driver version?

nvencc64.exe -i input.mkv -c h264 --profile high --level auto --preset quality --qvbr 23 --audio-copy -o output.mkv

NVEncC (x64) 7.13 (r2413)

NVIDIA Driver 528.02 @ Geforce RTX 3080 and also tested on GTX 1080

The same behavior on: Sony XR-55X94J, Sony XR-50X90J, Sony KD-55XF7596, Sony KD-49XF7596

@rainman74
Copy link
Author

rainman74 commented Jan 26, 2023

And there are no image errors with constant quality profil and constant bitrate enconding!

nvencc64.exe -i input.mkv -c h264 --profile high --level auto --preset quality --cqp 16:18:20 --audio-copy -o output.mkv

or

nvencc64.exe -i input.mkv -c h264 --profile high --level auto --preset quality --cbr 8000 --audio-copy -o output.mkv

@rainman74
Copy link
Author

rainman74 commented Jan 27, 2023

There is also no problem with the h264 VBR in FFmpeg (current nightly build) on Android TV, so I guess the "bug" is probably in NVEncC after all.

ffmpeg -i "input.mkv" -c:v h264_nvenc -profile:v high -preset p7 -tune hq -cq:v 23 -rc:v vbr -c:a copy "output.mkv"

@rigaya
Copy link
Owner

rigaya commented Jan 27, 2023

It's natural that NVEncC and ffmpeg behavior differs as the default parameters seem to be different.

Please try for adding "--bref-mode middle" or swicthing to "--preset default".

@rainman74
Copy link
Author

"--bref-mode middle"

adding "--bref-mode middle" fixes the jumping of the picture at h264 VBR on Android TV.

Thanks a lot 👍👍👍

rigaya added a commit that referenced this issue Jan 30, 2023
そうでないと、映像が破綻するケースがある。
@rigaya
Copy link
Owner

rigaya commented Jan 30, 2023

NVEnc 7.14 enables --bref-mode by default when preset slower than default is selected, and therefore will be able to avoid this issue by default.

Thank you for reporting this issue, now I will close this issue.

@rigaya rigaya closed this as completed Jan 30, 2023
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

3 participants