Log in

View Full Version : Problem with VFAPIConv


JimmyBarnes
12th February 2017, 04:31
Trying to make the transition from WinXP to Win10.

Ran avisynth 2.6.0 in Win10, then tried to use VFAPI Reader Codec 1.05 to open H.avs containing the 2 lines:

DirectShowSource("00662 - 2 - h264, 1080p24.mkv")
SelectRangeEvery(300,30)

where 00662 - 2 - h264, 1080p24.mkv is present in the same folder as H.avs, but VFAPI says H.avs is invalid.

Can anyone tell me what is wrong?

TIA

osgZach
12th February 2017, 09:20
have you considered trying something slightly less outdated like AVFS

http://turtlewar.org/avfs/

manolito
12th February 2017, 12:05
First of all you should consider renaming the source to something simpler. Also you need to specify the full path to the source file, even if it is in the same folder as the AVS. Then you should make the source Mod4 and/or convert it to RGB.

Example:
DirectShowSource("C:\Video\Test.mkv", fps=25, convertfps=true)
Crop(0, 0, -Width % 4, -Height % 4)
# ConvertToRGB()


I assume that your Win10 is the 64-bit version, and installing VFAPI under a 64-bit OS is a little tricky. A while ago I found this small tutorial somewhere:

Create a batch file with the name
vifpset_x6432.bat:

%WINDIR%\SysWOW64\rundll32.exe advpack.dll,LaunchINFSection vifp_x6432.inf,DefaultInstall

Create another file with the name:
vifp_x6432.inf

VFAPI - 15dec06
; Usage: right-click on this file and choose "Install"
; For 32-bit codec on WindowsXP 64-bit Edition

[Version]
Signature="$Windows NT$"

[DefaultInstall]
CopyFiles = CodecCopyFiles
AddReg = RegCodec

[DestinationDirs]
CodecCopyFiles=16425

[RegCodec]
HKLM, "Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32","VIDC.VIFP", ,"VFCodec.dll"
HKLM, "Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers.desc", "VFCodec.dll",, "VFAPI Reader Codec v1.05"

[SourceDisksNames]
1="VFAPI Reader Codec v1.01 install","",1

[CodecCopyFiles]
VFCodec.dll

[SourceDisksFiles]
VFCodec.dll=1


Both files are to be copied into vfapireader directory

Run vifpset_x6432.bat, then right click on vifp_x6432.inf ---> choose install

Then i copied manually vfcodec.dll into C:\Windows\System32
AND C:\Windows\SysWOW64 (just to be sure)


Then i opened regedit and created a new string in:

HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32

with the name
VIDC.VIFP

and entered the value
VFCodec.dll





Good luck
manolito

JimmyBarnes
12th February 2017, 13:46
have you considered trying something slightly less outdated like AVFS

http://turtlewar.org/avfs/

Worth a try but unfortunately didn't work :(

JimmyBarnes
12th February 2017, 13:50
First of all you should consider renaming the source to something simpler. Also you need to specify the full path to the source file, even if it is in the same folder as the AVS. Then you should make the source Mod4 and/or convert it to RGB.

I assume that your Win10 is the 64-bit version, and installing VFAPI under a 64-bit OS is a little tricky. A while ago I found this small tutorial somewhere

