Av1an icon indicating copy to clipboard operation
Av1an copied to clipboard

Size issue?

Open jriker1 opened this issue 1 year ago • 5 comments

Running AV1AN right now against rav1e. I have not set any tune values or quantizer values for rav1e itself unlike what I see in the few examples out there, as not sure I see the value if AV1AN is supposed to figure all that out. No threads or tiles either being passed to rav1e. So basically I did:

av1an.exe --verbose -i <INPUT> -e rav1e --target-quality 95 --vmaf-path vmaf_4k_v0.6.1.json -v "--speed 1 --primaries BT2020 --transfer SMPTE2084 --matrix BT2020NCL --mastering-display=G(8500,39850)B(6550,2300)R(35400,14600)WP(15635,16450)L(10000000,50) --content-light=832,166 --min-keyint 12 --keyint 240" --chunk-method lsmash --concat mkvmerge --pix-format yuv420p10le -o <OUTPUT>

Here's the odd part and maybe not all of it odd with my Ryzen 7950x with 64GB RAM:

  1. CPU running about 40% usage.
  2. Memory usage is maxed the whole time.
  3. It's going on 3+ days of encoding right now.
  4. Output is showing at this point: 88% 150736/170507 (1.43 s/fr, eta 8h, 2204.1 Kbps, est. 19.87 GiB)

OK so this is a 4K HDR10 1 hour 45 minute BlueRay for reference. What is the odd part is I assume it's dynamic figuring out quality based on the target-quality setting however as you see it shows current estimate at 88% done is 19.87GiB.

Why is this odd? If I look in the temp .422847b\encode folder, I am calculating 1.61GB of ivf files. So no way I am going to end up at 19.87GiB. Know GiB and GB are different measures but not that different. Still has a way to go but am I missing something?

Some logs in case it helps.

log.log json filess.zip

Should also note that the size is creeping up a small bit which I would in theory find funny if there is only 1.61GB of files in the first place. Like how can it think the size is going to go from 19.87GiB to 19.97GiB if there is only the before mentioned data being saved in the first place.

jriker1 avatar Mar 20 '23 17:03 jriker1

If quantizer value not supplied in command line - av1an adds it and changes to what target quality predicts will give desired result. In general, i would suggest to be explicit about that and write down quantizers, encoder presets.

Av1an does not calculate tiles if custom command is passed to encoder.

I noticed that you don't use tiles with rav1e, which utilizes tile based parallelism, which means that 1 instance only run by 1 thread, adding --tiles 16 will both speed up final encoding.

Regarding target quality, by default comparison is done at 1080p --vmaf-res == 1920x1080. Which in this instance means that both probes and source down-scaled to 1080p before they pass to VMAF calculation. For 4k i would suggest using --vmaf-res 3840x2160.

Try out default VMAF model, and not 4k specific one, in my opinion, it have lower tolerance for decreasing in quality at 4k resolution, and I was able to achieve what I wanted with it.

For target quality encoding, i would suggest getting a minute clip out of middle of content that you're encoding, and giving it a couple runs with target quality 80.90,92,95 with corrections that i suggest. To get sense of progression of size and quality that you will get on the output.

Regardless IVF sizes, i don't know what exactly is going on, it's probably a bug :(

master-of-zen avatar Mar 20 '23 19:03 master-of-zen

Thanks for the info. I was avoiding tiles and just mentioning I wasn't using any as read they can degrate the output quality.

Thanks for the i nput on vmaf and settings will adjust.

Do you have any general thoughts on what a 1 hour 45 minute 4k HDR10 clean video would reduce to? I see things all over the place and no one ever really talks about file sizes they are getting. Like:

AOM: Hit like 50 gigs and wasn't done and aborted. SVT: Usually always returns a 1.2GB file but dev doesn't say if that's right other than there is a bug with block pixelation in the encoder.

Now trying Rav1E but thru av1an since it's been suggested by a number of individuals.

Note my monitors are 15 years old so can't really do comparisons on my PC screen to see quality. Have to do best I can with preferred settings from others and then eventually look at it on the TV but can't really directly compare different bitrates. Just sizes seem odd for me to date with AV1.

Oh by the way, what is the default model? vmaf_v0.6.1.json?

jriker1 avatar Mar 20 '23 20:03 jriker1

Some more info as it finished encoding. This is in addition to the above and above questions. Does av1an show the estimated size during encoding of the av1 file or the final "mkv" container? It was at 19.95 GiB for estimated size when it finished. I set the output name to .ivf and that's what it called it but it was really an MKV file then with an IVF extension so that may need some code to catch.

That 19.95GiB was basically what the final mkv file. Anyway, shows basically 20GB and know the audio extract which I wonder if there is a way to skip that, was like 18.8GB. Final video segment is 1.9GB. So thinking what's being displayed in est. is the final MKV and not the IVF it's generating?

jriker1 avatar Mar 21 '23 13:03 jriker1

By default we prefer .mkv as output as it insures that whatever been in your input file could be transmitted to the output. As for current output file, you can delete audio track from it with MKVtoolnixGUI

master-of-zen avatar Mar 27 '23 13:03 master-of-zen

Some experienced numbers to compare (note that VMAF95 with ab-av1 means average over the entire runtime) :

120 minutes, clean and grainless, 2160p, black bars cropped (and no other filters used), preset 3, ab-av1@VMAF95 (libsvtav1 1.6.0) -> ~3-7GB without audio the same with 1080p -> ~1-2,5GB without audio

With 1.7.0 it's better.

mr44er avatar Oct 11 '23 22:10 mr44er