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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 7th December 2011, 07:29   #1  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
DGIndex Batcher v1.22 (29 Jan 2021)

Code:
DGIndex Batcher - by StainlessS

http://forum.doom9.org/showthread.php?t=163369
http://www.autoitscript.com/forum/topic/137933-megui-autoencode-and-dgindex-batchers/


Utility to allow group selection of mpeg files for batching in DGIndex.
"MPG Files (*.vob;*.mpg;*.mpeg;*.m1v;*.m2v;*.mpv;*.tp;*.ts;*.trp;*.m2t;*.m2ts;*.pva;*.vro)"

The Batcher will display a little blue icon with an white pyramid, in the system tray.

The utility is written in 'AutoIt' script language and compiled to a native running
executable without need for the script development environment.

"DGIndex-Batcher.ini" will be used for the default paths so that it is not
necessary to re-build the executable to change defaults, the ini file will be created on first
use in the same directory as the batcher executable.

On start up, will auto execute DGIndex in default directory "C:\NON-INSTALL\DGIndex\DGIndex.exe".
If DGIndex not found in that directory, then will prompt user for the path to DGIndex, the
new default path will be saved in the ini file.

Can execute DGIndex before the batcher and the batcher will then use the instance of DGIndex
that is already running instead of auto loading it.

The default input mpeg clip directory is likewise saved in the ini file.

All of the DGIndex options should be set before using the batcher. In particular, the AVS
template should be set. Just like DGIndex, only 1 avs file will be created, no matter
how many audio streams exist in the mpegs. Refer to DGIndex docs for further info on
settings etc.

v0.01, When the batcher is active, you can press the 'PAUSE' key (usually above Page Up)
and the batcher will pause execution, pressing again will continue the batcher
from where it left off. Press 'SHIFT+CTRL+ALT+PAUSE' and the batcher will terminate.

v1.00, New options in GUI.
 Auto Overwrite,
   will overwrite existing *.d2v files. (This will NOT be implemented in the
   MeGUI Batcher for eg MP4 files, dont bother asking).
 Beep, on/off,
   saves DarkT's girlfriend getting woken up if off.
 Auto Close,
   close on completion without message box.
 Call MeGUI Batcher,
   will ask for location of partner batcher for MeGUI (source supplied)
   so as to use DGIndex batcher to index mpeg files and pass the results to the MeGUI Batcher
   which will feed them into MeGUI.
 MeGUI Batcher STOP,
   Stop at MeGUI Batcher GUI.

 Note, the MeGUI and MeGUI batcher settings should have been setup prior to using
 the 'Call MeGUI Batcher' option, The output directory of DGIndex Batcher will be fed into
 the MeGUI batcher, ie no need to set it in MeGUI Batcher first. NOTE ALL avs files in the
 DGIndex output folder will be fed into the MeGUI batcher.

v1.11, New options in GUI.
  Auto Overwrite Avs, deletes avs file as DGIndex will only overwrite existing d2v's, and will
  leave any existing avs file as is.

  Ignore Audio Delay Warning, will just click on OK button if this dialog box appears, will
  also produce a popup log file if this occurs.

v1.14, 'Insert Infos' insert some stuff from DGIndex Information Window into AVS template file. (See AVS File)
"Correct Illegal Field Transition", causes batcher to give automatic answer to such a dialog box.
Any File causing any out of ordinary behaviour, will be sent to the "SaveDirectory\PROBLEM\" folder
and will NOT be sent to MeGUI auto Encode Batcher if using that utility.

Thats about it, except that you should not try to confuse the batcher by messing with
the mouse or keyboard when it is busy. There has been no attempt to lock out user input
when busy, this would require admin privileges on Vista+.
If the batcher should stall, then exit via the system tray icon right button, 'exit'.


Enjoy.

StainlessS

-----------------------------------------------------------------------------------
Required for re-building of the script, AutoIt is the interpreter/compiler and SciTE4AutoIt3
is an IDE (Integrated Development Environment) for it. To re-build, just click on 'Build' in the
tools menu of the IDE.

AutoIt:- http://en.wikipedia.org/wiki/AutoIt

For details on AutoIt3 : http://www.AutoItscript.com/autoit3

SciTE4AutoIt3 homepage : http://www.AutoItscript.com/autoit3/scite

-----------------------------------------------------------------------------------

v0.00   07 Dec 2011 - First Release.
v0.01   12 Dec 2011 - Added Joining of Files sets (eg 1.VOB + 2.VOB etc).
    Added Hotkeys, 'PAUSE' button (above 'Page Up' usually) is pause script. 'SHIFT+CTRL+ALT+PAUSE' is QUIT Batcher.
    No longer using "[CLASS:WindowsForms10.Window.8.app.0.378734a]" style ID's as have found that they
    are based on the path to the executable and so will fail if not in the default path (the number on the
    end is some kind of hash on the path/filename).

v1.00 20 Dec 2011 - Source script is a DEBUG VERSION.
    Added options, Auto Overwrite, Beep, Auto Close, Call Megui Batcher, Megui Batcher STOP.
v1.10 24 Feb 2012 - Source script is a DEBUG VERSION.
    Fix for Windows 7, Select All when calling MeGUI batcher (different control in W7 FileSelector).
    Re-compiled with AutoIt v3.3.8.0

v1.11 10 June 2012  - Changed to Freeware licence. Sped up mouse a bit.
    New options in GUI. Auto Overwrite Avs, deletes avs file as DGIndex will only overwrite existing
    d2v's, and will leave any existing avs file as is.
    Ignore Audio Delay Warning, will just click on OK button if this dialog box appears, will also
    produce a popup log file if this occurs.

