Endilll / vapoursynth-preview

Preview for VapourSynth scripts
Apache License 2.0
69 stars 21 forks source link

vspreview/core/types.py: treat VFR clips as 1fps to avoid division by zero #20

Closed AkarinVS closed 3 years ago

AkarinVS commented 3 years ago

Without this change, any VFR clip will crash vsp.

As VS does not have any special VFR support, time duration for VFR clips are not well defined, so using non-zero fps here should be fine. For simplicity, I've chosen 1 fps to avoid division by zero.

Signed-off-by: akarin i@akarin.info

Endilll commented 3 years ago

Implicit AssumeFPS is not the way to go. Probably even with a warning in stdout. The best we can do for now is to emit a fatal error suggesting to add AssumeFPS to script, because only user knows the sensible value.

DJATOM commented 3 years ago

AssumeFPS means discarding any VFR data from the frame properties. That's even worse thing to take as workaround.

Endilll commented 3 years ago

Frame properties for VFR as they are done now are useless for VS Preview anyway. It goes without saying that AssumeFPS is not for actual encoding, but for user to see something sensible in GUI.