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 > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th March 2023, 18:53   #1  |  Link
NLPguy
Registered User
 
Join Date: Feb 2015
Posts: 31
AviSynth+ Doubling the video lenght?

Hi,

I've been using an AviSynth+ script without any errors for 2 years.

However, since February 2023, it has been increasing the video length a lot. For example, a 2-hour video is being delivered as a 4-hour video.

Interestingly enough, I have noticed that this problem of doubling the video length does not occur in videos shorter than 1 hour.

I "guess" that it's not the AviSynth+ script that's causing the issue, but rather a Windows update on my Windows 10.

I'm using LSMASHVideoSource to open the file in AviSynth+.


Please,

Does someone know why it is happening?

Have you faced a similar problem?


More details about my PC features, Windows data, and AviSynth+ Script are available below:


Quote:
Device Name: Tony-PC
Processor: AMD Ryzen 7 2700 Eight-Core Processor 3.20 GHz
Installed RAM: 64.0 GB
Device ID: C34E00E7-08DA-4E24-9800-FB393CD66A3C
Product ID: 00331-20020-00000-AA561
System Type: 64-bit operating system, x64-based processor
Pen and Touch: No pen or touch input is available for this display.

Quote:
Operating System Name: Microsoft Windows 10 Pro
Version: 10.0.19044 Build 19044
Other Operating System Description: Not available
Operating System Manufacturer: Microsoft Corporation
System Name: TONY-PC
System Manufacturer: System manufacturer
System Model: System Product Name
System Type: x64-based PC
System SKU: SKU
Processor: AMD Ryzen 7 2700 Eight-Core Processor, 3200 Mhz, 8 Core(s), 16 Logical Processor(s)
BIOS Version/Date: American Megatrends Inc. 2407, 01/07/2020
SMBIOS Version: 3.2
Embedded Controller Version: 255.255
BIOS Mode: Legacy
BaseBoard Manufacturer: ASUSTeK COMPUTER INC.
BaseBoard Product: TUF GAMING X570-PLUS_BR
BaseBoard Version: Rev X.0x
Platform Role: Desktop
Secure Boot State: Unsupported
PCR7 Configuration: Binding Not Possible
Windows Directory: C:\Windows
System Directory: C:\Windows\system32
Boot Device: \Device\HarddiskVolume4
Hardware Abstraction Layer: Version = "10.0.19041.2251"
User Name: Tony-PC\Tony
Time Zone: Brasilia Time
Installed Physical Memory (RAM): 64.0 GB
Total Physical Memory: 63.9 GB
Available Physical Memory: 55.3 GB
Total Virtual Memory: 63.9 GB
Available Virtual Memory: 53.1 GB
Page File Space: 0 bytes
Kernel DMA Protection: Off
Virtualization-based security: Not enabled
Device Encryption Support: Reasons for failed automatic device encryption: TPM is not usable, PCR7 binding is not supported, Hardware Security Test Interface failed and device is not Modern Standby, Un-allowed DMA capable bus/device(s) detected, TPM is not usable
Virtualization Enabled in Firmware: No
Second Level Address Translation (SLAT) extensions: Yes
Virtualization Enabled: No
Data Execution Prevention Available: Yes


AviSynth+ SCRIPT THAT I'M USING:
Code:
SetMemoryMax(1024)
SetFilterMTMode("MT_SERIALIZED", 3)


Loadplugin("m:\temp2\mvtools2.dll")
LoadPlugin("m:\temp2\CNR2_x64.dll")
LoadPlugin("M:\Temp2\LSMASHSource.dll")
LoadPlugin("M:\Temp2\RgTools.dll")
LoadPlugin("M:\Temp2\MPEG2DecPlus64.dll")
Import("M:\Temp2\Zs_RF_Shared.avsi")
Import("M:\Temp2\LSFMod.avsi")
Import("M:\Temp2\SetMTMode.avsi")



####Source=mpeg2source("D:\Paulo Medeiros Junior  19-7-18\dvd\17 dvd e 09 8mm.d2v")
####Source=AVISource("D:\Bolshoi\Lote 02\L02-18 4capt V7800LGPANSVHDMI c TBC Ok.avi")

####Source=DirectShowSource("D:\Valdir Steglich 21.2.22\08 Valdir vhs  V17JVCES10 Ok.m2t")

v = LSMASHVideoSource("D:\Bolshoi\Lote 02\L02-45 2capt V19LGPANSVHDMI.mp4", track=0, threads=0, seek_mode=0,  
\                 seek_threshold=10, dr=False, fpsnum=0, fpsden=1, 
\                 format="YUV420P8", decoder="", prefer_hw=0, ff_loglevel=0)
a = LSmashAudioSource("D:\Bolshoi\Lote 02\L02-45 2capt V19LGPANSVHDMI.mp4")
Source=AudioDub(v,a)

 
#Source=DirectShowSource("E:\Carol 18.11.20 - Fazer\03 CA V17JVCES10.mp4", fps = 25, ConvertFPS = True ) #.Crop(0,0-0,-30,true) # para AVI encapsulado AVI Xvid da Avermidia
#Source=DirectShowSource ("E:\Pricilla 3.9.20 - Fazer CM\01 PR V17JVCES10.mp4", fps = 25, ConvertFPS = True )
##Source=DirectShowSource("E:\Decio 1.3.21 - Fazer\02 Decio 6 capt VPAN2JVCES10DV.avi")

SetFilterMTMode("DEFAULT_MT_MODE", 2)


#Conditionalmedian(source,mthres=16,mwidth=7,mheight=5,mp=11,interlaced=true) 
#ConditionalDenoise(source,mthres=16,mwidth=7,mheight=5,mp=11,p1=24,p2=12,interlaced=true) 
#bob(0,0.5)

chroma=source.Cnr2("oxx",8,16,191,100,255,32,255,false) #VHS
output=MDegrain2i2(chroma,8,2,0)

stackhorizontal(source,output)

return output

#-------------------------------

function MDegrain2i2(clip source, int "blksize", int "overlap", int "dct") 
{
  Vshift=0 # 2 lines per bobbed-field per tape generation (PAL); original=2; copy=4 etc
  Hshift=0 # determine experimentally 
  overlap=default(overlap,4) # overlap value (0 to 4 for blksize=8)
  dct=default(dct,0) # use dct=1 for clip with light flicker

  fields=source.SeparateFields() # separate by fields

  #This line gets rid of vertical chroma halo. Don't use unless you have the problem
  #fields=MergeChroma(fields,crop(fields,Hshift,Vshift,0,0).addborders(0,0,Hshift,Vshift))

  super = fields.MSuper(pel=2, sharp=1)
  backward_vec2 = super.MAnalyse(isb = true, delta = 2, blksize=blksize, overlap=overlap, dct=dct)
  forward_vec2 = super.MAnalyse(isb = false, delta = 2, blksize=blksize, overlap=overlap, dct=dct)
  backward_vec4 = super.MAnalyse(isb = true, delta = 4, blksize=blksize, overlap=overlap, dct=dct)
  forward_vec4 = super.MAnalyse(isb = false, delta = 4, blksize=blksize, overlap=overlap, dct=dct)

  #Increase thSAD for more denoising. Won't do much beyone about 1500
  MDegrain2(fields,super, backward_vec2,forward_vec2,backward_vec4,forward_vec4,thSAD=1500) 
Prefetch(16)
  Weave()
}


Thank you so much!

Last edited by NLPguy; 7th March 2023 at 18:57.
NLPguy is offline   Reply With Quote
Old 7th March 2023, 20:07   #2  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
The only slightly odd thing I see is the fpsnum=0 setting when you open the video. I'm not sure what that does.

If you put the output video into MediaInfo, what fps does it report?

Is everything playing in slow motion? Or, is it playing at normal speed and the video repeats twice?

What application are you using to read the AVISynth script, and how does that application save the video? That may be where the problem is.
johnmeyer is offline   Reply With Quote
Old 8th March 2023, 01:48   #3  |  Link
NLPguy
Registered User
 
Join Date: Feb 2015
Posts: 31
Hi john,

Quote:
Originally Posted by johnmeyer View Post
The only slightly odd thing I see is the fpsnum=0 setting when you open the video. I'm not sure what that does.
The fpsnum=0 it's because my video has a configuration of 60,000 FPS.


Quote:
Originally Posted by johnmeyer View Post
Is everything playing in slow motion? Or, is it playing at normal speed and the video repeats twice?
Videos with less than 1-hour work perfectly. But those over 1 hour starts normally at the beginning and gradually slow down.

After the video's real-time ends, it starts duplicating without any audio. And yes, it repeats twice.


Quote:
Originally Posted by johnmeyer View Post
What application are you using to read the AVISynth script, and how does that application save the video? That may be where the problem is.
VirtualDub2 (build 44282/release-AMD64).

Logarith Lossless Codec V1.3.27 64 bits, but the same thing happens with MagicYUV lossless V.1.2rev2 64 bits.




MediaInfo:

Quote:
General
Complete name : D:\Bolshoi\Lote 02\L02-23 3capt V7800LGPANSVHDMI.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (mp42/isom)
File size : 3.61 GiB
Duration : 1 h 42 min
Overall bit rate mode : Variable
Overall bit rate : 5 052 kb/s
Encoded date : UTC 2023-03-06 13:06:32
Tagged date : UTC 2023-03-06 13:06:32

Video
ID : 2
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3
Format settings : 2 Ref Frames
Format settings, CABAC : No
Format settings, Reference : 2 frames
Format settings, GOP : M=3, N=30
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1 h 42 min
Source duration : 1 h 42 min
Bit rate mode : Variable
Bit rate : 4 725 kb/s
Maximum bit rate : 5 000 kb/s
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Frame rate mode : Variable
Frame rate : 59.529 FPS
Minimum frame rate : 4.286 FPS
Maximum frame rate : 60.000 FPS
Original frame rate : 60.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.230
Stream size : 3.37 GiB (94%)
Source stream size : 3.37 GiB (94%)
Language : English
Encoded date : UTC 2023-03-06 13:06:32
Tagged date : UTC 2023-03-06 13:06:32
mdhd_Duration : 6130584
Codec configuration box : avcC

Audio
ID : 1
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 1 h 42 min
Source duration : 1 h 42 min
Bit rate mode : Constant
Bit rate : 320 kb/s
Nominal bit rate : 128 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 234 MiB (6%)
Source stream size : 234 MiB (6%)
Language : English
Encoded date : UTC 2023-03-06 13:06:32
Tagged date : UTC 2023-03-06 13:06:32
mdhd_Duration : 6130594
NLPguy is offline   Reply With Quote
Old 8th March 2023, 10:04   #4  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
mediainfo sees your file which has been encoded 2 days ago as MPEG-4AVC in VFR with AAC, no Largarith nor MagicYUV.
Is that your source ?
A sample of the source would be helpful.
What happens if you try LWLibavVideoSource and reduce the script to only
Code:
v=LWLibavVideoSource("D:\Bolshoi\Lote 02\L02-45 2capt V19LGPANSVHDMI.mp4")
a=LWLibavAudioSource("D:\Bolshoi\Lote 02\L02-45 2capt V19LGPANSVHDMI.mp4")
AudioDub(v,a)
Preview that in VD, and in AvsPmod, and in MPC-HC or -BE.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."

Last edited by Emulgator; 8th March 2023 at 10:13.
Emulgator is offline   Reply With Quote
Old 10th March 2023, 16:03   #5  |  Link
NLPguy
Registered User
 
Join Date: Feb 2015
Posts: 31
Quote:
Originally Posted by Emulgator View Post
mediainfo sees your file which has been encoded 2 days ago as MPEG-4AVC in VFR with AAC, no Largarith nor MagicYUV.
Is that your source ?
A sample of the source would be helpful.
What happens if you try LWLibavVideoSource and reduce the script to only
Code:
v=LWLibavVideoSource("D:\Bolshoi\Lote 02\L02-45 2capt V19LGPANSVHDMI.mp4")
a=LWLibavAudioSource("D:\Bolshoi\Lote 02\L02-45 2capt V19LGPANSVHDMI.mp4")
AudioDub(v,a)
Preview that in VD, and in AvsPmod, and in MPC-HC or -BE.

Hi Emulgator,

When I run the script in 30,000 it works with the old LSMASHSource.dll version of 07/20/2020 but with the new version of 02/19/2023, it does not work.

Unfortunately, I have to use 60,000 as my various VHS tapes are very oxidized and they have many horizontal lines.

Moreover, I'm using 60,000 because the tracking of the image has better quality and especially because the speed of the video images is fast. I mean, the videos show people moving a lot cause they are all about ballerinas dancing in dance events.

Thanks in advance for your help!

Code:
v = LWLibavVideoSource("D:\Bolshoi\Lote 02\L02-23 3capt V7800LGPANSVHDMI.mp4", format="YUV420P8", fpsnum=0)
#\ cache=true, cachefile="source.lwi" seek_mode=0, seek_threshold=10,
#\ dr=false, fpsnum=0, fpsden=1, repeat=false, dominance=0)
#\ format="YUV420P8", decoder="", prefer_hw=0, ff_loglevel=0)

a = LWLibavAudioSource("D:\Bolshoi\Lote 02\L02-23 3capt V7800LGPANSVHDMI.mp4", stream_index=-1, cache=true,
\av_sync=false, layout="", rate=0, decoder="")
AudioDub(v,a)


Below, it is the Mediainfo details of the last video:

Quote:
General
Complete name : D:\Bolshoi\Lote 02\L02-23 3capt V7800LGPANSVHDMI AVDPTL.avi
Format : AVI
Format/Info : Audio Video Interleave
Format profile : OpenDML
File size : 38.9 GiB
Duration : 1 h 41 min
Overall bit rate : 54.9 Mb/s
Writing library : VirtualDub2 build 44282/release

Video
ID : 0
Format : Lagarith
Codec ID : LAGS
Duration : 1 h 41 min
Bit rate : 53.4 Mb/s
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 3:2
Frame rate : 60.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Bits/(Pixel*Frame) : 2.574
Stream size : 37.8 GiB (97%)

Audio
ID : 1
Format : PCM
Format settings : Little / Signed
Codec ID : 1
Duration : 1 h 41 min
Bit rate mode : Constant
Bit rate : 1 536 kb/s
Channel(s) : 2 channels
Sampling rate : 48.0 kHz
Bit depth : 16 bits
Stream size : 1.09 GiB (3%)
Alignment : Aligned on interleaves
Interleave, duration : 17 ms (1.00 video frame)
Interleave, preload duratio : 500 ms

Last edited by NLPguy; 10th March 2023 at 16:10.
NLPguy is offline   Reply With Quote
Old 10th March 2023, 18:50   #6  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
If VHS capturing: There are lots of guides here.
I suggest to take the source VHS tape framerate as-is, matching the settings of capturing device to the source video system.
If you force non-matching settings, you will capture wrong.

If Brazil, then extra consideration.
I remember Brazil using the hybrid PAL-M (PAL color carrier, but NTSC frame properties)
so I am expecting 29.97i fps (525 timing lines, 480 picture lines).
Level were different too, I remeber to have seen elevated black pedestal and white at lower levels.
If capture device has no setting "PAL-M" then you would capture in setting "NTSC",
and correct levels later in Avisynth.

If the result is for archival and to be kept interlaced, encode as 4:2:2 and you are done.

If the result is for playback on progressive OLED/LCD screens:
You may want to use QTGMC.

This gives your desired 59.94 fps progressive frames, these you may encode as you wish.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."

Last edited by Emulgator; 10th March 2023 at 19:04.
Emulgator 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 01:55.


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