VideoReDo-Autoprocessor Program

dlflannery

Moderator
The particular example you gave, s06e12 hasn't had any metadata added for it in theTVDB.com. Note that s06e11 is incomplete also.

However, even using s06e10, which has been populated on theTVDB.com, there is a problem with your input parsing templates.

I guess it wasn't clear from my previous post but, since you want to use OAD and a 'proper" (spaced) episode name, your folder/file renaming depends on a successful TVDB.com lookup. The strategy for this (besides requiring the episode data to be in theTVDB.com) is to use the series name, corrected by a translation to insert spaces, plus the season and ep numbers, all parsed from the input file name.

The parsing template you need is {title}-S{seasonnum}E{epnum}-, i.e., do NOT try to parse {eptitle}. If you parse out the {eptitle} it will be space-less and it will appear that way in meta-renamed folders/files. The file and folder renaming behavior when required tags are not populated is explained if you click the "Help" button on the Metadata Templates tab of Advanced Configuration.

BTW you can view some of a file's metadata by right-clicking on the name in the Monitored Files list.

I'm toying with an idea to automatically insert spaces in the {title} and {eptitle} values parsed from input file names. It would depend on the upperCamel formatting seen in your filenames and would be invoked by prepending '#' to the parsing template. Basically it would scan from left to right and every time it saw a transition from lower- to upper case, it would insert a space. This would remove the need for string translations and would enable correctly parsing {eptitle}.

Also I see:
TheBigBangTheory ==> TBBT
in your translation table. Don't think that is going to work. I tried "TBBT" in a browser search on theTVDB.com and it found nothing.
 

rgracie

Member
No, I'm sure you where clear, it's me trying to get my head around this.. :rolleyes: The auto space idea would be great, but I think there will continue to be issues on the moving part.

SO.... Instead of bending the original intention of VAP, How about I just use VAP's ability to start a .bat file after processing to do the lookup and move part. As I just discovered another gatcha.. I have about 7 shows (for my daughter) that get copied to a completely different location.

What vars are passed to the Batch file from VAP? Would it be too much to send some addition vars? As I think I would need pMonth, pDay, pYear (process date info, where TVDB fails), InputTitle, OutputFileName and possible file size? I think this would be a much better solution, and still self contained. What do you think??
 

dlflannery

Moderator
The arguments passed to VAPpostProcess script files are detailed in part 17 of "Things to Know" in VAP-ReadMe.pdf. There are only four:

1. Bare file name of output video (may be renamed per metadata template).
2. Bare file name of input video
3. Folder path to output video
4. Width of input video (e.g., “1920”) if VAP determines it, or “NA”

Here is what you requested:
pMonth, pDay, pYear (process date info, where TVDB fails), InputTitle, OutputFileName and possible file size.

Here's the deal:
If you develop and test a .cmd (or .bat) script that will do what you want with arguments consisting of the first four that VAP already provides plus the remaining ones you desire (e.g., month, day, year, title, filesize and ??), I will modify VAP to pass the additional arguments. Current users should have little or no problem with the extra args since their scripts will most likely just ignore them. By test, I mean call it from another script with all the arguments and any required dummy files, etc. in place to emulate actual usage. I won't even need to see your script, just know the desired argument list you settle on. I'll assume all arguments are strings in double-quotes separated by a space. If an arg value is not available, "NA" will be passed.
 

rgracie

Member
Sorry for the delay... This is just an update:

I've got a working skeleton .bat file that is currently being driven by VAP with VAP's currently provided vars.

Have you had any requests for a "VAPpreProcess.bat" system. Here one could load all manor of settings based on show name; the Comskip.ini file for example??

Anyway...

So all I need is to finish up the file with the ADDED VAP vars of:

pMonth = "03"
pDay = "20"
pYear = "2015"
FileSize = "3000" (In MB)
OutputFileEXT = ".ts"

I also need to figure out how to get VAP to NOT wait until the move is complete. I could you use your help on this one. Any Idea's? I've tried calling a TVTransfer.bat from within the VAPpostProcess.bat, but it still waits.

From within VAPpostProcess.bat
Code:
@ECHO ON
SET OutputFileName="%~1"
SET InputFileName="%~2"
SET FolderOutput="%~3"
SET BatFile="E:\VideoCaptures\Cleaned Files\TVTransfer.bat"

CALL %BatFile% %OutputFileName% %InputFileName% %FolderOutput%

Current TVTransfer.bat Iteration of the processing bat file:
Code:
@ECHO ON
SET sPAT="\\SERVER\Recorded TV\Other Shows"

::Todays Date
FOR %%A IN (%Date%) DO (
    FOR /F "tokens=1-3 delims=/-" %%B in ("%%~A") DO (
        SET MMDDYYYY=%%B-%%C-%%D
    )
)

setlocal ENABLEDELAYEDEXPANSION

SET OUTPUT_NAME=%~1
SET INPUT_NAME=%~2
SET OUTPUT_FOLDER=%~3
SET OUTPUT_FILE_SIZE_MB=550
SET SEARCHNAME=

