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 > VirtualDub, VDubMod & AviDemux
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd November 2018, 16:04   #1  |  Link
mbcd
Registered User
 
Join Date: Dec 2008
Location: Germany
Posts: 173
Using avisynth-script like a filter (feed filename into it)

Is there a way to use a avisynth-script in vdub with different inputfiles?

In a normal way the filename is hardcoded in the avisynth-script, but this makes it impossible to reuse the script without editing the filename each time. Would be very cool to put avisynth-scripts into vdub-plugin-folder (as a template) and reuse them like normal filters. Of course vdub must change some placeholder for the inputfilename-variable inside avisynth-script. (for parallel-use the script should be temporary copies / duplicated)

Isre-using a script already possible, some way ?
mbcd is offline   Reply With Quote
Old 23rd November 2018, 16:25   #2  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
I used import("episodenumber.avs") for my encodes via a bat file. You can just set a variable name or use a source filter.
Never used vdub templates so can't comment on what.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 23rd November 2018, 16:37   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Not exactly what you want but maybe of use,

https://forum.doom9.org/showthread.p...avisynthesizer

Suggest Batch Mode, ie create your avs template and then group select input files, "Send To" Avisynthersizer and it will create one avs script for each input file.

EDIT: I have used VirtualDub templates, and they worked well, but cannot for the life of me
remember anything about how they worked.
Mobile:
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 23rd November 2018 at 16:45.
StainlessS is offline   Reply With Quote
Old 23rd November 2018, 18:36   #4  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
These are only hints because I didn't use:

method1: VirtualDubMod avs templates, afaik after opening with a template you get a synthesized script into editor, which you must save before using.
method2: ffdshow source/filter. It adds special function to avs environment to access currently opened video.
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 23rd November 2018, 18:53   #5  |  Link
jmartinr
Registered User
 
jmartinr's Avatar
 
Join Date: Dec 2007
Location: Enschede, NL
Posts: 301
You can use Stickboy's GetSystemEnv plugin to read environment variables and use that as a solution.

For example:
Code:
file = GetSystemEnv("filename")

audio = FFAudioSource(file)
video = FFVideoSource(file)
AudioDub(video, audio)
etc.
__________________
Roelofs Coaching
jmartinr is offline   Reply With Quote
Old 24th April 2020, 19:25   #6  |  Link
mattsmith321
Registered User
 
mattsmith321's Avatar
 
