master-of-zen / Av1an

Cross-platform command-line AV1 / VP9 / HEVC / H264 encoding framework with per scene quality encoding
GNU General Public License v3.0
1.51k stars 155 forks source link

Specify path to photon noise model to avoid recalculating it. #567

Closed lastrosade closed 2 years ago

lastrosade commented 2 years ago

Currently photon noise generation is generated when the encode start and is kept in the temp dir.

An argument like --photon-noise-model-path somemodel.tbl would allow us to reuse the model when encoding the same video.

shssoichiro commented 2 years ago

I'm not sure how much benefit this provides. Generating the photon noise table is a very quick and deterministic process. Less than 1 second.

Is the concern that the files are cluttering the temp directory? Maybe we can find a way to clean them out even if the encode is interrupted. They should be taking up minimal space though, as these files are also about half a KB each.

lastrosade commented 2 years ago

I just ran some tests and it takes up to a minute to generate the model on a 1800 frame sample video of mine.

shssoichiro commented 2 years ago

That seems unusual. I'll do some testing and see what's going on with that/if I can reproduce it.

The grain table generation should have nothing to do with the length of the video. It doesn't need to open the video file at all, except to know the width and height.

For reference, here is the code that generates the grain tables: https://github.com/master-of-zen/Av1an/blob/master/av1an-core/src/grain.rs

lastrosade commented 2 years ago

I can't reproduce the issue anymore when rerunning the same tests.