echo.%OUTPUT_NAME%
echo.%INPUT_NAME%
echo.%OUTPUT_FOLDER%
echo.%MMDDYYYY%

:: Only procc. the video files
If %OUTPUT_FILE_SIZE_MB% LEQ 500 EXIT

::Remove any Spaces from Search Name
set HAYSTACK=%INPUT_NAME%
set HAYSTACK=%HAYSTACK: =%
echo.%HAYSTACK%

:: Grab the string before the first "-".
for /f "delims=-" %%i in ("%HAYSTACK%") do set string=%%i
SET SEARCHNAME=%string%

echo.%SEARCHNAME%

:: Get the Show Params
for /f "tokens=2-3 delims=;" %%A in ('findstr /b /i "%SEARCHNAME%" "C:\FTPSyncFiles\Bat Files\SHOWPARMS.txt"') do ( 

SET sPAT=%%A
)

echo.%SEARCHNAME%

:: Copy to the Server
If %sPAT% NEQ "" (
	:: Check to see if Dir exist already
 	if NOT EXIST %sPAT%\%MMDDYYYY% (
    	   MD %sPAT%\%MMDDYYYY%
  	)

ECHO %sPAT%\%MMDDYYYY%
MOVE "%OUTPUT_FOLDER%\%OUTPUT_NAME%.ts" %sPAT%\%MMDDYYYY%
)
 

dlflannery

Moderator
It's easy for VAP to provide the filesize in MB but just FYI there is a batch parameter extension %z that gets file size. I haven't tried it myself.

I like this site for a reference on batch commands:
http://ss64.com/nt/syntax-args.html

Try using CMD /C MOVE <arguments>
That should launch the move as a separate process and not wait for it to complete.

Do you need separate month, day and year args? VAP could easily provide a combined single arg in a desired format.
 

rgracie

Member
It's easy for VAP to provide the filesize in MB but just FYI there is a batch parameter extension %z that gets file size. I haven't tried it myself.

I like this site for a reference on batch commands:
http://ss64.com/nt/syntax-args.html

Try using CMD /C MOVE <arguments>
That should launch the move as a separate process and not wait for it to complete.

Do you need separate month, day and year args? VAP could easily provide a combined single arg in a desired format.
If you don't mind, passing the file size argument should make it a little easier to maintain on my side. (I'm not very good with Command Line)

Thank you for the suggestion on the CMD /C MOVE, I'll give that a try..

Sure, if you want to pass the entire date in MM-DD-YYYY format that would be great. I was just thinking about others that might want the date parts for different (easier) formatting. (instead of having to split it up)..
 

dlflannery

Moderator
Substitute the executable file contained in attached VAP124T4.zip. The attachment is not an installer.

I used the following vapPostProcess.cmd file test argument passing:

@echo off
setlocal
echo Bare output file = %~1
echo Bare input file = %~2
echo Output folder = %~3
echo Wideo width = %~4
echo Output extension = %~5
echo Output file Size (MB) = %~6
echo OAD month = %~7
echo OAD day = %~8
echo OAD year= %~9
pause

The last pause command allows you to see any errors or echo outputs before the script terminates BUT be sure you do NOT have "Run post-process scripts in hidden window" checked on the Other tab of Advanced Configuration (or you will have to shut down the script process in Task Manager).


Here is the output from a test run:

Bare output file = Spring Forward_s04_e03
Bare input file = AlaskaTheLastFrontier-S04E03-SpringForward-37047950-0
Output folder = C:\temp\mgmoves\Alaska The Last Frontier\10-19-2014\
Wideo width = 480
Output extension = .mpg
Output file Size (MB) = 160
OAD month = 10
OAD day = 19
OAD year= 2014
Press any key to continue . . .

Look at the Profile Match Strings tab of Advanced Configuration. Note the last column "Cmskp#". This allows you to specify the Comskip ini file to be used as Comskip<#>.ini. If this column is blank or '0' the default ini file will be used (comskip.ini). Note that the Ext column is for the desired output extension.
Also the default ini file must be present even if you never plan to use it -- otherwise VAP will disable ComSkip use entirely.

The feature to insert spaces in camel-formatted {title} and {eptitle} strings parsed from input file names also is in this version To activate this you prepend '#' to the parsing template. It will not alter a string if there is even one space already in it.
 

rgracie

Member
Wow, that was fast Sir! Thank you VERY MUCH..

I can confirm the new variables being passed to vapPostProcess.bat seem to be working perfectly. I will return after I start messing with the other new features.. I think I'm going to need an example for:

The feature to insert spaces in camel-formatted {title} and {eptitle} strings parsed from input file names also is in this version To activate this you prepend '#' to the parsing template. It will not alter a string if there is even one space already in it.
Oh and the "CMD /C MOVE..." did NOT work, VAP still stalls the entire time the file is being moved.
 

dlflannery

Moderator
Try using START instead of CMD /C for the move.

To invoke camel-formatted processing:
Whatever your input file name parsing template is, for example: {title}-S{seasonnum}E{epnum}-{eptitle}

