Av1an icon indicating copy to clipboard operation
Av1an copied to clipboard

[Feature Request] Independant encoding and scene-detection/target-quality vapoursynth inputs

Open BlueSwordM opened this issue 2 years ago • 3 comments

So, I've had this idea for a while, but I never decided to act up on it until today

The feature request in question would be for av1an to be able to do filtering without making scene-detection/target-quality abominably slow.

Basically, make it so that you can input 2 sources into av1an: av1an -i source.vpy --i-sd source-sd.vpy

The 1st input parameter would be = normal video input/vapoursynth script in the form of a normal parameter -i. 2nd input parameter = scene-detection/target-quality vpy input in the form of a special parameter --i-sd.

--i-sd can only be active if a normal -i with a vpy input is set to prevent unintended behavior.

If --i-sd is active, it uses the vpy script included to do scene-detection and target-quality operations by itself, and the normal -i VPY script is that would be used for normal encoding by the workers.

The usefulness of this parameter would be to make scene detection and target-quality operations much faster than what is possible with the normal input method.

BlueSwordM avatar Feb 23 '22 20:02 BlueSwordM

This is very easy to implement, see the input-sc branch for an initial implementation without error handling

redzic avatar Feb 24 '22 00:02 redzic

The only consideration that I have about this is that since counting frames can take a long time, fast error handling of the situation that the scene detection input and the regular input have different frame counts is more difficult. One strategy to alleviate the computational complexity somewhat is that once we know the frame count of one of the inputs, we can early exit when counting the frames of the other if it exceeds the known frame count of the other.

redzic avatar Feb 24 '22 00:02 redzic

Say, it'd be nice to have this merged into mainline.

I've used it for months, and I can confirm it's quite robust :D

BlueSwordM avatar May 09 '22 01:05 BlueSwordM