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

Feature Request: Add a way to keep quality between multiple files similar #280

Open
GrimJu opened this issue Feb 7, 2025 · 5 comments
Open

Comments

@GrimJu
Copy link

GrimJu commented Feb 7, 2025

Problem: I use FileFlows to process all my media and as part of that process i use ab-av1 to calculate vmaf and encoding settings. This works wonderfully and keeps my media consistent. One problem this approach has is that different episodes of the same show produce very different results due to minimal variations between episodes ( I aim for a very high VMAF ~ 96 so even small adjustments can lead to filesize differences in the +50-100% range).

Ideal scenario: I would like there to be some easy-to-use mechanism that ensures consistency between episodes (or in general similar files).

Proposed solution: The solution I came up with is adding a "context-directory" parameter to ab-av1. This parameter would specify a directory of files that would serve as context to the current operation. ab-av1 would then look up all the files in the context directory and check the cache-db if one or more of the files in it have already been run through ab-av1. If it finds a match it would start the sampling process with the "saved" settings that already worked for its "sibling", and if the VMAF outcome is within some +-percentage of the "sibling" just reuse those settings.

I hope this proposal is feasable and something you see as useful for ab-av1. Feel free to contact me for any questions you might have.
Thank you for this awesome project.

@alexheretic
Copy link
Owner

To get consistent results across files if just use the same crf when encoding all files. Perhaps run crf-search on some of the files first to get an idea for that single crf.

So I don't think I'd be motivated to write anything special for this purpose, however this should be scriptable using ab-av1 particularly if we add json stdout-format for crf-search (#241). E.g. you could write a script to crf-search on some/all files then use a single crf value to encode all.

@GrimJu
Copy link
Author

GrimJu commented Feb 8, 2025

It's difficult the with the way FileFlows works as it processes each file individually and I'd have to come up with my own scheme for state-management. Thus I was hoping ab-av1 could take that of me as it already has all the necessary state I would need.

But I understand of course that you don't feel like this is something that should be ab-av1's responsibility. So feel free to close this. Thank you anyway for responding.

@raysv
Copy link

raysv commented Feb 20, 2025

You say you use ab-av1 and crf-search to find suitable crf for each file, and then use the parameter for fileflows and it still get inconsistent results? Or do you check one file, and do the rest of the show with that crf?

I've done the same, batch crf-search my folders, and then process them in fileflows with the "correct" crf.

@GrimJu
Copy link
Author

GrimJu commented Feb 21, 2025

First version. I used to run ab-av1 for each file individually and thus get different results sometimes but I already improvement my flows by now and only run ab-av1 on the first file and apply that crf to all other files in that folder.

@mr44er
Copy link

mr44er commented Feb 25, 2025

Another idea, but i needs some manual work.
You could mux all episodes from a season together in the right order with mkvtools. In the output-tab you choose 'create one chapter per file'.
Then encode the big file (with mean VMAF) and afterwards you split it again at the chapters. (again mkvtools)

Of course this only works without mess if the episodes don't have chapters already and remember: mkvtools split @ keyframes, not at timeframes and these will differ 99% vs the source after encoding.

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

4 participants