just prepend # to it, for example: #{title}-S{seasonnum}E{epnum}-{eptitle}

Thus if {title} parses to "AlaskaTheLastFrontier" (camel formatted) it will be converted to "Alaska The Last Frontier", and similarly for the {eptitle} parse. Then you would not need or want any translation table entries that might have been entered to handle this.
 

rgracie

Member
Is this right? I have confirmed the EP exist in TVDB, but I think it's not finding it because it's searching for the incorrect string??

2015-03-21_9-11-02.png

2015-03-21_9-15-37.png
 

dlflannery

Moderator
The camel formatting of the title in the input file name is incorrect:

FreshOfftheBoat

The error is that "the" should be "The", i.e., FreshOffTheBoat.

The 4th line of the log excerpt you provided shows the problem. Series Name is what VAP used as a key when searching theTVDB.com.

VAP has to be able to assume proper camel-formatting if it's going to unpack it.
Who, or what algorithm, is doing this camel formatting?

Did using START work?
 
Last edited:

rgracie

Member
SageTV

Yes START /B works, but I'm now looking for a way to terminate the cmd.exe process when the move has taken place. Currently it leaves a bunch of cmd.exe process open..
 

dlflannery

Moderator
How about an EXIT command following the MOVE command? I don't fully understand your overall script structure so I am just throwing out ideas.

You also might try putting the MOVE command in a separate batch script and using START to launch it (passing source and dest args)

I've dealt with a number of batch script file scenarios and I always seem to have to try different things to get the desired behavior. I think fully understanding them is similar to fully understanding the Federal Tax Code. For most people it's just easier to try things until you find what works for a particular situation.
 

rgracie

Member
Yea, Tried that... I think I've tried everything I know and have read at this point. The only thing that allows processing to return back to VAP during the move is using START, but that keeps the cmd.exe process open, which of course will stop the PC from going to sleep.
 

dlflannery

Moderator
Think I may have the "move" solution. Here is my modified test VapPostprocess.cmd file:

@echo off
setlocal
echo Bare output file = %~1
echo Bare input file = %~2
echo Output folder = %~3
echo Wideo width = %~4
echo Output extension = %~5
echo Output file Size (MB) = %~6
echo OAD month = %~7
echo OAD day = %~8
echo OAD year= %~9
MD "J:\testMoves\%~9"
start "VAP Move" /MIN cmd /c move /Y "%~3%~1%~5" "J:\testMoves\%~9\%~1%~5"
rem pause

Notes:
1. The pause statement was remarked out for final testing during which "Run post-process scripts in hidden window" was checked.
2. The MD command makes only the destination folder. It does not cause an error even if that folder already exists.
3. The "VAP Move" argument to the start command is a window title for move process, visible if you maximize that window. This is optional.

I tested with files up to 4 GB, for which the moves take more than 2 minutes to my USB2 (J) drive. VAP was not blocked during the moves and the move's cmd process went off the Task Manager process list when the move completed.
 

rgracie

Member
Just wanted to "check in". System has been running pretty great so far. I have some more questions though :).


Comskip Solutions Vs Global QSF.

I'm trying to use certain comskip files bases on show names, but I think what I need is to see some example of search strings that I can use based on my scenario below.

How do I handle the global QFSing of my .ts files and NOT QSFing my .mpg files?

Couple that with shows that need to use a specific comskip file, with shows that will use the default?

Clear as mud right... :cool:
 

dlflannery

Moderator
See profileMatch.png image. VAP uses the first match it finds starting from the top of the list.
The generic policies of
1. QSF'ing .ps files, plus AdScan (ComSkip) and Post-processing, and using default Comskip.ini
2. Not QSF'ing .mpg files, plus AdScan (ComSkip) and Post-processing, and using default Comskip.ini
Correspond to the last two rows. These matches will never be reached if a match occurs in the top two rows.

The first row will match input files with "Alaska" in their names, such as "Alaska, the Last Frontier" and will do QSF, AdScan(Comskip), Post-Process and will use comskip3.ini

The second row will match input files with "drugs" in their names, such as "DrugsInc", will NOT do QSF but will do Adscan(ComSkip) and PostProcess, and will use comskip2.ini

You can have as many rows as you want. You may have to use larger match strings, for example if two different shows have "Alaska" in their file names. Or you may want larger match strings just to prevent false matches, such as a show that has "Alaska" in the file name because it's part of the episode name. You could use the entire camel-formatted series name, i.e., "AlaskaTheLastFrontier" just for better reliability. As the instructions say, the matching is not case sensitive and you should not include quotes (") in the match strings.
 

Attachments

Last edited:

LI-SVT

New member
Is there a way for VAP to also change the aspect ratio of the final output?

I use a S2 TiVo to record from an HD cable box. So the video is squeezed to 4:3. Is there any way for VAP to allow the final output to be 16:9? I have used the Video Redo GUI successfully to do this on individual files, so I know the results would be fine.
 
Top Bottom