-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Fix VP8 low bitrate #122
Fix VP8 low bitrate #122
Conversation
Thank you for this contribution!
|
Also I find it odd to not only fix the problematic flags but to change the target bitrate without mentioning it 🤓 |
The original bitrate isn't real because the numbers were impossible. It was actually < 200 kbps padded up to 300kbps. That goes into a compressed ZIM and the padding shrinks. My new value of 200 kbps might actually be higher. openzim/kolibri#75 (comment) It needs some testing. I meant for this to be a draft PR but clicked it wrong. |
Why.Letters.mp4 |
This looks very good @kevinmcmurtrie ; thank you. |
I don't have an eye for this kind of things but to me it looks like no loss in quality for a big gain in size. I love it. I can not wait to have our main video based scrapers released with this new configuration. @kevinmcmurtrie Thank you very much. |
@kevinmcmurtrie let me check this QA issue, never mind |
@rgaudin any idea why codecov upload is failing in |
First, thank you! Aside the CI issue we will solve, do you need to change more things or should we consider this PR ready? And I would like to keep a copy of your test videos so that we reuse them next time we need to make a change in presets / encoders. These are precious assets to avoid lengthy discussions. "Why letters" is a khan academy video, so the license is the Khan one, correct? Do you know where the two others come from? Do you know what is the license associated with the "Earth quake and social media" video? (the last video has an explicit CC license, but I would prefer to know where it comes from so that we do not discover too late that the video is copyrighted but someone added a CC watermark for fun) |
3.6 and 3.6 are preventing codecov from running so that explains it. |
Ok for 3.6 and 3.7 |
"Why letters" is a khan academy video, from the given example. |
I made it a Draft because I feel like I don't have enough time at the moment to be a good contributor. My goal was just to come up with some better codec parameters. You can copy them over to a new PR or use this. |
Thank you again for this and the tests you've made on a bunch of videos. It is a very good contribution, even if you consider it is not yet completed, because it was made with quality in mind and because it created a momentum and we feel like we are close to being able to release this. Since I'm working today on Kolibri to fix other scraper issues you've reported, I will test these new codec parameters. They might not be "optimal" but we have to admit they are already way better than the ones we are using currently, so it makes sense to release them to make a move in the good direction (once I've confirmed they work with more videos). |
Check the compressed size. The old videos had a lot of bitrate padding. |
Tested with nearly motionless security camera footage and a television news recording of a press release.
Better tuning for very low motion and very high motion.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #122 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 32 32
Lines 1337 1345 +8
Branches 227 229 +2
=========================================
+ Hits 1337 1345 +8 ☔ View full report in Codecov by Sentry. |
I took the liberty to update first comment to reflect the final content of this PR. I've reencoded and uploaded all test videos to https://tmp.kiwix.org/ci/test-videos/ I've also added a utility to encode video (debug), fixed the ffmpeg threads usage. I feel like there is mostly no change in visual quality between v1 and v2, but as already said computation takes way less time and resulting file is way smaller (especially for still videos like khan academy ones). @rgaudin feedback is welcomed on:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Edits by @benoit74
Enabler for openzim/kolibri#75
Fix #123
Changes
-b:v
is reduced to 128k instead of 300k (deemed sufficient)-maxrate
and-minrate
have been removed (otherwise the quantizer has no room for adaptation)-qmin
is reduced to 18 instead of 30 (significantly reduce the bitrate on very still videos)-qmax
is decreased to 40 instead of 42reencode
allows to override this default value)Original comment
openzim/kolibri#75
The VP8 values appear to have been copied from the x264 options but these codecs do not share the same scale.
Removed contradictory options. Use ordinary average bitrate target with min/max bounds on quality.