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 2nd July 2020, 16:14   #1  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
LibavSMASHSource <> InterFrame -> tons of black frames

I'm having a strange problem with this source (19MB) using LibavSMASHSource and InterFrame,
using:
Code:
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'I:/Hybrid/64bit/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/FrameFilter/Interframe/svpflow2_vs64.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/FrameFilter/Interframe/svpflow1_vs64.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import havsfunc
# input color space: YUV420P8, bit depth: 8, resolution: 656x480, fps: 25
# Loading C:\Users\Selur\Desktop\Test.mp4 using LibavSMASHSource
clip = core.lsmas.LibavSMASHSource(source="C:/Users/Selur/Desktop/Test.mp4",fpsnum=25)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# adjusting frame count with Interframe/SVP
clip = havsfunc.InterFrame(clip, NewNum=60, NewDen=1, OverrideAlgo=13) # new fps: 60
# Output
clip.set_output()
Vapoursynth returns 5944933 black frames.
Without Interframe:
Code:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# input color space: YUV420P8, bit depth: 8, resolution: 656x480, fps: 25
# Loading C:\Users\Selur\Desktop\Test.mp4 using LibavSMASHSource
clip = core.lsmas.LibavSMASHSource(source="C:/Users/Selur/Desktop/Test.mp4")
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# Output
clip.set_output()
the decoding works fine and I get the normal 4838 frames.
Using FFMS2 instead of LibavSMASHSource with Interframe:
Code:
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'I:/Hybrid/64bit/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/FrameFilter/Interframe/svpflow2_vs64.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/FrameFilter/Interframe/svpflow1_vs64.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/FFMS2/ffms2.dll")
# Import scripts
import havsfunc
# input color space: YUV420P8, bit depth: 8, resolution: 656x480, fps: 25
# Loading source using FFMS2
clip = core.ffms2.Source(source="C:/Users/Selur/Desktop/Test.mp4",cachefile="E:/Temp/mp4_85cc5ab7e7a053ca0629800dc986bd68_853323747.ffindex",fpsnum=25,format=vs.YUV420P8,alpha=False)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# adjusting frame count with Interframe/SVP
clip = havsfunc.InterFrame(clip, NewNum=60, NewDen=1, OverrideAlgo=13) # new fps: 60
# Output
clip.set_output()
the output is as expected 11609 frames.

Seems like it's a problem with the LibavSMASHSource <> InterFrame combination.
I tried whether using a seek_threshold like 60 doesn't help either.


=>
a. Can someone reproduce the issue (to be sure it's not just my setup) ?
b. Does someone know a workaround for the LibavSMASHSource <> InterFrame combination to work?
c. Does someone know what's causing the problem?

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 2nd July 2020, 18:46   #2  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Thanks for the info!
I used fpsnum, since the source as identified by MediaInfo as:
Code:
Frame rate mode                          : Constant
FrameRate_Mode_Original                  : VFR
which usually means that the stream indicates vfr, but the container indicates cfr, so to be sure that the output of LibavSMASHSource is cfr I use 'fpsnum=25'.

Hope this can be fixed in one of the upcoming LibavSMASHSource releases.

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Reply

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 23:36.


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