v1.12 26 June 2012,
    Fixed, broken OnAutoItExitRegister.
    Fixed, detects & restores minimized target window, could fail in Executable (not script) when batcher called
    via eg desktop shortcut and target is running but minimized (and no other windows open).
    Added Development Debug output log file, controllable via source script only ($WriteDebugFile=true).

v1.13, 21 Sept 2013
	Fixed ini read/write for JOIN_FILES and EXECUTABLE. Changed default Timeout to 300 seconds
	v1.14, 23 Sept 2013
	Added: Insert Infos, Correct Field Order, Move Problem Files.

v1.14, Added "Insert Infos" and "Correct Illegal Field Transition" options.
v1.15, 23 Feb 2015, Fixed, Append Slash to directory eg "D:" appends "\" when sent to FileSelector. Recompile AutoIt v3.3.12.
v1.16, 02 June 2015. Allow some special characters in filenames eg '#!+'.
v1.17, 06 Feb 2016. Re-compile for AutoIt v3.3.14.2
v1.18, 13 Mar 2018, Recompile AutoIt v3.3.14.4
v1.19, 13 July 2018, Recompile AutoIt v3.3.14.5
v1.20, 24 Jan 2021, Some fixes.
v1.21, 28 Jan 2021, Close Preview window before Information Window, avoid DGIndex v2.0 Not Responding when Full Indexing.
v1.22, 29 Jan 2021, Cockup in v1.21, had left DGIndex bug testing code uncommented, bug still existed. Fixed.
Supports all the formats supported by DGIndex ie
"MPG Files (*.vob;*.mpg;*.mpeg;*.m1v;*.m2v;*.mpv;*.tp;*.ts;*.trp;*.m2t;*.m2ts;*.pva;*.vro)"
Also, Concatenation of File sets implemented, eg 1.vob + 2.vob etc.

Dummy Template included to demo additional info extracted from DGIndex Information window.
Code:
# Standard DGIndex Infos

VideoFileName   = "__vid__"
AudioFileName   = "__aud__"
AudioDelay      = Value("__del__")

# DGIndex_Batcher Infos

# Stuff from DGIndex Information Window will be inserted into below '__stuff__' insertion markers.

DGI_Field_Order = "__Field_Order__"
DGI_Stream_Type = "__Stream_Type__"
DGI_Profile     = "__Profile__"
DGI_Frame_Size  = "__Frame_Size__"
DGI_Display_Size= "__Display_Size__"
DGI_Aspect_Ratio= "__Aspect_Ratio__"
DGI_Frame_Rate  = "__Frame_Rate__"
DGI_Video_Type  = "__Video_Type__"
DGI_Sequence    = "__Sequence__"
DGI_Frame_Struct= "__Frame_Struct__"
DGI_Frame_Type  = "__Frame_Type__"
DGI_Colorimetry = "__Colorimetry__"

Mpeg2Source(VideoFileName)

AudioExt = GetFileExtension(AudioFileName)

Aud=      (AudioExt==".ac3") ? NICAC3Source(AudioFileName,channels=2,DRC=0)
        \ : (AudioExt==".mpa"||AudioExt=="mp1"||AudioExt==".mp2"||AudioExt==".mp3") ? NicMPG123Source(AudioFileName,Normalize=False)
        \ : (AudioExt==".wav") ? RaWavSource(AudioFileName)
        \ : (AudioExt==".dts") ? NicDTSSource(AudioFileName)
        \ : 0

#Assert(!isInt(Aud),"NO AUDIO")

(!isInt(Aud)) ? AudioDubEx(Aud).DelayAudio(AudioDelay).Trim(0,0) : NOP    # Trim, chop/add audio to length

(!isInt(Aud) && AudioRate() <> 44100) ? ResampleAudio(44100) : NOP


S= \
  "Field Order   = " + DGI_Field_Order + "\n" + \
  "Stream Type   = " + DGI_Stream_Type + "\n" + \
  "Profile       = " + DGI_Profile + "\n" + \
  "Frame Size    = " + DGI_Frame_Size + "\n" + \
  "Display Size  = " + DGI_Display_Size + "\n" + \
  "Aspect Ratio  = " + DGI_Aspect_Ratio + "\n" + \
  "Frame Rate    = " + DGI_Frame_Rate + "\n" + \
  "Video Type    = " + DGI_Video_Type + "\n" + \
  "Sequence      = " + DGI_Sequence + "\n" + \
  "Frame Struct  = " + DGI_Frame_Struct + "\n" + \
  "Colorimetry   = " + DGI_Colorimetry

(DGI_Field_Order != "__Field_Order__") ? SubTitle(S,lsp=0,font="Courier New") : NOP    # Dont Show Subs if Infos not inserted


GOT_INFOS = (DGI_Aspect_Ratio=="16:9 [3]")

FAR = (GOT_INFOS) ?  16/9.0 : (DGI_Aspect_Ratio=="4:3 [2]") ? 4/3.0 : 1

Eval( (FAR!=1) ? "MeGUI_DarX=Round(FAR*1000) MeGUI_DarY=1000" : "" )

Return Last

##########

Function GetFileExtension(string fn) { rfn=fn.RevStr i=rfn.FindStr(".") Return (i==0) ? "" : rfn.LeftStr(i).RevStr }
What above template might look like when filled in, here:- http://forum.doom9.org/showthread.ph...20#post1645220


Get It @ MediaFire in sig (UTILITY FOLDER):

Also get the partner MeGUI AutoEncode batcher already compiled, here (or in sig):-
http://forum.doom9.org/showthread.php?t=163343

NOTE, Both MeGUI Batcher and DGIndex Batcher contain the source for BOTH utilities.
__________________
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; 29th January 2021 at 05:00. Reason: Update
StainlessS is offline   Reply With Quote
 

Tags
batcher, dgindex

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 15:07.


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