Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.


Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Thread Tools Search this Thread Display Modes
Old 7th February 2022, 20:06   #1  |  Link
Registered User
Selur's Avatar
Join Date: Oct 2001
Location: Germany
Posts: 6,959
LWLibavVideoSource + sRestore + strange source

I'm using:
# Imports
import os
import sys
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Import scripts folder
scriptPath = 'I:/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# Loading Plugins
# Import scripts
import havsfunc
# source: 'C:\Users\Selur\Desktop\Sample_8bit.avi'
# current color space: RGB24, bit depth: 8, resolution: 320x224, fps: 59.94, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive
# Loading C:\Users\Selur\Desktop\Sample_8bit.avi using LWLibavSource
clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/Sample_8bit.avi", format="RGB24", cache=0, fpsnum=60000, fpsden=1001, prefer_hw=0)
# making sure frame rate is set to 59.940
clip = core.std.AssumeFPS(clip=clip, fpsnum=60000, fpsden=1001)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# adjusting color space from RGB24 to YUV444P8 for vssRestore
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8, matrix_s="470bg", range_s="limited")
# adjusting frame count and rate with sRestore
clip = havsfunc.srestore(source=clip, frate=7.9920, omode=6)
# adjusting output color from:  to YUV422P10 for ProResModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P10, range_s="limited")
# set output frame rate to 7.992fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=8000, fpsden=1001)
# Output
I expected the output to have ~362 frames, but I got 2748 frames. (MediaInfo reports 2741 frames)

I get the same when using Avisynth:
# loading source: C:\Users\Selur\Desktop\Sample_8bit.avi
# color sampling RGB24@8, matrix: bt601, scantyp: progressive, luminance scale: limited
LWLibavVideoSource("C:\Users\Selur\Desktop\SAMPLE~1.AVI",cache=false,format="RGB24", fpsnum=60000, fpsden=1001, prefer_hw=0)
# current resolution: 320x224
# removing ghosting
ConvertToYV24(interlaced=false, matrix="Rec601")
# filtering
# adjust color to YUY2 (color matrix: Rec601)
# adjusting bit depth current 8 to target 10
# convert to 10bit for encoder
# setting output fps to 7.992fps
#  output: color sampling YV24@10, matrix: bt601, scantyp: progressive, luminance scale: limited
return last
On other sources sRestore seems to work fine. (which is why I hoepe this is not caused by my system somehow)
source -> https://drive.google.com/file/d/1wD1...ew?usp=sharing

Funny thing is when I load the source thorugh LWLibavVideoSource without specifying "fpsnum=60000, fpsden=1001" I get 362 frames the directly from the source filter, but sRestore has no effect in both cases. Remuxing the source to mkv and then loading the mkv doesn't change a thing.
So then I thought this is an issue of LWLibavVideoSource, but since using AviSource instead of LWLibavVideoSource has the same effect, that sRestore doesn't work, I assume it's an issue with sRestore or the source in general or my system.

A. Can someone else reproduce these effects?
a. LWLibavVideoSource with "fpsnum=60000, fpsden=1001, " => 2748 frames, LWLibavVideoSource without "fpsnum=60000, fpsden=1001, " => 362 frames
b. sRestore not having an effect on this source no matter whether "fpsnum=60000, fpsden=1001, " is used or not?

B. Does someone know what is causing this (and ideally how to fix it)?

Cu Selur
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 7th February 2022, 20:39   #2  |  Link
Registered User
Join Date: Jul 2019
Location: Russia
Posts: 85
I once saw HolyWu write that can't use lsmas and fpsnum, fpsden because it's a bug and that's it
Jukus is offline   Reply With Quote
Old 7th February 2022, 21:23   #3  |  Link
Registered User
Selur's Avatar
Join Date: Oct 2001
Location: Germany
Posts: 6,959
I usually ony set fpsnum, fpsden on vfr content, but I used it here since otherwise the frame count was totally different than what MediaInfo reported.
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote

avisynth, lagarith, srestore, vapoursynth

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 08:38.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.