VAP: Microsoft .NET Framework : Unhanded exception has occurred in your application

foosatraz

New member
I am getting an error:
Microsoft .NET Framework : Unhanded exception has occurred in your application
...
Index and length must refer to a location within the string. Parameter name: length


I am running VAP 1.35
Input is TV shows recorded by the HDHomeRun DVR in .mpg format.
VAP is configured:
Do QSF
Do Ad Scan
Use ComSkip Ad Scans
Generate Atomic Parsley Options File
Run post-processing scripts by default


I have a handbrake post-processing script. But, my guess from this output is that the calling of the post processing script is the problem.




The last few lines of the VAP log:
12/21/2017 6:42:34 PM Started auto-cuts, input: Odd Squad S01E05 20141201 [20171211-2130]
12/21/2017 6:42:34 PM Using profile: MPEG-2 Program Stream
12/21/2017 6:42:35 PM VideoReDo said: INFO: VideoReDo version 5.3.80.757 - Sep 26 2017
12/21/2017 6:43:46 PM VideoReDo completed manual cuts on: Odd Squad S01E05 20141201 [20171211-2130]
12/21/2017 6:43:46 PM Output file was not meta-renamed
12/21/2017 6:43:46 PM Wrote Atomic Parsley Options File
12/21/2017 6:43:46 PM No thumbnail found with title = Odd Squad_thumbnail




Here are the details of the error:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at System.String.Substring(Int32 startIndex, Int32 length)
at CallVBS.ClassCallVBS.StartUserPostProcess(String fname, String ppExtension, String inputFilePath, String configuredOutputFolder, VideoFileData fdata)
at VideoReDoAutoProcessor.Form1.ProcessingLoop()
at VideoReDoAutoProcessor.Form1.button1_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
VideoReDoAutoProcessor
Assembly Version: 1.3.5.0
Win32 Version: 1.3.5.0
CodeBase: file:///C:/Program%20Files%20(x86)/VAP/VideoReDoAutoProcessor.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Interop.tivocomLib
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files%20(x86)/VAP/Interop.tivocomLib.DLL
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.8825 (WinRelRS3.050727-8800)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
Accessibility
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
Toub.MediaCenter.Dvrms
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files%20(x86)/VAP/Toub.MediaCenter.Dvrms.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
 

foosatraz

New member
This error does NOT occur if no renaming is occurring. Everything works fine. QSF is done, commercials are marked, post-processing is done.


This error DOES happen if I put this in the Templates for parsing metadata from input file names:
Extension: .mpg
Template: {title} S0{seasonnum}E{epnum} {date} [{wildcard}]

The MetaData-based output file and title renaming section is all blank. But, unlike the previous passing case, this error case does correctly get the appropriate .apo file.

Odd Squad S01E05 20141201 [20171211-2130].apo contents:

--overWrite --stik "TV Show" --title "Reindeer Games" --grouping "Children" --year "20141201T00:00:00Z" --description "In this Christmas-themed episode, Olive and Otto help Santa track down his missing reindeer. Also, Oscar helps Ms. O get off Santa?s naughty list." --TVShowName "Odd Squad" --artist "Odd Squad" --albumArtist "Odd Squad" --TVEpisode "104" --TVEpisodeNum 04 --tracknum 04 --TVSeasonNum 01 --album "Odd Squad, Season 1"
 

dlflannery

Moderator
OK, found the problem and fixed. Substitute test executable (NOT an installer) ver. 1.36T1 contained in file VAPexe136T1.zip.
Download with this link:
vap.viderredo.net/VAPexe136T1.zip

However there are problems with your Input File Parsing Template: {title} S0{seasonnum}E{epnum} {date} [{wildcard}]

1. The '0' just before the (seasonnum} tag is incorrect I believe unless all your season numbers are less than 10 and you want to exclude the leading zero.

2. The {title} tag matches to just 'Odd" because the " S" matches to the beginning of " Squad" and terminates the title match. This also causes the seasonnum match to fail, because "quad S01" is not a valid number. In this case the TVDB search succeeds even with the truncated series title. I changed the file name to use "odd_squad" and the title parsing then worked. Interesting though: This episode is S1E4 according to TVDB.

This matching is based on Regular Expressions with some mods, and it can be tricky to make it work the way you want sometimes.
 
Top Bottom