Selur's Little Message Board
bad FPS with SelectEvery() - Printable Version

+- Selur's Little Message Board (https://forum.selur.net)
+-- Forum: Hybrid - Support (https://forum.selur.net/forum-1.html)
+--- Forum: Problems & Questions (https://forum.selur.net/forum-3.html)
+--- Thread: bad FPS with SelectEvery() (/thread-2881.html)



bad FPS with SelectEvery() - annael - 16.09.2022

Hello!

When I use the SelectEvery plugin, it drops the output FPS to something that looks wrong to me. Ex: going from 29.97 to 23.976 gives a resulting 5.994 fps.

Here's the script generated by Hybrid:

# Imports
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# source: '/Users/admin/Desktop/in.mp4'
# current color space: YUV420P8, bit depth: 8, resolution: 656x480, fps: 29.97, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive
# Loading /Users/admin/Desktop/in.mp4 using LibavSMASHSource
clip = core.lsmas.LibavSMASHSource(source="/Users/admin/Desktop/in.mp4")
# Setting color matrix to 470bg.
clip = core.std.SetFrameProps(clip, _Matrix=5)
clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=5)
clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=5)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# making sure frame rate is set to 29.970
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# adjusting frame with SelectEvery
clip = core.std.SelectEvery(clip=clip, cycle=5, offsets=[0,1,2,3])
clip = core.std.AssumeFPS(clip=clip,fpsnum=2997, fpsden=500)# new fps: 5.994
# adjusting output color from: YUV420P8 to YUV422P10 for ProResModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P10, range_s="limited")
# Output
clip.set_output()

The problem seems to be with the line:
clip = core.std.AssumeFPS(clip=clip,fpsnum=2997, fpsden=500)# new fps: 5.994

If I change it to fpsnum=24000 and fpsden=1001, I get a good 23.976 fps output.

I'm on mac (latest version 2022.03.20.1).

Is this a bug or do I miss something?

Thanks!!


RE: bad FPS with SelectEvery() - Selur - 16.09.2022

iirc. that's a bug I fixed. Smile
Will send you a link to a dev version I compiled for mac a while ago which should contain the fix.

Cu Selur


RE: bad FPS with SelectEvery() - Selur - 17.09.2022

Ahh,... I just saw the problem when I tried to reproduce the issue. Smile
I enter:
0 1 2 3
as offsets and get:
# making sure frame rate is set to 29.970
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# adjusting frame with SelectEvery
clip = core.std.SelectEvery(clip=clip, cycle=5, offsets=[0, 1, 2, 3])
clip = core.std.AssumeFPS(clip=clip,fpsnum=24000, fpsden=1001)# new fps: 23.976
but, you entered
0,1,2,3
which is interpreted as one number.
Quote:Offsets:
Offsets used by SelectEvery, allowed values are between 0 and 'cycle -1'.
The offsets should be separated by spaces.
source: the tool-tip. Smile

Cu Selur