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

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

I'm using:
Code:
# 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
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# 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
clip.set_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:
Code:
ClearAutoloadDirs()
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
LoadPlugin("I:\Hybrid\64bit\Avisynth\AVISYN~1\LSMASHSource.dll")
LoadPlugin("I:\Hybrid\64bit\Avisynth\AVISYN~1\RgTools.dll")
LoadPlugin("I:\Hybrid\64bit\Avisynth\AVISYN~1\mvtools2.dll")
LoadPlugin("I:\Hybrid\64bit\Avisynth\AVISYN~1\masktools2.dll")
LoadPlugin("I:\Hybrid\64bit\Avisynth\AVISYN~1\TIVTC.dll")
LoadPlugin("I:\Hybrid\64bit\Avisynth\AVISYN~1\Average.dll")
LoadPlugin("I:\Hybrid\64bit\Avisynth\AVISYN~1\grunt-x64.dll")
LoadPlugin("I:\Hybrid\64bit\Avisynth\AVISYN~1\MedianBlur2.dll")
Import("I:\Hybrid\64bit\Avisynth\avisynthPlugins\Zs_RF_Shared.avsi")
Import("I:\Hybrid\64bit\Avisynth\avisynthPlugins\Srestore.avsi")
# 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")
srestore(frate=7.992,omode=6)
# filtering
# adjust color to YUY2 (color matrix: Rec601)
ConvertToYUV422()
# adjusting bit depth current 8 to target 10
# convert to 10bit for encoder
ConvertBits(10)
# setting output fps to 7.992fps
AssumeFPS(8000,1001)
#  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
Jukus
Registered User
 
Join Date: Jul 2019
Location: Russia
Posts: 87
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
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
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
Reply

Tags
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 20:19.


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