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

VP9 Encoding is completely broken in Handbrake 1.7 #5530

Closed
alikalhor77 opened this issue Nov 23, 2023 · 9 comments
Closed

VP9 Encoding is completely broken in Handbrake 1.7 #5530

alikalhor77 opened this issue Nov 23, 2023 · 9 comments
Milestone

Comments

@alikalhor77
Copy link

Problem Description

HandBrake 1.7 VP9 problem.zip
photo_2023-11-23_18-35-38
1- the result is an unusable footage
2- version 1.6.1 was fine
3- It also can't hit bitrate target in ver1.7
4- in addition to producing garbage footage it runs 2X slower than version 1.6.1
5-Shutter Encoder uses the same libvpx version of Handbrake 1.7 and it's normal and fine.
you can see VMAF scores and I upload the final clips so you can watch it for yourself.

Activity Log, Crash Log or any other details

I uploaded files instead.

What Operating System are you running?

Windows 11

What version of HandBrake are you running?

1.7

Where did you download HandBrake from?

No response

@alikalhor77
Copy link
Author

CQ9vnrwCjr
this is frame#100 of the footages for comparison
also I should add that both VP9 and VP9_10 bit are affected.

@galad87
Copy link
Contributor

galad87 commented Nov 23, 2023

A two-passes ABR uses the right bitrate, one-pass ABR seems to use a random value, on my computer the output file was 20000 Kbit/s 🧐. Nothing was changed in encavcodec.c, I wonder which of libvpx 234234234 options is the cause.
I remember a similar issue in my libaom PR.

@galad87
Copy link
Contributor

galad87 commented Nov 23, 2023

Please post the activity log too.

@alikalhor77
Copy link
Author

A two-passes ABR uses the right bitrate, one-pass ABR seems to use a random value, on my computer the output file was 20000 Kbit/s 🧐. Nothing was changed in encavcodec.c, I wonder which of libvpx 234234234 options is the cause. I remember a similar issue in my libaom PR.

I don't have the logs right now but maybe I produce one for tomorrow. clips that I shared are 2-pass encode and not 1-pass.

@alikalhor77
Copy link
Author

A two-passes ABR uses the right bitrate, one-pass ABR seems to use a random value, on my computer the output file was 20000 Kbit/s 🧐. Nothing was changed in encavcodec.c, I wonder which of libvpx 234234234 options is the cause. I remember a similar issue in my libaom PR.

OK, I tested more and now I will share the results.
1- this time I decided to use WebM container to see if the container has an impact on this bug. the answer: it does not.
2- I tested 1-Pass and 2-Pass this time and the results are interesting. Both of them have bugs and are not functioning correctly but they behave differently.
2-Pass encoding produces garbage and unusable footage, can't reach the targeted bitrate, and is extremely slow to run.
1-Pass encoding is the exact opposite! the quality is nearly identical to the source BUT the bitrate of the final file is EXTREMELY HIGH. you talked about random numbers in your comment. I think it's not random but that is the bitrate that the encoder can produce identical results to the source. for the source I use (Extremely complicated and short test sample) the final bitrate is 127000Kbps!(25.4 times more than what it should be). This number is different for more or less complicated sources
Screenshot 2023-11-24 180329
I will upload the logs and file info files below.
logs.zip
FileInfos.zip

@alikalhor77
Copy link
Author

I also should note that inability to reach bitrate target is not the reason why final footages of 2-Pass are garbage.
below I created 2100 Kbps (the bitrate that HB1.7 2-Pass mode reaches when you set 5000Kbps) VP9 files using Shutter Encoder. It's obvious that the problem is more complicated.
Screenshot 2023-11-24 183427

@galad87
Copy link
Contributor

galad87 commented Nov 24, 2023

Another victim of my quest to avoid memory copies 😵‍💫
Can you try the version on https://github.com/galad87/HandBrake/actions/runs/6983890698 ?

@alikalhor77
Copy link
Author

Another victim of my quest to avoid memory copies 😵‍💫 Can you try the version on https://github.com/galad87/HandBrake/actions/runs/6983890698 ?

Screenshot 2023-11-25 095016
In terms of quality it's fixed but because I installed it on Windows Sandbox I cannot comment on the speed of encoding. maybe the performance of this version needs more improvement.

@galad87 galad87 added this to the 1.7.2 milestone Nov 25, 2023
@marcosfrm
Copy link
Contributor

About speed, libvpx enabled more features on speed 0-2 recently:

webmproject/libvpx@03ddac4
webmproject/libvpx@660031c

galad87 added a commit that referenced this issue Nov 30, 2023
…dec encoders. Fix #5530, regression introduced in 395676a.

(cherry picked from commit f3d793a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants