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 28th April 2018, 05:05   #1  |  Link
tsftd
Registered User
 
Join Date: Dec 2011
Posts: 6
Issues with audio syncing VHS captures

Hi there, first of all, I'm not entirely sure that this is the right subforum, so please move it if it's not.

I'm trying to capture + convert family VHS tapes, and some work fine, but I've been hitting a wall with the audio sync on others.

I'm using virtualdub to record, mediainfo results here:

General
Complete name : D:\2004 Vid Exer brick wall No#12 cut beg end.avi
Format : AVI
Format/Info : Audio Video Interleave
Format profile : OpenDML
File size : 25.9 GiB
Duration : 25 min 36 s
Overall bit rate : 145 Mb/s
Writing library : VirtualDub build 35491/release

Video
ID : 0
Format : YUV
Codec ID : YUY2
Codec ID/Info : YUV 4:2:2 as for UYVY but with different component ordering within the u_int32 macropixel
Duration : 25 min 36 s
Bit rate : 143 Mb/s
Width : 640 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Frame rate : 29.970 (30000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:2
Compression mode : Lossless
Bits/(Pixel*Frame) : 15.568
Stream size : 25.6 GiB (99%)

Audio
ID : 1
Format : PCM
Format settings : Little / Signed
Codec ID : 1
Duration : 25 min 36 s
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 : 281 MiB (1%)
Alignment : Aligned on interleaves
Interleave, duration : 33 ms (1.00 video frame)
Interleave, preload duration : 500 ms


The resulting AVI works perfectly, but is obviously a little... big. So I switch to MeGUI, using QTGMC to deinterlace, using the AVS script here:
Import("C:\Programs\Megui\tools\QTGMC\plugins\QTGMC.avsi")
Import("C:\Programs\Megui\tools\QTGMC\plugins\SMDegrain_v3.1.2.93s.avsi")
LoadPlugin("C:\Programs\Megui\tools\QTGMC\plugins\RgTools.dll")
LoadPlugin("C:\Programs\Megui\tools\QTGMC\plugins\masktools2.dll")
LoadPlugin("C:\Programs\Megui\tools\QTGMC\plugins\nnedi3.dll")
LoadPlugin("C:\Programs\Megui\tools\QTGMC\plugins\mvtools2.dll")
LoadPlugin("C:\Programs\Megui\tools\QTGMC\plugins\EEDI2.dll")
LoadPlugin("C:\Programs\Megui\tools\QTGMC\plugins\PlanarTools.dll")
LoadPlugin("C:\Programs\Megui\tools\QTGMC\plugins\TDeint.dll")
LoadPlugin("C:\Programs\Megui\tools\QTGMC\plugins\eedi3.dll")
SetMemoryMax(1024)
LoadPlugin("C:\Programs\Megui\tools\lsmash\LSMASHSource.dll")
LWLibavVideoSource("D:\2004 Vid Exer brick wall No#12 cut beg end.avi")
crop(4, 4, -8, -8)
ConvertToYV12(interlaced=true)
QTGMC( Preset="Slow" )
#denoise


And the output is fine... until I mux it into an MKV. The audio isn't just offset, it wanders, so setting a delay doesn't help. Mediainfo here:

General
Unique ID : 179977519268871847062986824869458377060 (0x876668CC5167C18A1A2094AF0C2E7964)
Complete name : D:\2004 Vid Exer brick wall No#12 cut beg end.avi (1).mkv
Format : Matroska
Format version : Version 4 / Version 2
File size : 919 MiB
Duration : 25 min 36 s
Overall bit rate : 5 018 kb/s
Encoded date : UTC 2018-04-28 02:29:52
Writing application : mkvmerge v22.0.0 ('At The End Of The World') 64-bit
Writing library : libebml v1.3.5 + libmatroska v1.4.8

Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main@L3.1@Main
Codec ID : V_MPEGH/ISO/HEVC
Duration : 25 min 36 s
Bit rate : 4 834 kb/s
Width : 628 pixels
Height : 468 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 58.322 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Bits/(Pixel*Frame) : 0.282
Stream size : 885 MiB (96%)
Writing library : x265 2.7+1-2aa737a99f51:[Windows][GCC 7.3.0][64 bit] 8bit+10bit+12bit
Encoding settings : cpuid=1173503 / frame-threads=4 / numa-pools=16 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=628x468 / interlace=0 / total-frames=89584 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=5 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / open-gop / min-keyint=25 / keyint=250 / gop-lookahead=0 / bframes=8 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=40 / lookahead-slices=0 / scenecut=40 / radl=0 / no-intra-refresh / ctu=64 / min-cu-size=8 / rect / amp / max-tu-size=32 / tu-inter-depth=3 / tu-intra-depth=3 / limit-tu=4 / rdoq-level=2 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / strong-intra-smoothing / max-merge=4 / limit-refs=1 / limit-modes / me=3 / subme=4 / merange=57 / temporal-mvp / weightp / weightb / no-analyze-src-pics / deblock=0:0 / sao / no-sao-non-deblock / rd=6 / no-early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=1.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=crf / crf=23.0 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=0 / ipratio=1.40 / pbratio=1.30 / aq-mode=1 / aq-strength=1.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=1 / overscan=0 / videoformat=5 / range=0 / colorprim=2 / transfer=2 / colormatrix=2 / chromaloc=0 / display-window=0 / max-cll=0,0 / min-luma=0 / max-luma=255 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / no-opt-cu-delta-qp / no-aq-motion / no-hdr / no-hdr-opt / no-dhdr10-opt / analysis-reuse-level=5 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-mv-type=0 / copy-pic=1
Language : English
Default : Yes
Forced : No

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : A_AAC-2
Duration : 25 min 36 s
Bit rate : 180 kb/s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Delay relative to video : 9 ms
Stream size : 33.0 MiB (4%)
Language : English
Default : Yes
Forced : No


I've tried everything that I can think of: muxing the encoded video + original audio, importing the original video's timestamps, etc, etc.

Any help would be greatly appreciated!

Last edited by tsftd; 28th April 2018 at 05:10.
tsftd is offline   Reply With Quote
Old 28th April 2018, 05:14   #2  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by tsftd View Post
Frame rate mode : Constant
Frame rate : 58.322 FPS
That's likely your problem


Check the framerate with info() at the end of the 1st script . Sometime L-smash produces "off" framerates with correct number of frames. You might need to use AssumeFPS(30000,1001) after the source filter LWLibavVideoSource() . AVISource is usually preferred for AVI .

In the future , you could also capture with a lossless compression codec such as huffyuv, ut video etc.. to reduce filesize

Last edited by poisondeathray; 28th April 2018 at 05:20.
poisondeathray is offline   Reply With Quote
Old 28th April 2018, 05:21   #3  |  Link
tsftd
Registered User
 
Join Date: Dec 2011
Posts: 6
I had actually just noticed that as well and confirmed that the framerate is as expected in the "working" videos.

However, I had no idea how to fix it, so thanks for the instructions.

I'll post back when I've tested it (long encode times) so future generations can profit.

Regarding the compression, it was being recorded on a computer that could barely keep up with uncompressed MPEG. Now that the capture is hooked up to a modern machine, I'll actually look into compressing it to save space.

Last edited by tsftd; 28th April 2018 at 05:25.
tsftd is offline   Reply With Quote
Old 28th April 2018, 11:09   #4  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by tsftd View Post
I'll post back when I've tested it (long encode times) so future generations can profit.
You don't need recode the video to change the fps, just use MkvToolNix to remux.

Select video track and force the FPS to 60000/1001p
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 28th April 2018, 14:38   #5  |  Link
LemMotlow
Registered User
 
Join Date: Jul 2011
Location: Tennessee, USA
Posts: 266
You haven't told us very much about how you're capturing. People have been using a few prescribed, tried-and-true VHS capture methods with VirtualDub for a few decades now. Every time someone meddles with the procedures and equipment, they come up with these bloody boring (and unsurprising) audio sync threads again and some rather goofy video statistic readouts.
Try this: Capturing with VirtualDub [Settings Guide]
LemMotlow 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 22:40.


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