Join Date: Mar 2008
Location: Austin, TX
Posts: 14
I know this is an old thread but I ran across it while trying to do the same thing. I ended up putting something together and wanted to share in case it helps someone down the road. In my case I had 1800+ videos that I needed to process to deal with interlacing issues (from https://youtu.be/d4rLvpkBlnQ):

My approach was that instead of trying to make AviSynth process a different file name each time, I would instead bring my source file to my processing location, rename it to the name in my AviSynth file, then output it to my target name.

My AviSynth file is called MiniDV.avs and contained the following lines. As you can see, I am always processing "Input.avi":
Code:
SetFilterMTMode("QTGMC", 2)
FFmpegSource2("Input.avi", atrack=1)
ConvertToYV12()
AssumeBFF()
QTGMC(Preset="Slower", Edithreads=1, Sharpness=3.0, EZDenoise=3.0, NoisePreset="Fast")
BilinearResize(720,540)
PreFetch(threads=4)
I then have a wrapper MiniDV.bat batch file to trigger my ffmpeg script and do the file movements that I needed. You can see where I xcopy the file from my source location and rename it to Input.avi in my processing location (where ffmpeg is running). Then for the ffpmpeg output parameter I tell it to save it to my target location with the original name but with a new prefix.
Code:
@ECHO OFF
for %%f in (\\server\archive\MiniDV\2020\*.avi) do (
  set /p val=<%%f
  
  echo "Starting copy of: %%f"
  xcopy /y %%f Input.avi*
  echo "Finished copy"

  echo "Starting conversion..."
  ffmpeg -i "MiniDV.avs" -c:v libx264 -preset medium -tune film -c:a aac \\server\video\2020\%%~nf.mp4
  echo "Finished conversion"
  
  echo "Deleting input file..."
  del Input.avi
  echo "Finished deleting"
)
My 1800 files were in 10 different year directories. I'm sure I could have modified the script to process all of them in one go, but I did it year by year and updated the MiniDV.bat script to change the year in two locations. The only issue that needs to be tweaked is that the script needs the output directory to exist.

Those 1800 files were about 350GB and 30 hours of video. The script took about 70-75 hours to process all of the files. The final output is about 25GB of MP4 content that is so much better than any other attempts I have had in 15 years of having that particular camera and messing with the video.

Hope it helps someone. Looks like I registered here in 2008, didn't do much, disappeared for 12 years, and now leaving again. Take care!
__________________
Matt Smith
mattsmith321 is offline   Reply With Quote
Old 24th April 2020, 23:53   #7  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
This is a script I used to use as VirtualDubMod Template,
presumably for conversion of only short files, eg music tracks.

WAV_CONVERT_to_44Khz.AVST
Code:
#ASYNTHER CONVERT WAV 2 44.1Khz
[Audio=wavsource("%f")]
#Video=MPEG2Source("D:.d2v")
Video=blankclip(length=360000,color=0,width=320,height=240,fps=100)
#audio=DelayAudio(audio,0.0)
audio=SSRC(audio,44100)                 # audio=ResampleAudio(audio,44100) # Alternative if SSRC throws error for certain conversion factors
audiodub(video,audio)
ConvertToYV12()
Audio_Samples =AudioLength()
Audio_Length_In_Seconds=Audio_Samples / 44100.0
Video_Frames=ceil(Audio_length_In_Seconds * 100.0)
#messageclip("length is " + string(AudioLength()))
#reduceby2()
trim(0,Video_Frames-1)
info()
return last
I think I used to generate the files with embedded filenames at '%f', then maybe saved result WAV.
Think I also did something to batch add loads of them to VDMod joblist to save WAV files.
Long time ago, dont remember exactly. [EDIT: File last modified 2006]

Another template from 2006 for DGIndex's DGDecode.dll

MYD2V_TPLT.avst
Code:
#ASYNTHER MPEG2Source (DGDecode.DLL)
[Video=MPEG2Source("%f",info=0)]
last=Video	# Just so last gets a value if omitting Audio
#Audio = WavSource("D:\D2V\*.WAV")
#AudioDub(Video,Audio)
#DelayAudio(0.0)
#LoadVirtualdubPlugin("c:\delogo.vdf", "delogo", 0) 
#-------------------------------------------------------
#AssumeTFF()
#SeparateFields()			# Use to check field order
#weave()
#-------------------------------------------------------
#ConvertToRGB32(interlaced=true)
# 2nd last  arg is interlaced
#delogo(1,"","D:/T/deblend.bmp","D:/T/alpha.bmp","D:/T/color.bmp","D:/T/repair.bmp",15, 40, 1, 0)
#ConvertToYUY2(interlaced=true)
#-------------------------------------------------------
#				Telecide
# Guide(0=Blind,1=30->24fps,2=PAL LOCK,3=30->25fps)
# Post(0=Disable,2=Deinterlace)
#Telecide(Guide=0,post=0)
#----------------- FieldDeint YUY2/YV12 ----------------
# full=true to consider ALL frames combed.
# blend=true to use blend rather than interpolate.
#Fielddeinterlace(full=false,blend=false,map=false)
#----------------- KernelDeint YUY2/YV12/RGB -----------
# order=0 is bottom field first, MUST be set
#LeakKernelDeint(order=1,sharp=false,map=false)
# ---------------- Levels ------------------------------
# ------ Levels(ip_low,gamma,ip_high,op_low,op_high) ----
#Levels(16,1.0,235,16,235,coring=false)
#-------------------------------------------------------
#Lanczos4Resize(352,240,8,0,704,480)
#YV12InterlacedReduceBy2()
#ConvertToYV12(interlaced=false)
#Histogram(mode="levels")
trim(0,framecount()-1)
return last
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 25th April 2020 at 00:21.
StainlessS is offline   Reply With Quote
Reply


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 05:30.


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