View Full Version : vspreview: Wrong Length in Time
jay123210599
20th September 2024, 04:42
I got a problem. When I entered a video in vspreview, it lasted for 18 minutes, but when I played it in a regular video player, it lasted for 23 minutes. How do I fix it do get the correct length of time?
Selur
20th September 2024, 14:05
1. try a different source filter
2. try (re-)muxing the video with mkvoolnix to mkv
jay123210599
21st September 2024, 04:17
1. try a different source filter
2. try (re-)muxing the video with mkvoolnix to mkv
1. I am currently using core.lsmas.LWLibavSource. What other sources should I use?
2. The video is already a mkv file.
Selur
21st September 2024, 08:42
1. I am currently using core.lsmas.LWLibavSource. What other sources should I use?
FFMS2, BestSource depending on the content and your GPU DGSource.
2. The video is already a mkv file.
Does not matter, unless you already used mkvtoolnix/mkvmerge to create the file.
Cu Selur
jay123210599
21st September 2024, 13:17
FFMS2, BestSource depending on the content and your GPU DGSource.
Does not matter, unless you already used mkvtoolnix/mkvmerge to create the file.
Cu Selur
Here's the information of my video. Which source should I use?
Format : Matroska
Format version : Version 1
File size : 160 MiB
Duration : 23 min 3 s
Overall bit rate : 973 kb/s
Frame rate : 23.976 FPS
Encoded date : 2008-10-08 17:28:25 UTC
Writing application : mkvmerge v2.2.0 ('Turn It On Again') built on Mar 4 2008 12:58:26
Writing library : libebml v0.7.7 + libmatroska v0.8.1
Video
ID : 1
Format : MPEG-4 Visual
Format profile : Advanced Simple@L5
Format settings : BVOP2
Format settings, BVOP : 2
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Codec ID : V_MS/VFW/FOURCC / XVID
Codec ID/Hint : XviD
Duration : 23 min 3 s
Bit rate : 634 kb/s
Width : 640 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 23.976 (23976/1000) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.086
Stream size : 105 MiB (65%)
Writing library : XviD 1.1.0 Beta1 (2005-01-16)
Language : Japanese
Default : Yes
Forced : No
BPS : 23.9762
Selur
21st September 2024, 14:27
Try both FFMS2 and BestSource.
jay123210599
21st September 2024, 15:55
Try both FFMS2 and BestSource.
How do I try both at the same time with Vapoursynth?
poisondeathray
21st September 2024, 16:02
How do I try both at the same time with Vapoursynth?
You try one at time . If the first one works ok, there is no need to try the other
jay123210599
21st September 2024, 18:34
You try one at time . If the first one works ok, there is no need to try the other
It said: AttributeError: There is no function named FFMS2. Same goes for Best Source.
clip = core.lsmas.FFMS2(path to video)
clip = core.lsmas.BestSource(path to video)
poisondeathray
21st September 2024, 23:59
It said: AttributeError: There is no function named FFMS2. Same goes for Best Source.
clip = core.lsmas.FFMS2(path to video)
clip = core.lsmas.BestSource(path to video)
Load the plugins(s)
Either put ffms2.dll / BestSource.dll in the plugins64 directory to autoload, or load them in the script with core.std.LoadPlugin
http://www.vapoursynth.com/doc/functions/general/loadplugin.html#std.LoadPlugin
jay123210599
22nd September 2024, 00:06
Load the plugins(s)
Either put ffms2.dll / BestSource.dll in the plugins64 directory to autoload, or load them in the script with core.std.LoadPlugin
http://www.vapoursynth.com/doc/functions/general/loadplugin.html#std.LoadPlugin
There are already in the directory, now how do I autoload them? If not, how do I load them with my video?
poisondeathray
22nd September 2024, 00:51
It should be
core.ffms2.Source
not "core.lsmas.FFMS2" ; lsmas is the namespace for L-Smash
Are_
22nd September 2024, 00:51
It said: AttributeError: There is no function named FFMS2. Same goes for Best Source.
clip = core.lsmas.FFMS2(path to video)
clip = core.lsmas.BestSource(path to video)
Those lines are wrong, you are either trying to use one of these.
core.ffms2.Source()
core.bs.VideoSource()
core.lsmas.LibavSMASHSource()
jay123210599
22nd September 2024, 01:40
@Are_ @poisondeathray @Selur Neither sources worked. I still haven't reach the full 23 minutes with the video. I also keep getting this:
"WARNING: Video Node 1: Had to assume these props which were unspecified or non-valid for preview <"_Matrix, _Primaries, _Transfer>"
_Al_
22nd September 2024, 02:05
That is vspreview warning most likely because like any other previewer, it has to change vs.VideoNode (your clip) into rgb. So if those values are not in props (they were not read from a source plugin) it has to guess and default. To default, understand, means it might be wrong. Like in your case, where resolution is 640x480, it might guess matrix as BT601. To get rid of this warning set manually in your scirpts those props:
clip = clip.std.SetFrameProps(_Matrix=6, _Primaries=6, _Transfer=6)
or if your video is BT709 then:
clip = clip.std.SetFrameProps(_Matrix=1, _Primaries=1, _Transfer=1)
Also a previewer might have a choice to set a delay between frames or hard code fps for preview, look for it if it is there.
jay123210599
22nd September 2024, 13:27
That is vspreview warning most likely because like any other previewer, it has to change vs.VideoNode (your clip) into rgb. So if those values are not in props (they were not read from a source plugin) it has to guess and default. To default, understand, means it might be wrong. Like in your case, where resolution is 640x480, it might guess matrix as BT601. To get rid of this warning set manually in your scirpts those props:
clip = clip.std.SetFrameProps(_Matrix=6, _Primaries=6, _Transfer=6)
or if your video is BT709 then:
clip = clip.std.SetFrameProps(_Matrix=1, _Primaries=1, _Transfer=1)
Also a previewer might have a choice to set a delay between frames or hard code fps for preview, look for it if it is there.
It got rid of the warning, but it still doesn't fix the length.
Selur
22nd September 2024, 15:58
Did you try to remux the file?
'mkvmerge v2.2.0 ('Turn It On Again') built on Mar 4 2008 12:58:26', maybe current source filters have some issues with how 'mkvmerge v2.2.0' muxed stuff back then.
poisondeathray
22nd September 2024, 18:56
What does
clip = core.text.ClipInfo(clip)
say about the length (frame count), and fps ?
jay123210599
26th September 2024, 13:53
Did you try to remux the file?
'mkvmerge v2.2.0 ('Turn It On Again') built on Mar 4 2008 12:58:26', maybe current source filters have some issues with how 'mkvmerge v2.2.0' muxed stuff back then.
How do I remux a mkv file?
jay123210599
26th September 2024, 14:18
What does
clip = core.text.ClipInfo(clip)
say about the length (frame count), and fps ?
How do I use that for my vspreview script?
poisondeathray
26th September 2024, 16:09
How do I remux a mkv file?
Use mkvtoolnix-gui, add the file, push "start multiplexing"
How do I use that for my vspreview script?
add the line to your script after the source filter . It will look like something like this
clip = core.ffms2.Source(path to video)
clip = core.text.ClipInfo(clip)
clip.set_output()
jay123210599
27th September 2024, 14:27
What does
clip = core.text.ClipInfo(clip)
say about the length (frame count), and fps ?
@poisondeathray When using ffsm2. the length is 30926 frames and the fps is 24000/1001 (23.976024).
poisondeathray
27th September 2024, 15:32
@poisondeathray When using ffsm2. the length is 30926 frames and the fps is 24000/1001 (23.976024).
30926 frames @ 24000/1001 CFR should be 21:29.871. Neither 23 minutes, or 18 minutes. Where are you getting 18 minutes from ?
Something might be wrong with that specific video - do the other source filters lsmash and bestsource give same result ?
If you check another random video, is it ok? Is problem only this specific video?
Did you try remuxing and testing again ?
When you open this video in vdub2 directly, what is the framecount and duration ?
What is the audio duration ?
Where is the full mediainfo report ? What other streams are there ? File size is 160MB, but video stream is only 105MB .
jay123210599
28th September 2024, 23:54
30926 frames @ 24000/1001 CFR should be 21:29.871. Neither 23 minutes, or 18 minutes. Where are you getting 18 minutes from ?
Something might be wrong with that specific video - do the other source filters lsmash and bestsource give same result ?
If you check another random video, is it ok? Is problem only this specific video?
Did you try remuxing and testing again ?
When you open this video in vdub2 directly, what is the framecount and duration ?
What is the audio duration ?
Where is the full mediainfo report ? What other streams are there ? File size is 160MB, but video stream is only 105MB .
Wait, I get it now. My video has two audio streams, one that last for 23 minutes and one that last for 21.
LightArrowsEXE
8th October 2024, 08:52
"WARNING: Video Node 1: Had to assume these props which were unspecified or non-valid for preview <"_Matrix, _Primaries, _Transfer>"
That is vspreview warning most likely because like any other previewer, it has to change vs.VideoNode (your clip) into rgb. So if those values are not in props (they were not read from a source plugin) it has to guess and default.
Bit late of a response, but this is correct. I've made this warning a bit clearer (https://github.com/Jaded-Encoding-Thaumaturgy/vs-preview/commit/e89dfcdbf7d23c320e42908ddc65789007ef8deb), so hopefully it should be easier to understand should you run into it again.
2024-10-08 09:52:06.681: root: WARNING: Video Node 1: The following frame properties had to be assumed for previewing: <_Matrix=6 (SMPTE ST 170m), _Primaries=6 (SMPTE ST 170m), _Transfer=6 (BT.601)>
You may want to set explicit frame properties instead. See https://www.vapoursynth.com/doc/apireference.html#reserved-frame-properties for more information.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.