Tried all your suggestions (had already run across the tutorial) but nothing worked sadly :(

Am using TMPGEnc 6 which works fine with the MKV, but I would really like to do a compression test on a 10 % sample first, can you think of any way to do this?

poisondeathray
13th February 2017, 00:07
Is your script valid in the first place ? Can you open it in vdub or avspmod with working preview?

(I'd also consider something other than DirectShowSource() , it can be problematic with frame accuracy, seek issues, mixed up frames etc...)

JimmyBarnes
13th February 2017, 03:15
Is your script valid in the first place ? Can you open it in vdub or avspmod with working preview?

Yes the AVS opens in VDubMod 1.5.10.2 and I can preview frames at will.

(I'd also consider something other than DirectShowSource() , it can be problematic with frame accuracy, seek issues, mixed up frames etc...)

Used DS for thousands of comptests which give consistent results, but don't use DS for main encodes.

poisondeathray
13th February 2017, 04:46
Worth a try but unfortunately didn't work :(

In what way did avfs not work ?

Did you mean the receiving application couldn't "see" the fake AVI ? If so , some applications require RGB24 or 32. Then try add ConvertToRGB32() with the appropriate matrix, flags

JimmyBarnes
13th February 2017, 06:38
In what way did avfs not work ?

Did you mean the receiving application couldn't "see" the fake AVI ? If so , some applications require RGB24 or 32. Then try add ConvertToRGB32() with the appropriate matrix, flags

It couldn't process the AVS, gave "error", no AVI created.

But VFAPIconv 1.05 processes this same form of AVS in WinXP without problems.

manolito
13th February 2017, 15:32
This thing smells like a Win10 issue to me... :devil:
Maybe you should revert to Win7.

Another thing you could try is using AVS2AVI by Bujak. Get it here:
http://forum.videohelp.com/threads/363603-Frameserving-avisynth-fake-AVIs-into-Premiere-Pro-CC-with-makeAVIS?p=2313529&viewfull=1#post2313529

It always was very reliable for me. It is video-only, if you need audio in your fake AVI you have to add it with VDubMod.


Cheers
manolito

JimmyBarnes
13th February 2017, 22:23
This thing smells like a Win10 issue to me... :devil:
Maybe you should revert to Win7.

Yeah surely a Win10 issue but it's a new install.

Another thing you could try is using AVS2AVI by Bujak.
Cheers manolito

It worked but the resulting AVI won't play. When opened in VDubMod 1.5.10.2, it says unknown format AVAV. Tries to display using DS but all frames are blank.

00662 - 2 - h264, 1080p24.mkv that the AVS points to plays OK.

StainlessS
14th February 2017, 10:39
FourCC AVAV is described in first couple of links here(- https://www.google.co.uk/?gfe_rd=cr&ei=KRd1VKG6N5HCVND3gGA&gws_rd=ssl#q=fourcc+%22avav%22
as a wrapper for Avs2Avi.
No idea how to open such.

manolito
14th February 2017, 18:14
OK, did some tests if I could use an AVI wrapper under Win7 64-bit. Interesting results...

VFAPI and AVS2AVI did not work. I tried all kinds of things with the Registry and manually copying DLLs into the WOW64 folder, but it just could not find a decoder for the fake AVI.

But I did get MakeAVIS and the AVFS thing to work. Of course I have no idea if Win10 behaves the same (no, I absolutely will NOT install Win10), but I think there is a chance...

Before experimenting with these apps I strongly recommend to fix the Windows DirectShow filters. You need the DirectShow filter tweaker from here:
http://www.codecguide.com/windows7_preferred_filter_tweaker.htm

Install the current LAV Filters, then run the tweaker and set ALL DirectShow filters to LAV (the Microsoft filters are total crap).


MakeAVIs is an AVS wrapper that was included in older ffdshow versions. It only worked for me if ffdshow was installed (I used the latest CLSID build). You can get MakeAVIs here:
http://forum.gleitz.info/showthread.php?27664-Wo-ist-MakeAVIS2-exe-zu-finden&p=263708&viewfull=1#post263708


But I prefer the AVFS thing. After mounting the AVS script from a command window you must not close the console window which should appear now (with the message to press CTRL-C to exit). Leave it open until you are done with the fake AVI.

Loading this AVI into VirtualDub failed initially, but the reason was the 32-bit float audio delivered by LAVFilters. Run the LAV audio configuration and under output formats uncheck the 32-bit floating point format. After I did this I could use this fake AVI with every software I use to open AVI files.


Cheers
manolito

JimmyBarnes
15th February 2017, 07:01
OK, did some tests if I could use an AVI wrapper under Win7 64-bit. Interesting results... manolito

Wow, many :thanks: manolito. Your suggestions are not trivial so it may take me a while to get the courage to try them. Also I still have a working system (see below), just not as I'd like it.

As an aside I note that the "tutorial" you posted Feb12 (and which I had already tried) was said to work for VFAPI and Win7 x64 but did not work for Win10 x64. So, as I am finding with other matters as well, Win10 is a bitch...

Of course the aim of this whole exercise is to be able to do compression tests under Win10 x64 (surely someone else must be be doing them, or have comptests gone out of fashion?). Main encodes creating blu-ray backups using TMPGEnc Video Mastering Studio 6 Trial work without problem. So at the moment I am doing comptests under WinXP, and main encodes on my new Win10 rig which is 3x faster. FWIW I have found that 1440,72 gives a much faster and much more accurate comptest than 300,30.

manolito
15th February 2017, 17:06
surely someone else must be be doing them, or have comptests gone out of fashion?).

Please tell us how you do these compression tests. Which software are you using, and why can't you use the source MKV for this and need to use a fake AVI instead?

And yes, IMO compression tests have pretty much gone out of fashion because most people do not convert video for burning it on a physical optical disk any more. Mostly the conversion output will end up on a HDD, and in this case the final size is not that important. Which means you can do a quality based VBR or CRF encode.

Basically a compression test is needed if you want to encode in VBR mode but do not have the time for a complete 2-pass encode. For XviD and DVD output which will get burned on a CD or DVD mostly folks use a full 2-pass VBR encode these days because modern computers are fast enough. I still use HCenc 1-pass VBR sometimes for DVD output, and the compresssion test is performed automatically by HC. For Xvid/DivX output I use an older version of StaxRip, but I never did a compression test with it even if it can do this automatically.

Most of my conversions today are to AVC/AAC output using X264, and here I use the CRF (Constant Rate Factor) mode with a CRF value of 19 or 20. The result is copied to an external HDD and I watch it over my little Xtreamer streaming box.


Cheers
manolito

JimmyBarnes
16th February 2017, 01:45
Please tell us how you do these compression tests. Which software are you using, and why can't you use the source MKV for this and need to use a fake AVI instead?

Using TMPGEnc Video Mastering Studio 6 Trial. I do the encode on the fake AVI with say, SelectRangeEvery(1440,72), then multiply the result by 20. Only been using 1440,72 for a little but it seems to give results within a few % of the full encode. Of course the fake AVI points to the source MKV and won't work without it.


And yes, IMO compression tests have pretty much gone out of fashion because most people do not convert video for burning it on a physical optical disk any more. Mostly the conversion output will end up on a HDD, and in this case the final size is not that important. Which means you can do a quality based VBR or CRF encode.

Yes I save all my encodes on BD-R. I have thought many times of saving on HDD but the thought of losing a year or two's work if it fails deters me. I use M-Disc BD-R 25GB with a rated life of several centuries. I only backup blu-ray, can't stand to watch DVD anymore.

It is a bit of work but I am a collector at heart.. :devil:

Most of my conversions today are to AVC/AAC output using X264, and here I use the CRF (Constant Rate Factor) mode with a CRF value of 19 or 20. Cheers manolito

I use mainly CRF for encodes, only use 2-pass it I want to fit a multi-disc miniseries on a single BD-R.

Started using x264 a few years ago, probably mainly becos others said it was good, looks like they were right...

https://www.mediafire.com/convkey/af0a/2aw0hv8ay4jrgvn6g.jpg

cheers
JB

JimmyBarnes
16th February 2017, 11:10
Please tell us how you do these compression tests... why can't you use the source MKV for this and need to use a fake AVI instead?

There is a way to do a compression test using just the source MKV and no frameserving fake AVI (with something like SelectRangeEvery(X,Y))???

Please tell me how to do that and I will try it!

TIA

manolito
16th February 2017, 15:19
I am not familiar with TMPGEnc Video Mastering Studio 6 at all, but I can tell you how it works in StaxRip:

https://picload.org/image/rowaoial/comptest.jpg

This is the AVS script which StaxRip uses for the compression check (using the default 5% sample size):
DirectShowSource("F:\Download\test.flv", audio=false, convertfps=true, fps=25.000)
Crop(0,0, -Width % 4,-Height % 4)
ConvertToYV12()

SelectRangeEvery(280,14)

According to the StaxRip manual the recommended target quality to achieve a "balanced" quality is around 60% for XviD and more like 50% for X264.


Cheers
manolito

manolito
17th February 2017, 19:47
Just for the fun of it I downloaded and installed TMPGEnc Video Mastering Studio 6 Trial on my Win7 64-bit laptop, and my initial suspicion was confirmed:

There is absolutely no need to create a fake AVI using VFAPI or AVFS to use an AVS script in TMPGEnc. You can load the AVS script directly instead.

In the "File Open" dialog change the mask from "ALL Supported" to "ALL Files", then load the AVS script.

Depending on the source you might need the commands to convert the source to MOD4 and to YV12 color space.


Cheers
manolito

JimmyBarnes
17th February 2017, 22:41
Just for the fun of it I downloaded and installed TMPGEnc Video Mastering Studio 6 Trial on my Win7 64-bit laptop, and my initial suspicion was confirmed:

There is absolutely no need to create a fake AVI using VFAPI or AVFS to use an AVS script in TMPGEnc. You can load the AVS script directly instead.

Hmmm this works on my old WinXP PC so that's useful, but doesn't work on new Win10 PC.

https://www.mediafire.com/convkey/622f/ncnean6yq20gd3c6g.jpg

00066 - 2 - h264, 1080p24.mkv plays OK in the default Win10 app. I installed latest CCCP x64 with default settings but this did not fix.

Depending on the source you might need the commands to convert the source to MOD4 and to YV12 color space.

What are those commands, do you mind telling me?

manolito
17th February 2017, 23:58
See my previous posts, these are the commands:
Crop(0,0, -Width % 4,-Height % 4)
ConvertToYV12()


But under Win10 (in fact from Win7 upwards) the main problem is that Windows always uses its own set of DirectShow filters, and these filters mostly do not work.

If you want to stick with DirectShowSource you absolutely have to follow my advice from a few posts above and install LAV Filters plus use the Tweaker Tool to make LAV the preferred filters.

The alternative is to not use DirectShowSource at all and use FFmpegSource or L-SMASHSource as your source filter. I do not have any experience with L-SMASH, so here is how you set up FFmpegSource:

First I assume that you have installed the plain vanilla 32-bit AviSynth version 2.60. (There is also AviSynth+ and some MultiThreaded AviSynth versions, but they are all far from stable, so stay away...)

Download FFmpegSource from here:
https://github.com/FFMS/ffms2/releases/download/2.23/ffms2-2.23.1-msvc.7z

Extract the files from the x86 subfolder of the archive into your AviSynth\Plugins folder (which should be located under your "Program Files (x86)" folder).

Your AVS script should look something like this:

ffms2("My_Source_File", atrack=-1)
Crop(0, 0, -Width % 4, -Height % 4)
ConvertToYV12()
SelectRangeEvery(280,14) # replace the values with your own preferred values


There will be a short delay before the source file is opened, the reason is that FFmpegSource has to index the source file before opening it.

The "atrack=-1" command opens the first audio track in the source. If you omit this command only the video track will be opened, which you might prefer for a compression test.


Cheers
manolito

JimmyBarnes
18th February 2017, 03:31
But under Win10 (in fact from Win7 upwards) the main problem is that Windows always uses its own set of DirectShow filters, and these filters mostly do not work.

If you want to stick with DirectShowSource you absolutely have to follow my advice from a few posts above and install LAV Filters plus use the Tweaker Tool to make LAV the preferred filters.

CCCP already installed LAV filters. I ran the Tweaker Tool and reassigned H.264 x64 decoders from Microsoft to LAV but still get the same error in TMPGEnc 6 when I try to open the AVS directly.

I am using the plain AVIsynth 2.6.0. I deployed FFMpegSource as you instructed then tried to open this AVS directly in TMPGEnc 6:

FFMS2("00066 - 2 - h264, 1080p24.mkv")
ConvertToYV12()
SelectRangeEvery(1440,72)

Omitted cropping as can do that inside TMPGEnc.

There will be a short delay before the source file is opened, the reason is that FFmpegSource has to index the source file before opening it.

After about 5 minutes of "hourglass", TMPGEnc reports that it can't open the AVS. This is on a machine with Core i7 4+ GHz / 16 GB DDR-4.

manolito
18th February 2017, 13:31
The cropping is there to make the source MOD4. This is required for YV12, so you should not remove it from the script. You can also use RGB24 instead of YV12, for some applications this is even necessary. Just use the command "ConvertToRGB24()".

And the time for indexing depends on the duration and resolution of the source. If you do not delete the index file then you can reopen the source without another indexing pass. And indexing has the important advantage that it makes seeking within the file frame accurate (DirectShowSource is not frame accurate).

And installing codec packs like CCCP will usually make things worse, bad idea...

Cheers
manolito

JimmyBarnes
18th February 2017, 14:06
And installing codec packs like CCCP will usually make things worse, bad idea... manolito

Which LAV filters do you use?

Doing comptest using AVS opened directly in TMPGEnc4 (WinXP PC) tends to hang, something fake AVI does not do. Also results for the 2 methods are different (tried 3 BDs).

manolito
18th February 2017, 16:23
I use the standard stable version 0.69 from here:
https://files.1f0.de/lavf/LAVFilters-0.69.exe
Normal users should always use the installer, not the ZIP. During installation all settings can be left at their defaults. If your AVS script has audio in it, it may be necessary to disable the 32-bit floating point format in the LAV audio configuration.

And for codec packs I had my own disasters with K-Lite and CCCP. I had to restore an image backup to remove them. If you do a forum search for "codec packs" you will find that most people here strongly recommend against it. An exception may be the Shark007 package. I have not tried it myself, but a couple of friends like it.

Cheers
manolito

JimmyBarnes
21st February 2017, 04:04
I use the standard stable version 0.69 from here:
https://files.1f0.de/lavf/LAVFilters-0.69.exe

OK, I used a System Restore point specifically created before its install to remove CCCP. Then I installed LAV filters and again copied FFMS x86 subfolder files to the AviSynth\Plugins folder. However I forgot to reassign H.264 from MS codec to LAV.

Then I found TMPGEnc 6 would load this AVS:
FFMS2("00066 - 2 - h264, 1080p24.mkv")
ConvertToYV12()
SelectRangeEvery(1440,72)

or
ffms2("00066 - 2 - h264, 1080p24.mkv")
Crop(0, 0, -Width % 4, -Height % 4)
ConvertToYV12()
SelectRangeEvery(280,14)

(had to remove atrack=-1 or it would reject)

and even sometimes (sometimes rejected):
DirectShowSource("00066 - 2 - h264, 1080p24.mkv")
SelectRangeEvery(1440,72)

Maybe it needs the Crop and ConvertToYV12 lines?

And for codec packs I had my own disasters with K-Lite and CCCP. I had to restore an image backup to remove them.

Haven't had that experience on my WinXP PC. Even LAV filters seems to be a codec pack of sorts.

I'll have to get around to trying the FFMS2 avs on my Win10 PC.

Another question: Any idea why an MKV containing VC-1 rather than H264 video won't open in TMPGEnc 6?

manolito
21st February 2017, 16:28
(had to remove atrack=-1 or it would reject)

This means that the audio is rejected by TMPGEnc. To make sure that the exported audio is 16-bit PCM you can either disable all audio formats except 16-bit in the LAV audio configuration, or you can add the following line to your AVS file:
ConvertAudioTo16bit()

Maybe you should use GraphStudio0320.exe so you can see the DirectShow Filter Graph for your source MKV. Takes out the guesswork about which decoder is really used.


Any idea why an MKV containing VC-1 rather than H264 video won't open in TMPGEnc 6?

For DirectShowSource it could be this setting in the LAV video configuration:
https://picload.org/image/rlgwlaca/vc-1.jpg (https://pl.vc/1f9cf4)

Maybe try to uncheck this setting. For ffms2 I have no idea if it can actually decode VC-1.

//EDIT// Just looked it up, and ffms2 should support VC-1 just fine.


You wrote that opening an AVS script directly sometimes behaves differently than using a fake AVI of the same script. You could try to run the "Fix_AviSynth.bat" file from here:
http://www81.zippyshare.com/v/cnyayZUw/file.html

It is taken from Groucho's AviSynth version switcher (original batch file by Jones1913). The LAV installer modifies the AVS file handler upon installation, and this batch file restores the original settings from the AviSynth installation. Saved me a couple of times.


Cheers
manolito

manolito
22nd February 2017, 20:46
There is one other thing I forgot to mention:

If you had previously installed a codec pack, chances are that you have the Haali Media Splitter installed on your computer. Haali does not play nice with other splitters. It has the nasty habit to put itself into the foreground and effectively disable other splitters.

So if you have installed LAV Filters and want to use the LAV Splitter (which you should, it is far superior to Haali) then you absolutely must uninstall the Haali Splitter.


Cheers
manolito

JimmyBarnes
23rd February 2017, 12:48
This means that the audio is rejected by TMPGEnc.

There was no audio in the file, presumably that is why the error.

Maybe try to uncheck this setting. For ffms2 I have no idea if it can actually decode VC-1.
//EDIT// Just looked it up, and ffms2 should support VC-1 just fine.

The reason I found, was that TE6 does not support VC-1 as yet. However I found that TE6 would accept an AVS containing:

DirectShowSource("00092 - 2 - VC-1, 1080p24.mkv")

but the result was strange, a frame longer than the result under TE4/WinXP and badly out of sync with audio. TE6 indicated the source in AVS as 23.970 fps and Interlaced when in fact it is 23.976 fps and Progressive.

You wrote that opening an AVS script directly sometimes behaves differently than using a fake AVI of the same script. You could try to run the "Fix_AviSynth.bat" file from here:
http://www81.zippyshare.com/v/cnyayZUw/file.html

As that is simply a BAT/text file, could you simply paste it here? Zippyshare requires me to register and give my credit card details. Or is there a link where I don't have to do that?

BTW my Win10 PC has never had Haali splitter installed AFAIK - unless it was in CCCP, which was completely removed by System Restore.

Also I have purchased the retail version of TE6, identical to the Trial apparently but much less onerous when starting.

TIA

manolito
24th February 2017, 18:19
but the result was strange, a frame longer than the result under TE4/WinXP and badly out of sync with audio.

This is very typical if the Microsoft DirectShow filters are used instead of LAV. You really should use the Tweaker tool to change ALL available filters to LAV instead of MS.


And so far ZippyShare has never required registering for me.
https://picload.org/image/rlrpiaii/zippy.jpg (https://pl.vc/htt4k)
Use the large "Download Now" button at the top right corner, maybe use an ad blocker to get rid of the ads on that page.


Anyways, here is the batch file:

Fix_AviSynth.bat
@echo off
setlocal
fsutil dirty query %systemdrive% > nul
if errorlevel 1 goto :noAdmin
color 4f
echo.
echo Working...
echo.
echo.

if /i %PROCESSOR_ARCHITECTURE%==x86 if not defined PROCESSOR_ARCHITEW6432 set winarch=x32

if defined winarch (
call :regWin
) else (
call :regWow64
)
goto :end

:regWin
reg add "HKLM\SOFTWARE\Classes\AVIFile\Extensions\AVS" /ve /d "{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /ve /d "AviSynth" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /ve /d "AviSynth.dll" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /v "ThreadingModel" /d "Apartment" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\Media Type\Extensions\.avs" /v "Source Filter" /d "{D3588AB0-0781-11CE-B03A-0020AF0BA770}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avs" /ve /d "avsfile" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avsi" /ve /d "avs_auto_file" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile" /ve /d "AviSynth Script" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile\DefaultIcon" /ve /d "%WINDIR%\System32\AviSynth.dll,0" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avs_auto_file" /ve /d "AviSynth Autoload Script" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avs_auto_file\DefaultIcon" /ve /d "%WINDIR%\System32\AviSynth.dll,0" /f
goto :eof

:regWow64
reg add "HKLM\SOFTWARE\Classes\AVIFile\Extensions\AVS" /ve /d "{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /ve /d "AviSynth" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /ve /d "AviSynth.dll" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /v "ThreadingModel" /d "Apartment" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\Media Type\Extensions\.avs" /v "Source Filter" /d "{D3588AB0-0781-11CE-B03A-0020AF0BA770}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avs" /ve /d "avsfile" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avsi" /ve /d "avs_auto_file" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile" /ve /d "AviSynth Script" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile\DefaultIcon" /ve /d "%WINDIR%\SysWow64\AviSynth.dll,0" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avs_auto_file" /ve /d "AviSynth Autoload Script" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avs_auto_file\DefaultIcon" /ve /d "%WINDIR%\SysWow64\AviSynth.dll,0" /f
goto :eof

:noAdmin
echo This script must run with elevated privileges, so:
echo.
echo a) right click on it, chose "run as administrator"
echo b) or start it from within a root cmd window

:end
endlocal
echo.
pause


Cheers
manolito

JimmyBarnes
28th February 2017, 03:38
This is very typical if the Microsoft DirectShow filters are used instead of LAV. You really should use the Tweaker tool to change ALL available filters to LAV instead of MS.

Perhaps. On my WinXP PC with TE4 I have never had any probs with VC-1, don't know why there is the prob in TE6. It might be a Win10 issue. WinXP PC uses K-Lite codecs BTW.

I feel sure that the fact TE6 sees the AVS as 23.970 fps has a great deal to do with it. AVSs pointing to MKVs with H264 video always have the correct 23.976 fps.

In any case, blu-rays with VC-1 are uncommon, so I'll continue to process them in WinXP/TE4.

Anyways, here is the batch file:

Thanks, if it comes in useful I'll tell you.

I did more comptests directly on AVS on my Win10 PC. The results are OK and allow me to remove dependence on VFAPI/WinXP. Glad you discovered this workaround.

cheers
JB

manolito
28th February 2017, 05:34
I feel sure that the fact TE6 sees the AVS as 23.970 fps has a great deal to do with it. AVSs pointing to MKVs with H264 video always have the correct 23.976 fps.


DirectShowSource always had problems determining the correct source fps. That's why the fps parameter is there. If you know the source fps you should always specify it in the DirectShowSource command:

DirectShowSource("C:\Video\Test.mkv", fps=30000/1001, convertfps=true)


Another highly recommended workaround is using DSS2Mod instead of DirectShowSource.
https://forum.doom9.org/showthread.php?p=1699301#post1699301
Just extract the file "avss_26.dll" into your "AviSynth\Plugins" folder. In your AVS script use something like this:

a = DirectShowSource("C:\Video\Test.mkv", video = false)
v = DSS2("C:\Video\Test.mkv", fps=30000/1001, preroll=15)
AudioDub(v, a)

For interlaced HD sources the preroll parameter should be increased to maybe 100 or even higher.


Cheers
manolito