AvsPmod (x64)
Jump to navigation
Jump to search
AvsPmod (x64)
Required Components
Download the Premade Install and Plugin folder Bundle
Setting up the environment
- Unzip and open the premade Install and Plugin folder Bundle in Explorer.
(should be named something like "AvsPmod_Setup_Vx.x.x.zip") - Install AviSynth+
Starting at the root of the Install and Plugin folder extracted archive, the AviSynth+ install is located AvsPmod_Setup_Vx.x.x\AvsPmod_Setup\AviSynthPlus.
There should only be 2 things inside the directory: A folder named plugins64+, and AviSynthPlus_3.7.0_20210111_vcredist.exe
execute the AviSynthPlus_3.7.0_20210111_vcredist.exe file - Open the newly installed AviSynth+ plugins64+ directory in a new Explorer window
Unless you changed the the AviSynth+ install location, your plugins directory should be
(enter these into your explorer location bar): %ProgramFiles(x86)\%AviSynth+\plugins64+ There should be only 3 files inside the directory: colors_rgb.avsi, DirectShowSource.dll, TCPDeliver.dll - Open the plugins64+ directory that's next to the AviSynthPlus_3.7.0_20210111_vcredist.exe in the install directory
- Copy contents into your Avisynth+ plugin64+ directory
Copy all the files from the AvsPmod_Setup_Vx.x.x\AvsPmod_Setup\AviSynthPlus\plugin64+ directory to the %ProgramFiles(x86)\%AviSynth+\plugins64+ directory - Close the %ProgramFiles(x86)\%AviSynth+\plugins64+ Explorer window
- Copy the AvsPmod_x64 folder to your desktop
The AvsPmod_x64 folder is located in the AvsPmod_Setup_Vx.x.x\AvsPmod_Setup directory - Start AvsPmod and open the settings dialog (Options > Program settings)
- On the User Sliders tab check Hide slider window by default (The slider window usually only gets in the way)
- If you are using more than one screen, it's usually wise to check the Seperate preview window option, so you can have one screen dedicated to the video and one to the script
- On the Misc tab, uncheck the Show warning for bad plugin naming at startup option
- Go to Options > Snippets and click on Insert. Insert the following script template as snippet and give it a tag you will remember
(Script by Firesledge with a few additions)
#############################################################################
####################### -Options, Settings- #############################
#############################################################################
vidfile = "VIDEOFILE"
subfile = "SUBFILE"
group = "GROUPNAME"
#Unless upscaling leave these as 0, else add desired values
upscale_width = 0
upscale_height = 0
Logging = false
display_group = true
displayFramNum = false
display_timecode = false
display_subtitles = true
# Adding blank frames in front or back of the VidClp
Front_FramePadding = 0
Back_FramePadding = 0
#############################################################################
################## -Should Not Need To Change- ##########################
#############################################################################
## creating file and set path for future log entries:
(Logging) ? Eval("""
folder = ScriptDir()
(RightStr(folder, 1) == "\") ?
\ SetLogParams(folder + group + "_ScriptLog.log", LOG_INFO): SetLogParams(folder + "\" + group + "_ScriptLog.log", LOG_INFO)
LogMsg("Starting Logger", LOG_INFO)
""")
\:nop()
c1 = FFVideoSource (vidfile, enable10bithack=false, colorspace="YV12")
c2 = FFVideoSource (vidfile, enable10bithack=true, varprefix="c1_", colorspace="YV12")
(StrLen(subfile) == 0) ? Eval("""
F_blank1 = BlankClip(c1, length= Front_FramePadding)
B_blank1 = BlankClip(c1, length= Back_FramePadding)
c1 = F_blank1+c1+B_blank1
F_blank2 = BlankClip(c2, length= Front_FramePadding)
B_blank2 = BlankClip(c2, length= Back_FramePadding)
c2 = F_blank2+c2+B_blank2
"""):
\nop()
w = c1.Width ()
h = c1.Height ()
wm4 = (w + 3) / 4 * 4
hm4 = (h + 3) / 4 * 4
b10 = (c2.Height () > c1.Height ())
target_width = (upscale_width > 0) ? upscale_width : w
target_height = (upscale_height > 0) ? upscale_height : h
matrix = (c1_FFCOLOR_SPACE == 1) ? "709"
\ : (c1_FFCOLOR_SPACE >= 5) ? "601" : Dither_undef ()
par = (c1_FFSAR_NUM > 0 && c1_FFSAR_DEN > 0)
\ ? Float (c1_FFSAR_NUM) / Float (c1_FFSAR_DEN)
\ : Dither_undef ()
tv_range = (c1_FFCOLOR_RANGE != 2)
(b10) ? c2 : c1
#Adding Subs based on the file ext
Subs = (StrLen(subfile) > 0 && display_subtitles) ?
\ (RightStr(LCase(subfile), 3) == "sup") ?
\ (b10) ? Dither_limit_dif16(DitherPost(mode=-1).SupTitle(subfile).Dither_convert_8_to_16 (), thr=1.0, elast=2.0) : SupTitle(subfile)
\ :(RightStr(LCase(subfile), 3) == "sub") ?
\ (b10) ? Dither_limit_dif16(DitherPost(mode=-1).VSFilter_Vobsub(subfile).Dither_convert_8_to_16 (), thr=1.0, elast=2.0) :
VSFilter_Vobsub(subfile)
\ :(b10) ? Dither_limit_dif16(DitherPost(mode=-1).TextSub(subfile).Dither_convert_8_to_16 (), thr=1.0, elast=2.0) : TextSub(subfile)
\: nop()
#Add blank frames if needed
(StrLen(subfile) > 0 && display_subtitles) ? Eval("""
F_blank2 = BlankClip(Subs, length= Front_FramePadding)
B_blank2 = BlankClip(Subs, length= Back_FramePadding)
F_blank2+Subs+B_blank2
"""):
\nop()
(VersionNumber () >= 2.6) ? last
\ : (b10) ? Dither_addborders16 (0, 0, wm4 - w, hm4 - h)
\ : AddBorders (0, 0, wm4 - w, hm4 - h)
(target_width != c1.Width() || target_height != c1.Height()) ? Dither_srgb_display (lsb_in=b10, matrix=matrix, par=par, tv_range=tv_range, w=target_width,
h=target_height)
\ : Dither_srgb_display (lsb_in=b10, matrix=matrix, par=par, tv_range=tv_range)
cmt1 = (target_width > c1.Width() || target_height > c1.Height()) ? group + "\nupscaled" : group
cmt2 = (display_group) ?
\ cmt1 : ""
FFInfoEx(framenum=displayFramNum,vfrtime=display_timecode, cfrtime=false, frametype=false, x=last.width-6, y=4, cmt=cmt2, align=9, shorttime=true)
- Now that you're all set, let's load the videos to compare.
- Click into the empty script window and hit F7 to get a list of your snippets. Since there's only the one snipped you just created, hit TAB to insert it
- Replace VIDEOFILE in the first line with the full path to an episode (e.g. C:/MyCoolVideos/Oruchuban Ebichu/Oruchuban Ebichu - 01-02 [Ampeg].avi) of the first release you want to compare and GROUPNAME in the last line with the appropriate group tag
- Hit F5 to load (or refresh) the video. Loading a file for the first time might take a few seconds, since the file is being indexed first.
- Save the script
- Hit Ctrl+N or double click next to the current tab to open a new script tab
- Repeat from Step 3a
- Syncing up the releases (easymode)
- Check if the video of all releases matches up, by going through them with Alt+1, Alt+2, Alt+3, ...
The best way to do is is to seek to the last frame before a scene change, check if it matches up across tabs, then seek to the next frame and check again
(Seek by using the arrow keys (left/right: 1 frame; up/down: 1 second) or clicking the timeline for larger time distances)
Note: You may find out that not all subsequent frames match up or worse, the releases running out of sync over time. If it's only single frames, just avoid using them for screenshots. In case of releases running out of sync, you're dealing with either missing sections or different frame rates. Refer to the [Advanced Tutorial TBD] on how to deal with those cases. - Once all releases you want to compare are in sync, right click their tabs and add them to a single group. Make sure the Apply offsets and Offset also bookmarks options are checked.
AvsPmod will now remember the frame offsets between tabs and automatically seek to the right frames on a shared timeline.
- Check if the video of all releases matches up, by going through them with Alt+1, Alt+2, Alt+3, ...
- To reasonably compare screenshots, we need all frame sizes to be of the same resolution. You should have noticed any differences already while syncing up the releases.
If all resolutions match, skip this step. If they don't, find out the highest resolution by looking at the bottom right of the status bar.
The information will be in the following format: FrameWidth x FrameHeight (AspectRatio) - Framerate fps - Colorspace - Take the largest width and height among the releases and find the following section in the scripts for all releases that need to be resized:
upscale_width = 0 upscale_height = 0
Replace the 0s with the largest FrameWidth and the largest FrameHeight - Hit F5 to refresh the video preview and confirm everything works as expected.
- To reasonably compare screenshots, we need all frame sizes to be of the same resolution. You should have noticed any differences already while syncing up the releases.
- Select frames for the screenshot comparison
- Find a frame suitable to convey significant information about an aspect of video quality.
Pick:- one or two frames of a structure that represents what is on the screen most of the episode (to give a general idea about the video quality)
- frames from dark scenes
- high-detail frames / frames with fine structures
- frames with low contrast
- frames from high-motion scenes
- a frame or two from a fade-in/fade-out
- frames that display video artifacts in one ore more releases (refer to this thread on how to spot and identify video artifacts)
- at least one frame from the OP and one frame from the ED
In practice checking this gets more of a waste of time with each additional release you have to compare. Just try to keep the number of B-to-I comparisons low and make sure you don't pick only B-Frames for one release and only P-Frames for the other.
A very easy way to avoid this issue is to not pick frames by only looking at one release. This comes with the added benefit of you being more likely to spot video artifacts in ALL releases.
(Check the overlay on the top right of the video frame to find the frame type of the current frame.) - Once you've decided on a frame, hit Ctrl+B to bookmark it.
- Repeat from 6a for each additional frame
If you want to check the frames you already bookmarked, hit F2/Shift+F2 to browse through your bookmarks
- Find a frame suitable to convey significant information about an aspect of video quality.
- Export screenshots
- Once you're done deciding on frames to screenshot (10-15 is a good number), it's time to export them to PNG.
Go to Macros > Save image sequence (make sure Select frames is set to "Bookmarks" and Output format to "*.png") - Pick an output directory and basename.
I recommend using the basename format %06d_Groupname. This way your screenshots will (almost) always sort to comparison-friendly order by default. Make sure Add the frame number as suffix is checked when using %06d, otherwise it only counts up rather than inserting the current frame number.
- Example of Directory+Basename: Z:\ScreenCompare\Out\%06d_Zurako
- Click OK. You'll get a confirmation once the export is done.
- Repeat from step 7a for every open tab/release
- Once you're done deciding on frames to screenshot (10-15 is a good number), it's time to export them to PNG.
- Run the MKVToolnix installer. If using the portable version: Extract the archive
- The installer will recommend downloading gMKVExtractGUI (portable users: It can be downloaded seperately, just place it in the appropriate folder) at some point. Do that if you don't know what CLI MKVExtract is and how to use it. Probably also do it if you know, I find that it simplifies the extraction.
- Run gMKVExtractGUI.exe
- Drag and Drop the file(s) that you want to extract the suptitles of.
- Select the tracks you wish to extract. Then click Extract
- That's it, the extracted files (on default settings) should be in the same folder as the source files.
- Open Notepad or a text editor of your choice and type ;.
- Install MKVToolNix and copy the path to the destination folder into your notepad document.
- Append a ; to your notepad document. The contents should now look like this: ;C:\Program Files (x86)\MKVToolNix;
- Install FontUtils and make sure the Add installation directory to PATH option is checked
- Remember your AviSynth plugin directory from the first tutorial? Copy its path to your notepad document and append another ";"
Unless you changed the the AviSynth install location, your plugins directory should be
(enter these into your explorer location bar to make them resolve to full paths):- [On 64-bit Windows] %ProgramFiles(x86)%\AviSynth 2.5\plugins
- [On 32-bit Windows] %ProgramFiles%\AviSynth 2.5\plugins
;C:\Program Files (x86)\MKVToolNix;C:\Program Files (x86)\AviSynth 2.5\plugins;
- Unpack the ExRelease archive to
- %userprofile%\Documents\WindowsPowerShell\Modules
- To make the tools you just installed available to the script and the script conveniently available from everywhere, we need to add their locations to your PATH environment variable
- Hit Win+Pause to open the System Control Panel
- Click on Advanced System Settings (on the left sidebar), which should open the System Properties Window
- Click on Environment Variables
- Browse the System variables until you find the Path variable. Highlight it and click on Edit...
- Click into the Variable value input field, and hit the End key to move the cursor behind the last entry (which should be your FontUtils path)
- Append the contents of your notepad document and hit Enter
- Click OK on the Environment Variables and System Properties to save the settings
- Run Windows PowerShell (you'll find it in the programs menu)
- Make sure you are running at least Powershell v3.0. Type
$PSVersionTable.PSVersion
into the command prompt and hit enter. If the number under Major says 3, you're good to go (continue with step 8) - If it doesn't, install
- [On 64-bit Windows] Windows6.1-KB2506143-x64.msu
- [On 32-bit Windows] Windows6.1-KB2506143-x86.msu
If the update fails with "The update is not applicable to your computer", you need to install the .NET Framework 4.5 (dotNetFx45_Full_setup.exe) first.
You may need to restart your computer after installing Powershell 3.
Open Windows PowerShell again and run$PSVersionTable.PSVersion
to confirm you are now running version 3
- Make sure you are running at least Powershell v3.0. Type
- Next, we have to change the execution policy to allow running unsigned scripts. To do this, run
Set-ExecutionPolicy Bypass -Scope CurrentUser
and confirm with Y. With this preparations to run the ExRelease script are done. - Demuxes subtitles from .mkv files
- Extracts attached fonts softsubbed releases (which are required to render the subtitles correctly)
- Looks for typesetting inside extracted .ass subtiles and writes a text file, which can be imported as bookmarks in AvsPmod
- Loads extracted fonts into memory to make them available to the subtitle renderer
- Finds the highest resolution of the releases you want to compare
- Writes an AviSynth script with all important parameters already set, so you can start taking screenshots right away
- Open PowerShell
- Move or copy all releases you want to compare with each other to a separate folder. The script works on whole directories, so every .mkv file in the folder is going to be processed.
- Run the script by typing
ExRelease "X:\SomePath\To Love Ru Darkness"
(Substitute for your comparison directory, of course.) You can use the Tab key to auto-complete directories or just type "ExRelease" and drag/drop the folder into PowerShell to insert its path.
The script will now process your files and also create indexes, so it's time to go to the fridge and grab a beer. - When the script is done it will ask you if you want it to load fonts now. Answer with Y for yes.
Fonts remain loaded in memory for the duration of the session (that means until you log out or shut down the computer).- In case you want to (continue) work on the screenshot comparison after a logout or reboot, run the script again with
ExRelease "X:\SomePath\To Love Ru Darkness" -load
- In case you want to (continue) work on the screenshot comparison after a logout or reboot, run the script again with
- Open the generated .avs scripts (which reside next to the .mkv files) in AvsPmod.
If everything went right, all releases should display at the same resolution, subtitles should now be rendered on the frames, and the releases should now have the appropriate group tag next to the frame numbers. - To save you the effort of finding typesetting to compare, ExRelease has already done that for you.
- To import the found typesetting locations as bookmarks, click on Macros > Import bookmarks from file and pick the .TSChapters.txt saved alongside the release you are comparing.
- Repeat this for every other release you are comparing. This is important because you not only want to compare the TS group A did, but also the TS group B did and group a didn't.
- Take note that the typesetting detection is very crude and timecodes are somewhat inaccurate, therefore the typesetting may appear a frame before/after the bookmark or e.g. only starts fading in at the bookmark locations. Therefore it's vital to go trough the bookmarks and move them around to get useful screenshots. To remove a bookmark, just press Ctrl+B at the bookmarked location (frame number in red)
- To unload fonts after you are done with your comparison, run the script with
ExRelease "X:\SomePath\To Love Ru Darkness" -unload
Getting started with screenshot comparisons
Using MKVToolnix for subtitle extraction
Setting up the ExRelease extraction script (Deprecated and Complicated)
Using the ExRelease script to take screenshots with subtitles/typesetting
The ExRelease script automates a number of thigs you'd otherwise have to do by hand:
Addendum: The script offers a number of advanced parameters that let you customize your workflow. Run
Get-Help ExRelease -detailed
in PowerShell to display its internal help file.