alexheretic / ab-av1

AV1 re-encoding using ffmpeg, svt-av1 & vmaf.
MIT License
466 stars 29 forks source link

Encode a clip in chunks based on a a specific VMAF #186

Closed samtheruby1012 closed 1 month ago

samtheruby1012 commented 9 months ago

Hi I wanted to find out if it would be possible to implement a feature to auto-encode that makes it that a specified minimum VMAF can be supplied (for example 95) and that the auto encode should encode the clip adjusting the CRF per sample taken to target that specified minimum VMAF, so that in the clip the minimum the VMAF will be is 95.

alexheretic commented 9 months ago

This sounds pretty much what auto-encode already does.

Or do you mean to sample the entire file in chunks and to encode each chunk with different crfs according to the vmaf target? If so this is roughly what av1an project does. The idea of ab-av1 is to make the VMAF analysis fast, sampling only parts of the video, then encode with a single crf value.

SamTheRuby commented 9 months ago

av1an still targets 5 percentile lows while ab-av1 targets a exact vmaf, which is much more in line with what I want to do

BankaiNoJutsu commented 9 months ago

Hey, i've been experimenting a bit with this idea, inspired by av1an. https://github.com/BankaiNoJutsu/media-db

specifically the pipe_vmaf_threaded or _2 mode.

you can try it with: .\cli.exe -m pipe_vmaf_threaded -e hevc_qsv -v 95 --verbose -t 4 -o . -i '.\file.mkv'

note that it's unfinished, just an idea put into test. Messy code and i can't recall if it was actually doing it's fully intended purpose. But hopefully food for thought.

SamTheRuby commented 9 months ago

@BankaiNoJutsu Im assuming I have to build it from source?

SamTheRuby commented 9 months ago

Ill definitely run some test for you @BankaiNoJutsu

alexheretic commented 1 month ago

I think this is just a different approach overall to ab-av1, good luck with it.