# TiVo-VideoReDo-AutoProcessor Program



## dlfl

Download or see complete readme description and instructions ***here***.

*Note: With ver. 0.80 now supports TV Suite 4 with MPEG4 outputs and profiles.* See **this**.

*WHAT IS IT?*

A free utility program for TiVo-to-Go (e.g., TiVo Desktop or TiVoPlaylist) users who use VideoReDo (Plus or TV Suite) for editing transferred TiVo files. It runs on a Windows computer with VideoReDo (VRD) and TiVo Desktop installed (for registry settings only). TVAP detects TiVo files being transferred and, when transfer completes, it automatically and silently runs VideoReDo processes on the files as configured by the operator in the program GUI. QuickStream Fix (QSF) and/or Ad Detective scans ("Ad Scans")may be run. Optionally, all three file types (.TiVo, QSF outputs and Ad Scan outputs) are moved automatically to specified folders after processing is completed, or the original .TiVo file is deleted. Output file types of MPEG2 (.mpg), DVD-VOB (.mpg), DVR-MS (.dvr-ms), TS (*.ts) and TiVo (.tivo) are supported. ALL configuration is via the GUI - NO MANUALLY PREPARED
CONFIGURATION FILES ARE REQUIRED!

You can also select a .TiVo file and click a button to launch the "normal" (interactive GUI) version of VideoReDo (Plus or TV Suite) with the file loaded. This allows you to set Ad Detective parameters or just to preview the video (or anything else VRD can do).

Several metadata items are read from the TiVo files (e.g., Description, Genre, Subtitle/Episode, Episode #, Movie Year, Recording Date/Time). These are displayed by right-clicking on the file in the GUI file list and some of them are inserted in DVR-MS output files. pyTivo metaData files are automatically generated and paired with output MPEG2 files.

TVAP will run a batch file of your creation after processing each .mpg, .dvr-ms or .ts file -- this is typically used to run HandBrake to create a .mp4 version.

You can configure to produce a project (.vprj) file with automatic (Ad Detective or ComSkip) cuts as your output file. TVAP remembers this and displays a status of "AWAITING CUTS" for this video. Then if you later review this project and save it with your modified cuts, TVAP will automatically call VRD to produce the final edited output video with YOUR cuts. For videos that are awaiting cuts the "Run VideoReDo" button will load the project file, ready for you to review and modify the cuts.

You have the option of using ComSkip for commercial detection instead of the VideoReDo Ad Detective.

Read the "Things to Know" section and the Change Log at the end of the TVAP-readme.txt file for more details.

*THE BOILERPLATE:*

VideoReDo is a trademark of DRD Systems, Inc.
TiVo is a trademark of TiVo, Inc.

TVAP is free and is not an official product of either VRD or TiVo, neither of which are providing
support for it, nor do they officially endorse it.

*FEATURES:*

- GUI Selection of VRD operations: Default and individual settings for each TiVo file. Specific files may also be "blocked", so no processing occurs.

- GUI selection of whether DVD-VOB, MPEG2, DRV-MS or TiVo output file format is produced.

- GUI selection of whether Ad Scan produces only the project (.vprj) file or
automatically applies the cuts to produce a final edited output file.

- On first startup, reads the Desktop TiVo transfer folder from the Windows Registry. If not detected, prompts the operator to select the folder to be monitored.

- Can launch independent GUI version of VideoReDo with TVAP-selected .TiVo file loaded.

- Totally automatic operation with real-time configuration allowed.

- Status of all .TiVo files in the transfer folder and all configuration settings,
are maintained in an XML data file between program runs, automatically updated on startup.

- Maintains and displays a log file of processing actions.

- Shows file name, current processing action, and progress bar for VRD processes and file moves.

- Many tooltip hints.

- Does not modify Windows Registry.

- TVAP is lightweight: Uses less than 20MB of memory exclusive of VRD requirements. Uses less than 1% of processor time when just monitoring for .TiVo transfers.

- Minimizes to system tray.

- File Folder in .vprj file created by Ad Scan is automatically modified if the scanned file was moved by TVAP (otherwise the .vprj file cannot be opened by VRD).

- For mpeg2 outputs, automatically generates a text metadata file that will automatically be used by pyTivo transcoding server (http://pyTivo.armooo.net) to attach metadata to files served back from pc to TiVo.

- For mpeg2, TS or dvr-ms outputs, if you place a batch file named TVAPpostProcess.bat or TVAPpostProcess.cmd in the final destination directory TVAP will run the batch file upon completion of VRD processing. The filename WITHOUT the extension and without the path is passed as the argument to this batch file. No configuration is necessary -- if the batch file is there it will be run.

- Integrated option to use ComSkip for commercial detection.

*HOW TO GET IT:*

VideoReDo has graciously allowed me to host the program on their FTP site. Point your browser to ftp://upload:[email protected]/VRD Add-Ons/TiVo-VideoReDo-AutoProcessor/

Click on the TVAP-readme.txt file to learn more, then click on the latest Windows installer file (setupTVAP###.exe) to download it -- the readme file will be installed in the installation folder.

Post here or PM me for questions or problems -- BUT please read the complete readme file first, particularly the "THINGS TO KNOW" section.!

I hope TVAP is of some use to you!


----------



## windracer

Sounds cool ... I'll have to try this out.


----------



## windracer

Seems to work as advertised ... if only I could make Ad-Detective more reliable!


----------



## dlfl

Two noticeable improvements (plus minor cleanup):

1. Minimizes to system tray icon. Click icon to minimize/restore program window.

2. Progress bar now active for file moves.

Readme file updated and added Change Log section at end.


----------



## dlfl

windracer said:


> Seems to work as advertised ... if only I could make Ad-Detective more reliable!


*Dan203* gave TVAP a quick trial and posted on the VideoReDo forum.

One of his comments was:



> 3) You should offer a way to actually launch VRD from the program so that people can adjust the Ad-Scan variables.


I've had almost no experience trying to tune Ad Detective. I usually let it run and do the cuts interactively. This can be done using the .vprj files automatically generated by TVAP Ad Scans.

Questions I have:
1. Do you agree with Dan203's suggestion?

2. If you adjust Ad Detective in VideoReDo separately (outside TVAP) can/will those settings carry over to when TVAP runs Ad Detective? (It must be either this or else default settings are used for silent operation, I think.)

3. What TVAP functionality for Ad Scan setting is most desirable? Does launching the complete VideoReDo interactive version from TVAP offer significant advantages compared to just running VRD the normal way?


----------



## windracer

Those are all good questions ... I don't know the answers.  

Traditionally I have stayed away from Ad-Detective because of its unreliability. It's usually faster for me to scan through a recording and remove the commercials manually instead of fixing Ad-Detective's marks.

I have not put a lot of effort into "tuning" it however. Plus, this is my first experience running it via command-line, so I have no idea if my settings through the GUI are used when your application invokes it.


----------



## dlfl

windracer said:


> Those are all good questions ... I don't know the answers.
> 
> Traditionally I have stayed away from Ad-Detective because of its unreliability. It's usually faster for me to scan through a recording and remove the commercials manually instead of fixing Ad-Detective's marks.
> 
> I have not put a lot of effort into "tuning" it however. Plus, this is my first experience running it via command-line, so I have no idea if my settings through the GUI are used when your application invokes it.


Poked around and found the Ad Detective settings are persistent across different files and different runs of VRD -- which makes sense because I was able to find them all in the Registry! So the settings are global and will be used when TVAP runs ad scans.

Thus it might make sense to be able to launch VRD in GUI mode from TVAP on whatever file is selected, tune or adjust the parameters, then return to automated TVAP operation. I'm guessing this is what Dan203 had in mind.

Of course then you have one-stop shopping via TVAP -- you could use this feature to preview the video and ????


----------



## dlfl

Added ability to launch full-GUI VRD from TVAP with selected .TiVo file loaded.
This allows user to do anything normally possible in VRD, but in particular the
Ad Detective settings can be tuned and adjusted and they then will be used in TVAP Ad Scan processing. (You can also preview the .TiVo file, load another file etc.) TVAP's state doesn't change and it waits for you to shut down VRD before
it will do any auto-processing. See the readme for more info.

WARNING: When I clicked on the ftp link in the first post (repeated here: ftp://upload:[email protected]/VRD Add-Ons/TiVo-VideoReDo-AutoProcessor/ ) I was startled to find it showing the wrong version of TVAP. I had to refresh my browser to get the correct version to show. Don't know what would happen if I tried to download the wrong version, since it actually wasn't there -- I had deleted it when I uploaded the newer version.


----------



## dlfl

No enhancements this time -- fixed a bug that occured if you configured moving .TiVo files to a destination folder.

Download: ftp://upload:[email protected]/VRD Add-Ons/TiVo-VideoReDo-AutoProcessor/


----------



## Dan203

Another suggestion.... Allow selection of output file type. One thing this program might be useful for, other then simply converting files to MPEG, is converting them to DVR-MS. You see in Windows MCE you can play .tivo files without decrypting them, but the FF and RW features are disabled. However if you use VRD to convert the .tivo files to DVR-MS first then they play with full trickplay capabilities. Heck if you wanted to get really fancy you could even use tivodecode to grab the metadata from the TiVo file and then apply it to the newly created DVR-MS, so it would be a seamless transfer from TiVo to MCE Now Playing. I actually considered writing something like this myself, but I just haven't had the time yet and it would actually fit into your program quite well.

Dan


----------



## NJ_HB

I am sure I speak on behalf of the other users who benefit from this when I say THANKS.
Well done. I hope your hard work does not go unnoticed.


----------



## dlfl

Now automatically corrects the folder location in a .vprj file created by Ad Scan without auto-cut. Explanation: If you have TVAP move the Ad Scan input file to another directory when completed, then the .vprj file is not correct and you can't open it in VRD -- UNLESS you change the folder location in the .vprj file (third line) to point to where you moved the input file -- which is what TVAP now does!

Download: ftp://upload:[email protected]/VRD Add-Ons/TiVo-VideoReDo-AutoProcessor/


----------



## dlfl

NJ_HB said:


> I am sure I speak on behalf of the other users who benefit from this when I say THANKS.
> Well done. I hope your hard work does not go unnoticed.


Well, you noticed it! Thanks!

I did this for my own use and decided to share it. However it ended up being a lot more than I originally planned. Just kept thinking of one feature or another that would be desirable.


----------



## dlfl

Dan203 said:


> Another suggestion.... Allow selection of output file type. One thing this program might be useful for, other then simply converting files to MPEG, is converting them to DVR-MS. You see in Windows MCE you can play .tivo files without decrypting them, but the FF and RW features are disabled. However if you use VRD to convert the .tivo files to DVR-MS first then they play with full trickplay capabilities. Heck if you wanted to get really fancy you could even use tivodecode to grab the metadata from the TiVo file and then apply it to the newly created DVR-MS, so it would be a seamless transfer from TiVo to MCE Now Playing. I actually considered writing something like this myself, but I just haven't had the time yet and it would actually fit into your program quite well.
> 
> Dan


I'm using the COM interface functions as documented in the VRD help. The FileSaveAsEx function documentation describes only three file types BUT I notice they align exactly with the first three output types in the VRD help:



> Program Stream (MPG) - A standard MPEG1 or MPEG2 program stream.
> 
> Elementary Stream (MPV) - A demultiplexed version of the output program. Separate audio and video files will be written.
> 
> DVD Stream (VOB) - These files are VOB formatted files suitable for input to the DVDAuthor utility. They cannot be used directly on a DVD. They will need to be processed by a DVD authoring utility.
> 
> Transport Stream (ts) - Industry compliant Transport Streams
> 
> DVR-MS (dvr-ms) - Microsoft Media Center files. Also known as MCE files.
> 
> Topfield REC (rec) - Topfield REC format. A transport stream file with a Topfield header
> 
> Tivo (tivo)- MPEG


Does this mean I can use 5 and get DVR-MS ? This would be a simple mod I think. Probably would add another "Destination" folder to which DVR-MS could be moved.

I wonder how complicated the tivodecode thing would be? I've heard of it but haven't done anything with it. Need to search forums I guess. What form is meta-data coming out of tivodecode and going into VRD (for DVR-MS)? Text? XML? Helpful hints are welcome!


----------



## Dan203

dlfl said:


> I'm using the COM interface functions as documented in the VRD help. The FileSaveAsEx function documentation describes only three file types BUT I notice they align exactly with the first three output types in the VRD help:


It is support, but it's not 5. Here is the list...

1 = MPEG Program Stream
2 = MPEG Elelmentry Streams
3 = MPEG Program Stream w/NAV Packets
4 = MPEG Transport Stream
5 = Topfield .rec file
6 = DVR-MS file
7 = .tivo file
8 = DVD Folder
9 = DVD ISO

The last 2 wont actually be supported until the DVD portion of TVSuite is released, but I added them anyway just for future reference.



dlfl said:


> I wonder how complicated the tivodecode thing would be? I've heard of it but haven't done anything with it. Need to search forums I guess. What form is meta-data coming out of tivodecode and going into VRD (for DVR-MS)? Text? XML? Helpful hints are welcome!


I've played around with tivodecode a bit. It's not the easiest code to work with, as it's all in standard C, but I managed to get it to output the TiVo metadata, which is XML, to an MFC CString object. From that point you could feed it into the MSXML parser and pull whatever data you wanted from it. To add the metadata to the DVR-MS file you would use a COM object called IWMMetadataEditor and it's IWMHeaderInfo interface. There is a great article about this out there called "Fun with DVR-MS" if you're really interested.

Dan


----------



## dlfl

Thanks Dan,

I plan to add the dvr-ms output option and will look into the metadata thing.


----------



## Dan203

What language are you using for this? If it's MFC C++ then I can help you out. If it's something else I might still be able to help you out, but it might have to wait until I have some free time.

Dan


----------



## dlfl

Dan203 said:


> What language are you using for this? If it's MFC C++ then I can help you out. If it's something else I might still be able to help you out, but it might have to wait until I have some free time.
> 
> Dan


I'm using M$ VS2005 C# (.NET). I found some Toub (the "Fun with ... " guy) stuff on editing dvr-ms metadata and it already appears to be written in that. Haven't looked at the TivoDecode stuff yet.

I don't know if there's a way to link a MFC-based module into C# .NET code. Will check the help.


----------



## Dan203

I might be able to port my code over to an ActiveX control. If I get some free time I'll give that a shot.

Dan


----------



## dlfl

Dan203 said:


> I might be able to port my code over to an ActiveX control. If I get some free time I'll give that a shot.
> 
> Dan


That sounds promising!


----------



## dlfl

Dan,

I've modified TVAP to output dvr-ms files but I'm seeing a strange problem:

If I do:

TiVo -> QSF -> dvr-ms
(or)
TiVo->AdScan w/ autocuts->dvr-ms

the output files seem OK.

However if I do

TiVo->QSF->dvr-ms->AdScan w/autocuts->dvr-ms

The output file is bad -- over twice the size it should be, won't open in WMP11, and won't play when opened in VRD.

Is this known behavior? I can work around it by just forcing the intermediate file (the QSF'ed one) to be mpeg instead of dvr-ms when doing both QSF and AdScan. The output file seems OK then.

I've only tested with one 40 MB tivo for which AdScan doesn't define any cuts. That untypical file could be triggering odd behavior I suppose.


----------



## Dan203

Try the same steps with VRD manually. If they still happen then report them over on the VRD forum. (these things are DanR's area not mine)

Dan


----------



## dlfl

TVAP will now output DVR-MS files. MetaData transfer is still on the TO DO list.

The problem with QSF+AdScan w/ AutoCut for DVR-MS output was resolved.


----------



## dlfl

I got the Toub dvr-ms class library connected to TVAP and displayed the 32 metadata items it found in a .dvr-ms created from a .tivo with VRD -- see the attached image.

Titlle and description aren't there -- I assume this is what we want to get from TivoDecode and add in with the Toub library (?). What else?

I wonder if adding metadata requires a re-write of the whole file? In other words does the added metadata make the file longer or does it already have space allocated for metadata growth?


----------



## Dan203

Editing metadata in a DVR-MS file is simple. There is a COM interface you use to open the file, then you just set the various values. Getting the values from a .tivo file is a little trickier, but the latest version of tivodecode has this functionality. The cLI version of tivodecode has it implemented in such a way that it simply dumps the XML data from the .tivo file to disk. I rewrote the code in an MFC app and pulled the XML into a simple CString. When I get time I'll try to port that over to, at the very least, a simple ActiveX control that allows you to call a a function with the .tivo file path and get a BSTR with the XML in return. From there you can feed the XML into MSXML, parse the data you want, and copy it into the DVR-MS file.

If I have enough time I'll try to do all the heavy lifting and write a function that allows you to feed it the path of the .tivo file and the DVR-MS and the ActiveX will do all the work of copying over the data. I'm a little busy this week, and I'm going out of town this weekend, so it'll probably be next week before I have time to actually do any of this. Stay tuned.

Dan


----------



## dlfl

Dan203 said:


> Editing metadata in a DVR-MS file is simple. There is a COM interface you use to open the file, then you just set the various values. Getting the values from a .tivo file is a little trickier, but the latest version of tivodecode has this functionality. The cLI version of tivodecode has it implemented in such a way that it simply dumps the XML data from the .tivo file to disk. I rewrote the code in an MFC app and pulled the XML into a simple CString. When I get time I'll try to port that over to, at the very least, a simple ActiveX control that allows you to call a a function with the .tivo file path and get a BSTR with the XML in return. From there you can feed the XML into MSXML, parse the data you want, and copy it into the DVR-MS file.
> 
> If I have enough time I'll try to do all the heavy lifting and write a function that allows you to feed it the path of the .tivo file and the DVR-MS and the ActiveX will do all the work of copying over the data. I'm a little busy this week, and I'm going out of town this weekend, so it'll probably be next week before I have time to actually do any of this. Stay tuned.
> 
> Dan


Thanks, Dan

Yes, the Toub DVR-MS class library (managed .NET dll assembly) provides a wrapper for the COM interface. I've got the processes of reading metadata, adding more metadata and writing it back to the file going fine using this library. Happy to see it doesn't change file size and is very fast because it doesn't have to re-write the entire file (tested on 1 GB+ file).

All I'm missing now is getting the metadata from the .TiVo file.


----------



## Dan203

Here is the ActiveX control I promised....

http://www.3wdesigns.net/TiVoMetaDecode.zip

I didn't have a lot of time to add all the fancy XML parsing, so you'll have to do that yourself. This ActiveX control has two functions GetMetaData and GetMetaData2, both of which take a single parameter which is the path to the TiVo file. The reason there are two is because each TiVo file has two chunks of meta data. The second, accessed via the 2 function, has a little more data in it but I'm not sure if it's necessary for what you're doing or not.

Anyway let me know if you have any trouble with it.

Dan


----------



## dlfl

Dan203 said:


> Here is the ActiveX control I promised....
> 
> http://www.3wdesigns.net/TiVoMetaDecode.zip
> 
> I didn't have a lot of time to add all the fancy XML parsing, so you'll have to do that yourself. This ActiveX control has two functions GetMetaData and GetMetaData2, both of which take a single parameter which is the path to the TiVo file. The reason there are two is because each TiVo file has two chunks of meta data. The second, accessed via the 2 function, has a little more data in it but I'm not sure if it's necessary for what you're doing or not.
> 
> Anyway let me know if you have any trouble with it.
> 
> Dan


Thanks Dan!

I got it hooked into my C# program and it seems to work. However the string returned doesn't make sense, at least put into the standard C# string type which is 16-bit unicode. I tried to assign the function return to a byte array but it won't compile because the functions definitely return type "string". I suspect I need to convert to UTF-8 or something like that. What can you tell me about the structure of the returned strings, i.e., one byte per character or ?

When interpreted as 16bit unicode it looks like hieroglyphics! I think if I know the actual encoding type it will be easy to re-encode it. Then I can get on with the XML parsing.


----------



## Dan203

It's a multi-byte string, not unicode. Try using the multiByteToWideChar function if you need to convert it to unicode.

Dan


----------



## dlfl

Dan203 said:


> It's a multi-byte string, not unicode. Try using the multiByteToWideChar function if you need to convert it to unicode.
> 
> Dan


Well, I've spent several hours trying to "crack" this string (i.e., get something that looks like xml). 
The multiByteToWideChar function exists only in C++ land but I've tried all kinds of combinations of UTF encoders and decoders. No matter what I do I see almost all byte values are either greater than 127 or 0, i.e., outside the normal ASCII range.

The string object returned is only 336 unicode chars long while the xml chunk for the same .tivo file produced by TivoDecode is about 7kb. I don't see how that much info could be in such a small string (??).

The prototype for the ocx functions as imported by C# says they return "string" type objects which are unicode by definition.


----------



## Dan203

I don't know how C# works, but in C++ you have the option of compiling the entire project as either multi-byte or unicode. Do you have such an option? If so try turning it over to multi-byte mode and see what happens.

Other then that I'm stumped. I tested it in the MS ActiveX test container and it properly grabs the XML string, so something is happening when you're pulling it into your C# project.

Dan


----------



## dlfl

Dan,

Any chance you could do a version of your .ocx that returns UniCode strings? I've searched a lot and can't find anything to help here.


----------



## Dan203

Crap I know what's wrong! It has nothing to do with unicode/multi-byte. I have my MAK hard coded into the ocx. Your MAK obviously doesn't match, so you're getting a trashed response. I'm fixing it now and will post a new version in a few minutes.

Dan


----------



## Dan203

OK I uploaded a new version. This one now takes two arguments for each function. The file path and the MAK.

Dan


----------



## dlfl

Hmmm... I wiped the first .ocx from my system (unregistered it) and removed it from my C# project, then put in the new version making sure it was the only .ocx of that name. Registered it and hooked to my program -- all went as before. 

Only problem is the functions still only take one argument (??). This shows in the prototypes that automatically show up as "hints" and they will only compile if I just pass one string argument.

I downloaded from the same link you gave before. Also did a binary file comparison of the two .ocx versions and they are different.


----------



## Dan203

There may be something in your C# project. In C++ when you import an ActiveX control it creates a header file with prototype functions for what's in the control. From then on if you make any changes to the ActiveX control you have to remove all references to it and delete the header file before it will recreate it with the new prototype functions.

Alternative you can simply find the prototype functions and update them manually. The structure of the functions are exactly the same except they now take one more string argument.

Dan


----------



## dlfl

Dan203 said:


> There may be something in your C# project. In C++ when you import an ActiveX control it creates a header file with prototype functions for what's in the control. From then on if you make any changes to the ActiveX control you have to remove all references to it and delete the header file before it will recreate it with the new prototype functions.
> 
> Alternative you can simply find the prototype functions and update them manually. The structure of the functions are exactly the same except they now take one more string argument.
> 
> Dan


You are correct -- I created a new test C# project on another computer and hooked in your control -- and the prototypes are correct now. So there is something from the old .ocx still stuck in my project even though I hunted down everything I could think of and removed it.

I removed the control from the new test project and I notice there are still two .dll files with "TivoMetaDecode" as part of their names and a file named "<project name>.csproj.ResolveComReference.cache" in the bin\debug directory. I assume C# created these automatically because I know they didn't come from your download and I know I didn't create them. I suspect these must be deleted before hooking in the new .ocx version. No suspicious header files are to be found but I think C# just stores the info a different way.

It will be a few hours before I can apply this knowledge to the TVAP project since I'm at a different location at the moment.


----------



## dlfl

Dan, your TivoMetaData component works great! I have all the pieces demonstrated now to get metadata from TiVo files and put it in DVR-MS files.

I'm planning on the items discussed in the VRD help for the panel on "MCE/DVR-MS Output". If you or anyone else has any suggestions on what other items should be included, just let me know.

I'll also need to have the program ask for the MAK upon initial startup then save it in its XML configuration file. (I don't see the MAK in the registry anywhere -- if anyone knows where to get it let me know.)

Thanks!


----------



## Dan203

The MAK in the registry is encrypted, so you'll need to collect it yourself.

I'm glad it's working out. I look forward to trying it out once you get it working. 

Dan


----------



## dlfl

Two major enhancements:

1. Reads metadata from TiVo files. (Title, Subtitle, Description, Genre and Recording Time/Date for now.) You can see it by right-clicking on a file name and it is automatically inserted into DVR-MS output files.

2. Comes in a Windows installer package now.

Thanks to Dan203 for the ActiveX component (TivoMetaDecode.ocx) that reads the metadata from the TiVo files.

Note: The metadata is read when the tivo file is initially detected by TVAP and is stored in its XML file. This means the XML format changed and your previous XML files will be invalid so TVAP will force a cold startup where you have to set your default options and destination directories. It will also ask you to enter your MAK since that is needed to read the TiVo metadata. (See readme for more details.)
The MAK is also stored in the XML file which is another reason your current XML file is invalid and a cold start is needed (sorry!)

ftp://upload:[email protected]/VRD Add-Ons/TiVo-VideoReDo-AutoProcessor/


----------



## Dan203

FYI if you will be using this on Windows Vista and you have UAC enabled then you will need to run TVAP as an administrator or output as DVR-MS will fail.

Dan


----------



## FrooBrar

I just committed a new module to tivodecode CVS called tivocom, which so far just provides access to file metadata, and also to get and set the MAK in the registry that Tivo Desktop uses. It is not based on Dan203's code at all, it is written in ATL instead of MFC, and has what I hope is a powerful, fairly well thought out interface which does not hide any available data from the consumer of the interfaces.

Please let me know what you think of it. You will need to check out both tivodecode and tivocom, and open the .sln in Visual Studio 2005 (express will not work for ATL, but then it would not have worked for MFC either).

CVS instructions are available at the following URL in case you are not familiar with it: 
http://sourceforge.net/cvs/?group_id=183716

I could also put a binary up somewhere if you would prefer.


----------



## dlfl

Dan203 said:


> FYI if you will be using this on Windows Vista and you have UAC enabled then you will need to run TVAP as an administrator or output as DVR-MS will fail.
> 
> Dan


So Dan, do I correctly infer from this that it does run on Vista, at least for you?

(That would be good news to me. As I state in the readme, I don't run Vista, so can't test on that OS.)


----------



## dlfl

FrooBrar said:


> I just committed a new module to tivodecode CVS called tivocom, which so far just provides access to file metadata, and also to get and set the MAK in the registry that Tivo Desktop uses. It is not based on Dan203's code at all, it is written in ATL instead of MFC, and has what I hope is a powerful, fairly well thought out interface which does not hide any available data from the consumer of the interfaces.
> 
> Please let me know what you think of it. You will need to check out both tivodecode and tivocom, and open the .sln in Visual Studio 2005 (express will not work for ATL, but then it would not have worked for MFC either).
> 
> CVS instructions are available at the following URL in case you are not familiar with it:
> http://sourceforge.net/cvs/?group_id=183716
> 
> I could also put a binary up somewhere if you would prefer.


First, thanks for your TiVoDecode efforts!

This is very interesting -- I will look at it. I have built the TiVoDecode 0.2Pre3 .sln in VS2005 and actually fixed a small bug that was preventing it from reading the MAK file (a '\' vs. '/' problem in the file path).

It would be nice to improve 3 aspects in TVAP over what is involved in using the Dan203 ActiveX control:

1. I have to parse the xml string (not really a big deal).
2. I have to deploy and install 2.6MB of VS2005 C++ CRT as part of my installation package.
3. User has to enter MAK.

I'm wondering about the deployment dependencies of your module. From the VS2005 help it appears there are options that vary from no dependency on the CRT runtime to complete dependency.

You might want to update the link to the CRT redistributable in your TivoDecode web page to point to the VS2005 SP1 version. The .ocx from Dan203 will not register with the older version you link to (which has exactly the same file name just to keep things confusing). This kind of hassle is another reason for wanting to eliminate that dependency.

It would be interesting to see if a binary of your module can be linked into my C# program in the normal (very easy) way that COM objects are handled.


----------



## Dan203

dlfl said:


> So Dan, do I correctly infer from this that it does run on Vista, at least for you?
> 
> (That would be good news to me. As I state in the readme, I don't run Vista, so can't test on that OS.)


Yeah it seems to work fine on Vista, except that VRD has to be run in admin mode for DVR-MS output to work. And since you're using COM, that means VRD inherits the permissions of your program, which means you have to run TVAP in admin mode for the DVR-MS output mode to work through that.

One small complaint... The minimize button in the dialog doesn't work. You shoulw reenable it, catch the event it produces and use that to invoke your minimize to tray function. That is common design for an app that minimizes to the tray.

Dan


----------



## Dan203

FrooBrar said:


> I just committed a new module to tivodecode CVS called tivocom, which so far just provides access to file metadata, and also to get and set the MAK in the registry that Tivo Desktop uses. It is not based on Dan203's code at all, it is written in ATL instead of MFC, and has what I hope is a powerful, fairly well thought out interface which does not hide any available data from the consumer of the interfaces.
> 
> Please let me know what you think of it. You will need to check out both tivodecode and tivocom, and open the .sln in Visual Studio 2005 (express will not work for ATL, but then it would not have worked for MFC either).
> 
> CVS instructions are available at the following URL in case you are not familiar with it:
> http://sourceforge.net/cvs/?group_id=183716
> 
> I could also put a binary up somewhere if you would prefer.


Very cool! My control was very quickly hacked together based on some MFC source I used to test the XML output capabilities of tivodecode a few months back. I didn't have a lot of time to put into it, so I just threw something together. This will be a nice addition to the project as it will allow better expansion when future additions are made to tivodecode. (like the ability to save modified XML back to the file )

Dan


----------



## dlfl

Dan203 said:


> Yeah it seems to work fine on Vista, except that VRD has to be run in admin mode for DVR-MS output to work. And since you're using COM, that means VRD inherits the permissions of your program, which means you have to run TVAP in admin mode for the DVR-MS output mode to work through that.
> 
> One small complaint... The minimize button in the dialog doesn't work. You shoulw reenable it, catch the event it produces and use that to invoke your minimize to tray function. That is common design for an app that minimizes to the tray.
> 
> Dan


Maybe I could have TVAP detect whether it's in admin mode and disable the DVR_MS output choice with a message to the user. (?)

Your "small complaint" refers to the MAK dialog staying up if the program is minimized, correct? (Never thought to test that.) BTW that "dialog" is actually a custom designed form -- I could find no ready-made dialog for text entry in C#, which amazes me since Borland Builder C++ had such things long ago!

Thanks,
Dave


----------



## Dan203

No. I'm talking about the main dialog. At least in Vista the minimize button does not work at all. It doesn't even highlight. It's like it's disabled.

Dan


----------



## FrooBrar

dlfl said:


> This is very interesting -- I will look at it. I have built the TiVoDecode 0.2Pre3 .sln in VS2005 and actually fixed a small bug that was preventing it from reading the MAK file (a '\' vs. '/' problem in the file path).


Please let me know what exactly you needed to change so I can fix it for the next version.



dlfl said:


> It would be nice to improve 3 aspects in TVAP over what is involved in using the Dan203 ActiveX control:
> 
> 1. I have to parse the xml string (not really a big deal).


I have no plans to do anything about this. I consider it beyond the scope of the tivodecode project



dlfl said:


> 2. I have to deploy and install 2.6MB of VS2005 C++ CRT as part of my installation package.


I have removed this requirement in current CVS.



dlfl said:


> 3. User has to enter MAK.


The COM interface I have made allows both getting and setting the MAK that TiVo Desktop uses in the registry (it's in HKEY_CURRENT_USER, so per-user).

Use the mak property on the TivoDecode object to get and set this MAK.

You can call the OpenTivoFile method on the TivoDecode object to get an object which implements ITivoFile, which has a mak property you can set to override the TiVo Desktop mak if you want to use a different mak, or if one is not set in the registry. Make sure to set this BEFORE getting the chunks property from the ITivoFile interface.



dlfl said:


> I'm wondering about the deployment dependencies of your module. From the VS2005 help it appears there are options that vary from no dependency on the CRT runtime to complete dependency.


I have switched the projects in CVS to use static linking of CRT, so there should be no more dependency beyond standard Windows DLLs. The tivocom project is also statically linked both with CRT and ATL, so no additional dependencies there.



dlfl said:


> You might want to update the link to the CRT redistributable in your TivoDecode web page to point to the VS2005 SP1 version.


Done.



dlfl said:


> The .ocx from Dan203 will not register with the older version you link to (which has exactly the same file name just to keep things confusing). This kind of hassle is another reason for wanting to eliminate that dependency.


Got to love Microsoft...



dlfl said:


> It would be interesting to see if a binary of your module can be linked into my C# program in the normal (very easy) way that COM objects are handled.


I don't see why it would not.

I put a binary up temporarily at http://tivodecode.sourceforge.net/tivocom/tivocom.zip for you to try. I also included the .PDB file in case you have any crashes, you can get a helpful stack trace from the debugger for me at least


----------



## dlfl

I've been experimenting with your binary with mostly good results. No problem importing it into C# with an automatically produced Interop wrapper DLL. The first thing I did was create a TivoDecodeClass object and attempt to get the MAK. This threw an "Invalid Data" exception and the MAK was null. However I found I could set the MAK with that object and after that all was OK. After setting it once:

1. I could get it.
2. I could get the chunks.
3. I could unregister then reregister tivocom.dll and it was still OK. (I could get the MAK without setting it first.)
4. I could shut down the program and restart and it still could get the MAK.

I found exactly the same behavior on another computer that doesn't have the VS2005 on it. I haven't looked at your code yet but I wonder how it's getting the MAK after setting it once whereas it couldn't get it the first time? I've looked at everything with "tivocom" in it in the registry and find nothing resembling a MAK, either plain text or encoded.

Could it be that something in the encryption stuff gets properly initialized when I set the MAK so that it then works OK after that?

On the MAK file thing, the change I made was near the top of tivodecode.c:



Code:


static const char MAK_DOTFILE_NAME[] = "\\tivodecode_mak";

The two backslashes replace '/.' . I determined this by tracing.

Sure would love to have it get the MAK so the user wouldn't have to enter it in TVAP! Any ideas?


----------



## FrooBrar

dlfl said:


> The first thing I did was create a TivoDecodeClass object and attempt to get the MAK. This threw an "Invalid Data" exception and the MAK was null. However I found I could set the MAK with that object and after that all was OK. I haven't looked at your code yet but I wonder how it's getting the MAK after setting it once whereas it couldn't get it the first time? I've looked at everything with "tivocom" in it in the registry and find nothing resembling a MAK, either plain text or encoded.


The MAK is stored in the same place/way as TiVo Desktop does it. The specific registry location is HKEY_CURRENT_USER\Software\TiVo\SharingKeys, and the value which it reads should be type REG_BINARY named "TiVoToGo Media". I have only tested this against TiVo Desktop version 2.2 (yes, I know, old), please check what this key looks like when you get the Invalid data exception and let me know. If I had to bet, TiVo changed how they stored the MAK in the registry, or at least the value type, as the ATL registry access wrappers will throw an invalid data error (or something like that) if the reg value does not match what I asked for.



dlfl said:


> On the MAK file thing, the change I made was near the top of tivodecode.c:
> 
> 
> 
> Code:
> 
> 
> static const char MAK_DOTFILE_NAME[] = "\\tivodecode_mak";
> 
> The two backslashes replace '/.' . I determined this by tracing.


I will look into this. This will not work as-is as it will break *NIX.


----------



## dlfl

FrooBrar said:


> The MAK is stored in the same place/way as TiVo Desktop does it. The specific registry location is HKEY_CURRENT_USER\Software\TiVo\SharingKeys, and the value which it reads should be type REG_BINARY named "TiVoToGo Media". I have only tested this against TiVo Desktop version 2.2 (yes, I know, old), please check what this key looks like when you get the Invalid data exception and let me know. If I had to bet, TiVo changed how they stored the MAK in the registry, or at least the value type, as the ATL registry access wrappers will throw an invalid data error (or something like that) if the reg value does not match what I asked for.
> .............


I'll take a closer look at this (don't have access to the computers at the moment).
I've found the binary keys where you say they are -- can't swear to the exact registry key name. However I've done things like use your object to set the MAK to an invalid value and have seen the registry values change and WMP would then no longer play the .tivo files (until I used your object to set the MAK back correctly). I note there are TWO seemingly identical binary keys in that part of the registry (can't remember their exact names without looking but I think one has "media" in the name and the other has "tivoToGo"). I wonder if that is a difference from 2.2 ?

One possible hitch in further testing is that once I set the MAK correctly via your object, the problem cannot be duplicated on that computer (even if you unregister/reregister tivocom.dll and/or restart my program). It suggests that tivocom is storing this number some other non-volatile place, e.g., in the registry, that survives through unregistration (?).

Another thought is the MAK encryption has changed for the later versions of Desktop (I'm using 2.3 BTW) but they are still backwards compatible with the older encryptions (?). (Thus when the MAK is set via your object the binary value actually changes but can still be decoded by the TiVo software.) A way to test this would be to re-enter the MAK in desktop then see if the "get" problem reappears for tivocom.

All in all I'm encouraged that this seems to be the only hitch in using your binary!
I haven't tested it for dependency on the VS80CRT runtime but from what you say there shouldn't be any.


----------



## Dan203

The MAK is still stored under HKEY_CURRENT_USER\Software\TiVo\SharingKeys. Perhaps just the key name has changed? In 2.5 they are labeled...

TiVoToGo Media
TiVoToGo Metadata

If that's not it then it's possible TiVo changed how the key is stored. I know somewhere around here someone mentioned that they were encrypted and required some sort of built in Windows encryption service to be running to properly store and retrieve the key. This change may have come about when TiVo moved away from the password system.

Dan


----------



## dlfl

Dan203 said:


> The MAK is still stored under HKEY_CURRENT_USER\Software\TiVo\SharingKeys. Perhaps just the key name has changed? In 2.5 they are labeled...
> 
> TiVoToGo Media
> TiVoToGo Metadata
> 
> .........
> Dan


The key names are the same in Ver. 2.3 . I pm'ed you guys with some interesting info about this behavior, including registry dumps of the keys, and my MAK. The binary keys are different depending on whether set in DeskTop or by the TiVoCom dll.


----------



## FrooBrar

Dan203 said:


> The MAK is still stored under HKEY_CURRENT_USER\Software\TiVo\SharingKeys. Perhaps just the key name has changed? In 2.5 they are labeled...
> 
> TiVoToGo Media
> TiVoToGo Metadata
> 
> If that's not it then it's possible TiVo changed how the key is stored.


I bet they changed the entropy parameter to the CryptProtectData function



> I know somewhere around here someone mentioned that they were encrypted and required some sort of built in Windows encryption service to be running to properly store and retrieve the key.


Yep, CryptProtectData and CryptUnprotectData. See MSDN for details on these functions.



Dan203 said:


> This change may have come about when TiVo moved away from the password system.


Nope, the version of the TiVo Desktop I have doesn't have the password.

I guess it is time to download 2.5 and step through the setting of the MAK again...


----------



## FrooBrar

FrooBrar said:


> I bet they changed the entropy parameter to the CryptProtectData function
> 
> I guess it is time to download 2.5 and step through the setting of the MAK again...


I downloaded 2.5 and set a breakpoint on CryptProtectData, and that's exactly what they did. They changed the entropy for the Media key to match the Metadata key. I am guessing that when they had a password, they used that as the entropy. When they first removed the password dialog, they just hacked it out and set the entropy to the empty string (ie, empty password). Then, they noticed that and decided that wasn't such a good idea, when they already had a seperate entropy value they were using for the Metadata key, so they started using that instead, falling back to the old format when reading in case someone upgraded from an older version of TiVo Desktop without resetting their MAK.

I just uploaded a new version of the DLL (same url as before) which tries to read the new format first, then falls back to the old format on the INVALID_DATA error. The setting of the MAK still uses the old format, as both old and new TiVo Desktop versions support this format, while only new versions would support the new format.

Please try it out and let me know how it works for you.


----------



## dlfl

FrooBrar said:


> ........
> I just uploaded a new version of the DLL (same url as before) which tries to read the new format first, then falls back to the old format on the INVALID_DATA error. The setting of the MAK still uses the old format, as both old and new TiVo Desktop versions support this format, while only new versions would support the new format.
> 
> Please try it out and let me know how it works for you.


Thanks, this seems to work perfectly. Can get or set MAK as desired.

I discovered the encrypted MAK in the registry varies each time you set it via DeskTop. A (random) time value must be used as part of the encryption key (?).


----------



## dlfl

Dan203 said:


> Yeah it seems to work fine on Vista, except that VRD has to be run in admin mode for DVR-MS output to work. And since you're using COM, that means VRD inherits the permissions of your program, which means you have to run TVAP in admin mode for the DVR-MS output mode to work through that.
> 
> One small complaint... The minimize button in the dialog doesn't work. You shoulw reenable it, catch the event it produces and use that to invoke your minimize to tray function. That is common design for an app that minimizes to the tray.
> 
> Dan


The minimize button will be fixed in the next version.

Regarding Vista permissions, it looks like it's possible to detect the user access level and also to prompt the user to "elevate" TVAP and its child processes to Admin on Vista. (Apparently Vista by default doesn't assign admin privileges to the program even when launched by an admin user, correct?)

The "elevation prompt" feature requires embedding a manifest in the program but that doesn't look too difficult. In either case DVR-MS functions will have to be turned off if the admin privileges aren't present or obtained via elevation.

Comments? Suggestions?


----------



## dlfl

Can someone running Vista *with admin privileges and with UAC enabled * (the default I believe) run the attached test program and let me know what happens?

What should happen is a Windows prompt should appear saying an unknown program wants to run and the choices are "allow" or "cancel". If you allow it to run a little window should say "Running with admin privileges". If you cancel I assume it just doesn't run the program.

If the program does run but doesn't acquire admin privileges the window will say "No admin privileges !"

Also, if someone has a PC running XP and can run this from an account that *doesn't* have admin privileges I would appreciate knowing what that does too.

Thanks!


----------



## FrooBrar

dlfl said:


> Can someone running Vista *with admin privileges and with UAC enabled * (the default I believe) run the attached test program and let me know what happens?


The attached images... If you cancel the UAC prompt, then the program does not run.


----------



## dlfl

FrooBrar said:


> The attached images... If you cancel the UAC prompt, then the program does not run.


Thanks FrooBrar -- results were exactly as expected.

Now I'm wondering about Vista deployment. Have you or anyone installed TVAP 0.36 (with the Inno Setup installer) on Vista? I would expect problems due to UAC, trust etc. unless you can get around all that by disabling UAC (?).

If the Inno installer is a problem for Vista, and there isn't an acceptable work-around (e.g., disabling UAC for the install?) then a Dev Studio deployment project may be the answer. Using an installer (instead of a zip file) has the advantages that the TiVo metadata COM object can be automatically registered and a shortcut created. But if the security issues are too difficult perhaps the zip approach could be used for Vista with a batch file the user would have to run to register the COM.

I welcome any suggestions or comments.


----------



## FrooBrar

dlfl said:


> Thanks FrooBrar -- results were exactly as expected.
> 
> Now I'm wondering about Vista deployment. Have you or anyone installed TVAP 0.36 (with the Inno Setup installer) on Vista? I would expect problems due to UAC, trust etc. unless you can get around all that by disabling UAC (?).


I have not tried it. However, I do have some experience deploying installers for Vista (in my real life). As long as one or more of the following is true, you should be fine:
1. The installer executable is manifested with the require administrator property.
2. The installer is something that the Vista heuristics can identify as an installer. The easiest way to be sure of this is to put the word "installer" or "setup" in the name of the executable.

If this is true, Vista will require elevation to run the executable.

Also, since it seems your main app only needs admin rights for one aspect of its operation, you may want to look into the COM elevation moniker, to elevate only the interface which requires it and not the whole app. Google for COM elevation moniker, or at least look at http://msdn2.microsoft.com/en-us/library/ms679687.aspx which details it. However, I do not know how to do it from anything other than C/C++, so this may not be an option for you. Something to think about, though.


----------



## FrooBrar

Also, note that the Tivo Desktop MAK is stored in HKEY_CURRENT_USER, so it's anybody's guess what will happen in an OTS elevation scenario.


----------



## dlfl

FrooBrar said:


> Also, note that the Tivo Desktop MAK is stored in HKEY_CURRENT_USER, so it's anybody's guess what will happen in an OTS elevation scenario.


If I can impose on you a little further, please test the attached modified version of TestUAC. (The included Interop dll must be placed in the path also, and your latest tivocom.dll must be registered.)

If you "allow" it to run, it should display your MAK in a message box then bring up a file browser to select a .tivo file. If you select one a huge message box will display unformatted chunk data. Or you can just cancel the file browser. Then the form will be there with the same text display options as for the previous version.

If this works it would seem to indicate that access to the MAK is OK in the elevation scenario. Or is the potential problem going to exist only if the current user is different from the one who installed the MAK ?

Thanks


----------



## FrooBrar

dlfl said:


> If this works it would seem to indicate that access to the MAK is OK in the elevation scenario. Or is the potential problem going to exist only if the current user is different from the one who installed the MAK ?


There will always be a "problem" if the current user is different from the one who installed the MAK, as the MAK is a per-user setting.

The problem I was thinking of, is in the case of "over-the-shoulder" (OTS) elevation, where the user who is logged in is not an administrator, and when they try to run an app which requires admin privileges, they are prompted for credentials of an admin user. I am not sure whose HKEY_CURRENT_USER is used for an app launched in this way: the user currently logged on, or the admin whose credentials were used to elevate.


----------



## FrooBrar

dlfl said:


> If I can impose on you a little further, please test the attached modified version of TestUAC. (The included Interop dll must be placed in the path also, and your latest tivocom.dll must be registered.)
> 
> If you "allow" it to run, it should display your MAK in a message box then bring up a file browser to select a .tivo file.


It worked as advertised for an admin user, the elevation prompt, then the message box with the mak and the file browser. I canceled the file browser because I did not have a TiVo file handy...

However, I tested it with a limited user and an admin user using OTS elevation. The admin user was freshly created and did not have a MAK set. I set the MAK for the limited user using PowerShell, which you can see in the background in the attached image, and then tried to run the TestUAC2 app. It required elevation, made me enter the credentials of the admin user, and then gave me the error you see in the foreground. I return a not found error from getting the MAK if it is not set in the registry, which is apparently being translated into a System.IO.FileNotFoundException in C#. May be a good idea to catch those...

Anyway, this confirms that the HKEY_CURRENT_USER key used for OTS elevation is the admin whose credentials are used, not the user who tried to run the app. So the MAK would need to be set for the admin, and it would not matter what the limited user had set for their registry.


----------



## dlfl

First, many thanks to FrooBrar and Dan203 for their Vista testing and coding the TiVo metadata retrieval stuff.

The Vista install/run security and user privilege stuff is pretty complicated as you can see from the two previous posts by FrooBrar -- I'm not guaranteeing when if ever TVAP will install and run seamlessly on Vista. However I've made some small steps in that direction to the extent that an admin user on Vista should be able to "elevate" TVAP to run with admin privileges, which hopefully will enable it to output DVR-MS.

19 August 2007 Ver. 0.37

- TiVo Metadata now obtained using FrooBrar's tivocom.dll COM object. Visual Studio C++
Runtime libraries (2.6MB) no longer included in installer. User no longer has to
enter MAK, which is obtained and decoded from the Windows Registry.

- Minimize button is active and minimizes to system tray icon. (Clicking tray icon still minimizes too.)

- Embedded manifest so when run on Vista user is prompted to elevate privileges to admin.

- Detects whether running with admin privileges and disables DVR-MS output if not.
User is given appropriate message.

I've left the ver. 0.36 installer on the VideoReDo host site just in case ... a lot of big changes were made in 0.37 !

ftp://upload:[email protected]/VRD Add-Ons/TiVo-VideoReDo-AutoProcessor/


----------



## dlfl

Small bug fix: If you had enough files displayed to invoke the scroll bar the right click for metadata would select the wrong file.


----------



## tbuskey

Is this the right place to ask?

1st: great program. I finally have a fairly automated way to transfer shows from my TiVo, strip commercials and store them on my file server. I use pyTivo (gets around the subfolder bug) to let the TiVo pull them back for viewing. My server is Solaris and pyTivo is on there too. I have TiVo Desktop & VideoReDo running in VMware on Linux. If I can get everything running on Solaris or even Linux w/o VMware. Oh well.

I like to keep my files as .Tivo with the metadata. Can TVAP save as .tivo instead of .mpg?

Can TVAP remove the original .TiVo file when it finishes?

Anything to save keystrokes!


----------



## dlfl

tbuskey said:


> .......
> I like to keep my files as .Tivo with the metadata. Can TVAP save as .tivo instead of .mpg?
> 
> Can TVAP remove the original .TiVo file when it finishes?
> 
> Anything to save keystrokes!


TVAP doesn't delete the original .tivo. If you set a destination folder for .tivo files TVAP will move the .tivo files to that folder when done. (If you don't specify any VRD processing then TVAP will do nothing but move the .tivo's to that folder.) But this will be the original (unprocessed by VRD) tivo file.

Do you want to have VRD process the .tivo then save it as a .tivo?

Both deletion and .tivo saves could be considered for addition to TVAP. It would be much easier to program if the processed .tivo files would always be required to be put in a destination folder different from the tivo transfer folder. Would that serve your purposes?


----------



## tbuskey

dlfl said:


> TVAP doesn't delete the original .tivo. If you set a destination folder for .tivo files TVAP will move the .tivo files to that folder when done. (If you don't specify any VRD processing then TVAP will do nothing but move the .tivo's to that folder.) But this will be the original (unprocessed by VRD) tivo file.
> 
> Do you want to have VRD process the .tivo then save it as a .tivo?
> 
> Both deletion and .tivo saves could be considered for addition to TVAP. It would be much easier to program if the processed .tivo files would always be required to be put in a destination folder different from the tivo transfer folder. Would that serve your purposes?


I want this workflow:

Tivodesktop transfers to local disk (because it can't transfer to a network disk)
TVAP:
1) runs ad-detective with VRD
2) saves the resulting file to a network drive folder as a .tivo file (not the original folder)
3) deletes the original from local disk

pyTivo makes the resulting .tivo available back to my TiVo for viewing.
I've found that pyTivo transfers .mpgs much slower then .tivo files


----------



## dlfl

tbuskey said:


> I want this workflow:
> 
> Tivodesktop transfers to local disk (because it can't transfer to a network disk)
> TVAP:
> 1) runs ad-detective with VRD
> 2) saves the resulting file to a network drive folder as a .tivo file (not the original folder)
> 3) deletes the original from local disk
> 
> pyTivo makes the resulting .tivo available back to my TiVo for viewing.
> I've found that pyTivo transfers .mpgs much slower then .tivo files


I've got a version of TVAP that I'm about to start testing. It will do what you want as long as VRD can output a file to a network drive path and the path URL can be specified in a form that VRD accepts as a path for output files.

I don't have a network drive to test with. If you process a file in VRD can you have it output the processed file directly to the network drive? I assume yes, but it would be nice to know for sure.

I use pyTivo but I've never had an MPEG video that didn't transfer faster than real time, even from my laptop using wireless.


----------



## FrooBrar

dlfl said:


> I've got a version of TVAP that I'm about to start testing. It will do what you want as long as VRD can output a file to a network drive path and the path URL can be specified in a form that VRD accepts as a path for output files.


Maybe I'm missing something here, but how can you output a .TiVo file? I think this is what was being requested, but I know I haven't gotten around to figuring out how to write .TiVo files, since I have a feeling it will be a can of worms. Is there some support for this from VRD or TiVo Desktop that I don't know about?


----------



## dlfl

FrooBrar said:


> Maybe I'm missing something here, but how can you output a .TiVo file? I think this is what was being requested, but I know I haven't gotten around to figuring out how to write .TiVo files, since I have a feeling it will be a can of worms. Is there some support for this from VRD or TiVo Desktop that I don't know about?


VRD supports the .TiVo output and it passes on the metadata in the process. I've done it with the VRD program but haven't actually done it with the COM interface yet -- but I expect it will work -- and will know real soon now.

Given a .TiVo as input, wouldn't it be essentially a matter of binary copying the metadata portions to the output file? Or is it the MPEG2 part (changed after processing by VRD) that poses the difficulty? Does TiVo encrypt the video encoding too?


----------



## FrooBrar

dlfl said:


> Given a .TiVo as input, wouldn't it be essentially a matter of binary copying the metadata portions to the output file? Or is it the MPEG2 part (changed after processing by VRD) that poses the difficulty? Does TiVo encrypt the video encoding too?


Ahh, right. I think I see what they are doing then. Some of the video/audio data is encrypted in a normal .TiVo file that you would download from the TiVo box directly. The particular MPEG packets which are encrypted are flagged with a certain bit, and are decrypted by either the TiVo DirectShow filter or TiVoDecode. However, it has been determined quite some time ago that you can take a decrypted MPEG stream, stick an unmodified encrypted metadata header on the front, and the TiVo will like it just fine (presumably, it would try to decrypt any packets flagged as encrypted, but since there are none, it doesn't try).


----------



## dlfl

tbuskey said:


> I want this workflow:
> Tivodesktop transfers to local disk (because it can't transfer to a network disk)
> TVAP:
> 1) runs ad-detective with VRD
> 2) saves the resulting file to a network drive folder as a .tivo file (not the original folder)
> 3) deletes the original from local disk


This version should do it, although I could not test it on an actual network drive (because I don't have one -- yet). I tested using a 300 GB USB drive. As long as there is a path to the network drive that can be selected in the folder browser that TVAP uses to select destination folders, it should work, assuming VRD is ok with it too.

From the changelog:
3 September 2007 Ver. 0.39
- Added .TiVo output file type selection.
- Added option in default settings to delete original .TiVo file after processing it.
- Major change in file handling: Previously, all processing outputs were placed on the TiVo
transfer directory, then moved to destination folders if so configured. Now the VRD
process outputs the files directly to the specified output folders. The only file moves
made by TVAP are for the original .TiVo file to its destination folder after processing, if set.

I've left the previous version on the download site, just in case. There might be problems caused by slow file access. I had one VRD error during testing with DRV-MS files where the Ad Scan process said it couldn't find the QSF'ed input file -- but the file was actually there when I looked. I guessed this was probably related to slow drive access, e.g., the OS saying a file was there (TVAP checks the input file existence before it launches a VRD process) when it actually was still being written to by the previous process. Thus I sprinkled in 1 second time delays after each VRD process , and after the code that writes the metadata to the DVR_MS file. After that I could not duplicate the error. Keep me posted.

Download and readme info:
ftp://upload:[email protected]/VRD Add-Ons/TiVo-VideoReDo-AutoProcessor/


----------



## FrooBrar

I am considering changing the interface for my COM component. I want to make the ITivoDecode.OpenTivoFile method take the MAK as a parameter, rather than setting it as a property on the ITivoFile object later. Currently, if you don't set the property on the file, it will default to the MAK from the registry. In my proposed change, you would have to pass in the TivoDecode.mak property to the function.

Does this seem reasonable?


----------



## dlfl

FrooBrar said:


> I am considering changing the interface for my COM component. I want to make the ITivoDecode.OpenTivoFile method take the MAK as a parameter, rather than setting it as a property on the ITivoFile object later. Currently, if you don't set the property on the file, it will default to the MAK from the registry. In my proposed change, you would have to pass in the TivoDecode.mak property to the function.
> 
> Does this seem reasonable?


So....... Does this mean I can still avoid having the user enter the MAK, i.e., by using the ITivoDecode.MAK property in "get" mode then just passing the MAK thus obtained in to the revised OpenTivoFile method?

If so, that's fine for me. I would just prefer not to require the user to enter the MAK (even once).

Just curious, what is your motivation for this change? OTS ? Should TVAP have an option to enter a MAK different than what is found in the current user's registry section? (To get more settings in TVAP I may need to expand the real estate on the form, or add another dialog, etc. -- oh well!).


----------



## FrooBrar

dlfl said:


> So....... Does this mean I can still avoid having the user enter the MAK, i.e., by using the ITivoDecode.MAK property in "get" mode then just passing the MAK thus obtained in to the revised OpenTivoFile method?


Yes. Also, I have figured out how to do default parameters in COM, so you may be able to not specify a value and have it just work. I know this works right from JScript/VBScript/VB, and does not work from C/C++, so I don't know how C# will take it...



dlfl said:


> If so, that's fine for me. I would just prefer not to require the user to enter the MAK (even once).
> 
> Just curious, what is your motivation for this change?


I want to be able to do more work up front on OpenTivoFile rather than waiting for later, so I can avoid holding the file open for the lifetime of the ITivoFile object. To do this, I need to know the MAK before I return the ITivoFile object to the caller, so you could not set the MAK property yet and would need to pass it into the function.

However, I am in the middle of adding features to the COM object (I only ever implemented a subset of what I ultimately intended to), and it turns out I need to hold the file open for the lifetime of the object anyway. But, I am still doing more metadata work up front now than before.

I am adding support to open a TivoFile object over an IStream (apparently UCOMIStream to you) as well as on a file name, so a client of the object could stream Tivo file data in from any source, not just a file. To do this in a way that best supports streaming, I need to avoid all seek operations and just go sequentially through the file.

I am also adding suppport to decrypt the MPEG stream to a file or an IStream as well.



dlfl said:


> Should TVAP have an option to enter a MAK different than what is found in the current user's registry section? (To get more settings in TVAP I may need to expand the real estate on the form, or add another dialog, etc. -- oh well!).


Well, that is a feature you can consider. You don't have to, though. In reality, OTS is not that likely in your target demographic. That feature is intended for enterprise users on a domain, who have centralized IT staff. The user needs to run something elevated so they call in the IT guy who enters the admin password "over the shoulder" of the user.


----------



## Dan203

FrooBrar said:


> Yes. Also, I have figured out how to do default parameters in COM, so you may be able to not specify a value and have it just work. I know this works right from JScript/VBScript/VB, and does not work from C/C++, so I don't know how C# will take it...


You can set default values in C++ but it takes a little extra work. Once you add an ActiveX control to a C++ project, in MS VC++, it automatically generates a .h file with prototype functions for each corresponding ActiveX function. If you edit those prototypes to have default values then you are not required to supply values when actually calling the function from other parts of the C++ program. Alternatively you can simply pass the function a blank string and your ActiveX function should be smart enough to detect that and apply the default on it's own.

Dan


----------



## FrooBrar

Dan203 said:


> You can set default values in C++ but it takes a little extra work. Once you add an ActiveX control to a C++ project, in MS VC++, it automatically generates a .h file with prototype functions for each corresponding ActiveX function. If you edit those prototypes to have default values then you are not required to supply values when actually calling the function from other parts of the C++ program. Alternatively you can simply pass the function a blank string and your ActiveX function should be smart enough to detect that and apply the default on it's own.
> 
> Dan


Well, yes and no. I can add default parameters to the functions in my class, but I cannot add default parameters to the interface, which is in a .h file which is autogenerated by MIDL at compile time.

And I didn't use the empty string as the default value, but that would probably be easier.

I just did a little googling, and I found this:
http://blogs.msdn.com/eric_carter/archive/2004/04/15/114079.aspx

Looks like C# does not support the default parameters option of COM. Ugh.

I will change my implementation to accept the empty string to mean "use the mak in the registry and throw if it is not found"...


----------



## Dan203

FrooBrar said:


> Well, yes and no. I can add default parameters to the functions in my class, but I cannot add default parameters to the interface, which is in a .h file which is autogenerated by MIDL at compile time.


Sorry what I meant was that the user could add defaults on their end by editing the .h file which is automatically generated by MSVS when adding a ActiveX control to a C++ project. If you wanted to simplify it you could provide a replacement .h file the user could just drop into the project overwriting the auto generated one.

Although allowing an empty string is the easier option

Dan


----------



## dlfl

FrooBrar said:


> Well, yes and no. I can add default parameters to the functions in my class, but I cannot add default parameters to the interface, which is in a .h file which is autogenerated by MIDL at compile time.
> 
> And I didn't use the empty string as the default value, but that would probably be easier.
> 
> I just did a little googling, and I found this:
> http://blogs.msdn.com/eric_carter/archive/2004/04/15/114079.aspx
> 
> Looks like C# does not support the default parameters option of COM. Ugh.
> ..........


Interesting link. I've done a fair amount of C++ programming (Borland Builder, mostly) and I find C# syntax refreshingly simpler. But not in this case!


----------



## FrooBrar

FrooBrar said:


> I will change my implementation to accept the empty string to mean "use the mak in the registry and throw if it is not found"...


I have put a new release of tivocom at http://tivodecode.sourceforge.net/tivocom/tivocom-1.2.zip

This is what I said in my commit message (should describe the changes pretty well)

rework interfaces (bumped typelib version to 1.1). Add support for decoding
the MPEG stream. Added support to read and write from streams (implementing
IStream) and make the versions which take filenames use a stream
implementation that wraps file access. Make OpenTivoFile take the MAK as a
parameter. It has a default value of "" (empty string), which means try to
get the MAK from the registry, so either omit that param (for those
languages which permit that) or specify it as empty string to use the MAK
from the registry. Added progress reporting of MPEG stream decoding via a
connection point. Progress is updated every 100 frames, and percent
complete is provided if the tivo file stream supports Seek and Stat
functions

Also, something I didn't mention in the commit message is I changed the error when the MAK is not found so that it returns the same HRESULT (ERROR_FILE_NOT_FOUND), but also sets the error info so you may get a description of the error as "MAK not found". Hopefully a little better than the generic "file not found" message it was giving...

Please try it out and let me know what you think.


----------



## Dan203

FrooBrar said:


> Added support to read and write from streams


Does this functionality give the user the ability to write MPEG Program Stream data to the file while maintaining the encrypted meta data?

Also a technical, but mostly unrelated, question... In the .tivo file's header there is some unencrypted XML data labeled "fingerprint" and "salt". Is it possible to generate these two values from scratch using nothing more then the MAK? Or do they need to come from the TiVo itself? I've noticed that they are different in each .tivo file, so they're not static values. I've also noticed that changing even a single digit of either one prevents TiVo Desktop from being able to decrypt the metadata in the file. It also effect the video, but only if the video is encrypted, and that is not a requirement. However TiVo Desktop does require the metadata to be encrypted so these values are needed for proper metadata storage.

The ultimate goal here would be to allow the building of a .tivo file from scratch. Taking unencrypted metadata and an unencrypted MPEG stream an melding them into a .tivo file which can then be read by TiVo Desktop and transfered onto a TiVo complete with metadata.

Dan


----------



## FrooBrar

Dan203 said:


> Does this functionality give the user the ability to write MPEG Program Stream data to the file while maintaining the encrypted meta data?


No, just to decrypt the MPEG part to a file or stream.



Dan203 said:


> Also a technical, but mostly unrelated, question... In the .tivo file's header there is some unencrypted XML data labeled "fingerprint" and "salt". Is it possible to generate these two values from scratch using nothing more then the MAK? Or do they need to come from the TiVo itself? I've noticed that they are different in each .tivo file, so they're not static values. I've also noticed that changing even a single digit of either one prevents TiVo Desktop from being able to decrypt the metadata in the file. It also effect the video, but only if the video is encrypted, and that is not a requirement. However TiVo Desktop does require the metadata to be encrypted so these values are needed for proper metadata storage.


All right, here's a quick overview of how the keys are generated for encrypting/decrypting the data (metadata and video)

Video: Take the MAK, in ASCII, concatenate the plaintext XML chunk, take the SHA1 of this.

Metadata: Make a string "tivo:TiVo DVR:MAK", take the MD5 of this string, convert that to ASCII hex, concatenate the plaintext XML chunk, take the SHA1 of this.

So, technically, the format of the chunk you are referring to does not matter. It could say whatever you wanted. It is used verbatim to decrypt the data in the file.

I have written a perl script to test generating a TiVo header with metadata from the decrypted chunks, using tdcat and a little creative use of pack(). It is not really in a user-friendly or portable state, and I intend to get around to writing a C program to do this when I get some free time, and add this to tivodecode, but I will try to post the perl script I have right now.



Dan203 said:


> The ultimate goal here would be to allow the building of a .tivo file from scratch. Taking unencrypted metadata and an unencrypted MPEG stream an melding them into a .tivo file which can then be read by TiVo Desktop and transfered onto a TiVo complete with metadata.
> 
> Dan


I have done this with the perl script, and it worked. So far I have noticed that TiVo Desktop uses chunk id 1, while the TiVo itself prefers to use chunk id 2. Also, if you change the metadata in chunk 2 and send it back to the TiVo, you may be surprised to see the TiVo still showing you the old metadata. This seems to be due to the unique show id in chunk 2 xml, and I guess the TiVo has a cache of metadata based on show id and does not update it. Just delete the show ID from the chunk 2 xml before sending it back to the tivo and it will work.

Also, the file generated is the part of the tivo file right up to the start of the MPEG data. I just ran:
cat decrypted_mpeg.mpg >> output.TiVo
and got a combined file.


----------



## dlfl

- Fixed: When TivoToGo (at least Ver. 2.3 that I use) queues *multiple * tivo files for transfer, it creates zero-length files on the tivo transfer directory and TVAP decided the files had completed transferring because their length was not changing.

- Fixed: MetaData for files being transferred was not handled properly.

Download or view readme instructions/details at:
ftp://upload:[email protected]/VRD Add-Ons/TiVo-VideoReDo-AutoProcessor/


----------



## dlfl

16 October 2007 Ver. 0.41
- TiVo files "queued" for transfer by Desktop (i.e., sitting on transfer folder with constant zero size)
are shown as TRANSFERRING in the file list, with "queued" displayed for file length. This allows
user to set custom processing options.


----------



## saberman

dlfl said:


> Also, if someone has a PC running XP and can run this from an account that *doesn't* have admin privileges I would appreciate knowing what that does too.
> 
> Thanks!


I tried running it on Windows XP SP2 from an account that is a power user but not an administratior and it said:

---------------------------
TestUAC.exe - Application Error
---------------------------
The application failed to initialize properly (0xc0000135). Click on OK to terminate the application. 
---------------------------
OK 
---------------------------

I go the same results when I tried "run as" using an adminstrator id.


----------



## dlfl

saberman said:


> I tried running it on Windows XP SP2 from an account that is a power user but not an administratior and it said:
> 
> ---------------------------
> TestUAC.exe - Application Error
> ---------------------------
> The application failed to initialize properly (0xc0000135). Click on OK to terminate the application.
> ---------------------------
> OK
> ---------------------------
> 
> I go the same results when I tried "run as" using an adminstrator id.


Thanks for the info. I hope such issues are not causing TVAP users problems that they can't work around. I haven't sorted out the interaction between user privileges and MAK owner beyond what FrooBar said in post #66 of this thread.


----------



## dlfl

If you have TVSuite installed, the Run VideoReDo button will launch it, even if you also have VRD-Plus installed. 

Regarding the TVAP VRD COM interface, if you have both Plus and TVSuite installed, TVAP uses the COM interface from whichever program was last run with the normal GUI interface. I haven't figured out why but it doesn't seem to make a practical difference as the COM functionality used by TVAP seems to run identically in either case.


----------



## dakk

I just installed Tivo series 3 hd ...I already had Tivo series 2dt ......when transferring 30 Rock to computer using TivoDesktop 2.52, the series 3 reads 31 min. 498 MB ......My old series 2dt reads 31min. 853 MB .....the series 3 unit when transferring to TivoDesktop is doing this to all recordings.
When I run the files thru VideoReDo..their are way to many audio synch errors, than when I load it into DVDStyler 1.5 I get :
Prepare
Cleaning temporary directory
Generating menus
Generating menu 1 of 1
Prepare
Converting jpg to mpeg
INFO: [jpeg2yuv] Parsing & checking input files.
INFO: [jpeg2yuv] YUV colorspace detected.
INFO: [jpeg2yuv] Starting decompression
INFO: [jpeg2yuv] Image dimensions are 720x480
INFO: [jpeg2yuv] Movie frame rate is: 29.970030 frames/second
INFO: [jpeg2yuv] Interlaced frames, top field first.
INFO: [jpeg2yuv] Frame size: 720 x 480
INFO: [jpeg2yuv] Number of Loops 1
INFO: [jpeg2yuv] Now generating YUV4MPEG stream.
INFO: [jpeg2yuv] Processing non-interlaced/interleaved C:\Documents and Settings\Kevin Faye\dvd\menu1-0.mpg_bg.jpg, size 155981
INFO: [jpeg2yuv] Rescaling color values.
++ WARN: [mpeg2enc] Unknown stream tag encountered: 'C420jpeg'
INFO: [mpeg2enc] Selecting DVD output profile
INFO: [mpeg2enc] Encoding MPEG-2 video to C:\Documents and Settings\Kevin Faye\dvd\menu1-0.mpg_bg.m2v
INFO: [mpeg2enc] Horizontal size: 720 pel
INFO: [mpeg2enc] Vertical size: 480 pel
INFO: [mpeg2enc] Aspect ratio code: 1 = 1:1 pixels
INFO: [mpeg2enc] Frame rate code: 4 = 30000.0/1001.0 (NTSC VIDEO)
INFO: [mpeg2enc] Bitrate: 9000 KBit/s
INFO: [mpeg2enc] Quality factor: 8 (1=best, 31=worst)
INFO: [mpeg2enc] Field order for input: top-field-first
INFO: [mpeg2enc] Sequence unlimited length
INFO: [mpeg2enc] Search radius: 16
INFO: [mpeg2enc] GOP SIZE RANGE 9 TO 18
INFO: [mpeg2enc] Setting colour/gamma parameters to "NTSC"
INFO: [mpeg2enc] Progressive format frames = 0
INFO: [mpeg2enc] Buffering 45 frames
INFO: [mpeg2enc] SETTING MMX and EXTENDED MMX for QUANTIZER!
INFO: [mpeg2enc] SETTING EXTENDED MMX for MOTION!
INFO: [mpeg2enc] SETTING MMX for TRANSFORM!
INFO: [mpeg2enc] SETTING EXTENDED MMX for PREDICTION!
INFO: [mpeg2enc] GOP LENGTH = 1
INFO: [mpeg2enc] Frame start 0 I 0 0
INFO: [mpeg2enc] Frame end 0 220.68 220.68 8.6 8.57
INFO: [mpeg2enc] GOP LENGTH = 0
Multiplexing audio and video
INFO: [???] mplex version 2.0.0 (2.2.3 $Date: 2004/01/13 20:45:26 $)
INFO: [???] File C:\Documents and Settings\Kevin Faye\dvd\menu1-0.mpg_bg.m2v looks like an MPEG Video stream.
INFO: [???] File C:\Program Files\DVDStyler\data\silence.mp2 looks like an MPEG Audio stream.
INFO: [???] Video stream 0: profile 8 selected - ignoring non-standard options!
INFO: [???] Found 1 audio streams and 1 video streams
INFO: [???] Selecting dvdauthor DVD output profile
INFO: [???] Multiplexing video program stream!
INFO: [???] Scanning for header info: Video stream e0 (C:\Documents and Settings\Kevin Faye\dvd\menu1-0.mpg_bg.m2v)
INFO: [???] VIDEO STREAM: e0
INFO: [???] Frame width : 720
INFO: [???] Frame height : 480
INFO: [???] Aspect ratio : 1:1 pixels
INFO: [???] Picture rate : 29.970 frames/sec
INFO: [???] Bit rate : 9000000 bits/sec
INFO: [???] Vbv buffer size : 229376 bytes
INFO: [???] CSPF : 0
INFO: [???] Scanning for header info: Audio stream c0 (C:\Program Files\DVDStyler\data\silence.mp2)
INFO: [???] MPEG AUDIO STREAM: c0
INFO: [???] Audio version : 1.0
INFO: [???] Layer : 2
INFO: [???] CRC checksums : no
INFO: [???] Bit rate : 16384 bytes/sec (128 kbit/sec)
INFO: [???] Frequency : 48000 Hz
INFO: [???] Mode : 0 stereo
INFO: [???] Mode extension : 0
INFO: [???] Copyright bit : 0 no copyright
INFO: [???] Original/Copy : 0 copy
INFO: [???] Emphasis : 0 none
INFO: [???] SYSTEMS/PROGRAM stream:
INFO: [???] rough-guess multiplexed stream data rate : 9319496
INFO: [???] target data-rate specified : 10080000
INFO: [???] Setting specified specified data rate: 10080000
INFO: [???] Scanned to end AU 0
INFO: [???] Run-in Sectors = 89 Video delay = 13019 Audio delay = 0
INFO: [???] New sequence commences...
INFO: [???] Video e0: buf= 237568 frame=000000 sector=00000000
INFO: [???] Audio c0: buf= 4096 frame=000000 sector=00000000
INFO: [???] STREAM e0 completed @ frame 0.
INFO: [???] STREAM c0 completed @ frame 249.
INFO: [???] Multiplex completion at SCR=536868.
INFO: [???] Video e0: buf= 237568 frame=000000 sector=00000021
INFO: [???] Audio c0: buf= 1024 frame=000249 sector=00000048
INFO: [???] VIDEO_STATISTICS: e0
INFO: [???] Video Stream length: 41314 bytes
INFO: [???] Sequence headers: 1
INFO: [???] Sequence ends : 1
INFO: [???] No. Pictures : 0
INFO: [???] No. Groups : 1
INFO: [???] No. I Frames : 1 avg. size 41314 bytes
INFO: [???] No. P Frames : 0 avg. size 0 bytes
INFO: [???] No. B Frames : 0 avg. size 0 bytes
INFO: [???] Average bit-rate : 9905600 bits/sec
INFO: [???] Peak bit-rate : 0 bits/sec
INFO: [???] BUFFERING stream too short for useful statistics
INFO: [???] AUDIO_STATISTICS: c0
INFO: [???] Audio stream length 96000 bytes.
INFO: [???] Syncwords : 250
INFO: [???] Frames : 250 padded
INFO: [???] Frames : 0 unpadded
INFO: [???] BUFFERING stream too short for useful statistics
INFO: [???] MUX STATUS: no under-runs detected.
Multiplexing subtitles (buttons) into mpeg
DVDAuthor::spumux, version 0.6.14-GfD-1.
Build options: gnugetopt iconv freetype
Send bugs to <[email protected]>
INFO: Locale=C
INFO: Converting filenames to US-ASCII
STAT: 0:00:00.000
INFO: PNG had 2 colors
INFO: PNG had 2 colors
INFO: PNG had 2 colors
INFO: Pickbuttongroups, success with 1 groups, useimg=1
INFO: Found EOF in .sub file.
INFO: Max_sub_size=148
INFO: 1 subtitles added, 0 subtitles skipped, stream: 32, offset: 0.18
Create VOB files
Fix MPEG-file: G:\DVD'S\PBS\Ken Burns\Ken Burns American Stories - ''The Congress'' (Recorded Nov 7, 2007, WNET).mpg
warning: couldn't find any valid system header. I'm continuing anyway
DemultiplexingXXX : [audio 00 video 01] [ 0.01%]
DemultiplexingXXX : [audio 07 video 03] [ 5.00%]
DemultiplexingXXX : [audio 11 video 04] [ 10.00%]
DemultiplexingXXX : [audio 12 video 05] [ 15.00%]
DemultiplexingXXX : [audio 14 video 07] [ 20.00%]
DemultiplexingXXX : [audio 14 video 09] [ 25.00%]
DemultiplexingXXX : [audio 15 video 10] [ 30.00%]
DemultiplexingXXX : [audio 16 video 10] [ 35.00%]
DemultiplexingXXX : [audio 16 video 10] [ 40.00%]
DemultiplexingXXX : [audio 16 video 11] [ 45.00%]
DemultiplexingXXX : [audio 16 video 11] [ 50.00%]
DemultiplexingXXX : [audio 16 video 14] [ 55.00%]
DemultiplexingXXX : [audio 16 video 14] [ 60.00%]
DemultiplexingXXX : [audio 16 video 14] [ 65.00%]
DemultiplexingXXX : [audio 16 video 14] [ 70.00%]
DemultiplexingXXX : [audio 16 video 14] [ 75.00%]
Erroneous packet size, skipping
DemultiplexingXXX : [audio 16 video 15] [ 80.00%]
DemultiplexingXXX : [audio 16 video 15] [ 85.00%]
DemultiplexingXXX : [audio 16 video 15] [ 90.00%]
Erroneous packet size, skipping
Erroneous packet size, skipping
DemultiplexingXXX : [audio 16 video 15] [ 95.00%]
DemultiplexingXXX : [audio 16 video 15] [100.00%]
INFO: [???] mplex version 2.0.0 (2.2.3 $Date: 2004/01/13 20:45:26 $)
INFO: [???] File C:\Documents and Settings\Kevin Faye\dvd\title0-0-0-0.m2v looks like an MPEG Video stream.
**ERROR: [???] File unrecogniseable!
**ERROR: [???] Unrecogniseable file(s)... exiting.
Error executing of command: mplex -f 8 -S 0 -M -V -o "C:\Documents and Settings\Kevin Faye\dvd\title0-0-0.vob" "C:\Documents and Settings\Kevin Faye\dvd\title0-0-0-0.m2v" "C:\Documents and Settings\Kevin Faye\dvd\title0-0-0-0.mp2"
s this a hardware problem specific to my series 3 unit?
Has anyone had a problem like this?
I have to stop recording on my series 3.....I can't put them on dvd
I also noticed when Cablevision came to remove cable box & installed the cards in TCD648250B Series3 HD Digital Media Recorder my signaled from tivo to my TV is now on HDMI,Composite 1 & S Video 1 where w/my series 2 dt box it was on HDMI,TV channel 03 NTSC & Composite 1, now all I get is snow on NTSC
Could someone please point me in the right direction
I have some season series's coming to an end, one or two episodes left, I would hate to lose them, esp. after all the time & effort to get the full series.


----------



## dlfl

Did you mean to post in this thread? I don't see how your problem relates to TVAP?

I've used the Dan203 method (VRD + DVDStyler) but not on HD videos. Don't have any idea what the problem is. Try posting on the VideoReDo and DVDStyler forums, and/or start a new thread on this forum, perhaps in the Series3/HD section.

Good luck!


----------



## dlfl

I thought TVSuite had an identical COM interface (used by TVAP) to VRD-Plus. However I get TVSuite crashes when TVAP trys to start AdScans using the TVSuite COM interface (using Beta 544).

I've posted this problem on the VideoReDo TVSuite support thread and I'm hoping this is just a temporary bug in the Beta version -- or that VRD can tell me what is different about the TVSuite COM interface so I can adapt TVAP appropriately.

As mentioned in a previous post, if you have both Plus and TVSuite installed, the COM interface that is used by TVAP is determined by which program was last run in the normal GUI interactive mode. 

Thus if you are running TVSuite my suggested work-around to allow TVAP to automate adscans is as follows:

1. Keep a copy of VRD-Plus installed (or download and install it). I'm not aware of any conflicts from having both programs installed -- as I do.

2. Before running TVAP, start VRD Plus and shut it down. This will cause TVAP to use the Plus COM interface. Unfortunately I just modified TVAP so if you have both Plus and TVSuite installed, the "Run VideoReDo" button will run TVSuite, which will cause further COM operations to run from TVSuite. If I don't get a quick resolution of the problem from VRD, I will release a new version where the button defaults to VRD Plus (if it is installed).


----------



## Dan203

Has DanR responded to your problem yet? If not let me know and I'll point him toward it. (the COM interface is his territory)

Dan


----------



## dlfl

Dan203 said:


> Has DanR responded to your problem yet? If not let me know and I'll point him toward it. (the COM interface is his territory)
> 
> Dan


I see TVSuite beta 545, just released, has this on the fix list:



> Batch: Ad-Detective scan will crash if running in silent mode on WinXP. Was OK on Vista.


Sounds like that was my problem -- will test.

Thanks Dan

Edit: Limited testing indicates TVSuite Beta 545 has fixed the problem!

Thus if you are using TVAP with TVSuite, upgrade TVSuite to 545 !


----------



## wgw

Would it be possible to auto enable filters during QSF processing? On my first test I ran into a file that had an errant 720x480 frame at the transition from commercials back to the movie while the rest of the Tivo file was 528x480. Don't know how often this occurs. It caused VideoReDo to crash during ad scan and TVAP assumed process was complete. When enable filters is selected, a window pops up asking you to select the video dimension. Normally there is just one dimension listed and filtering is not required. It would be great if TVAP could check the enable filters box to see if more than one dimension appears. If only one appears, auto press OK and proceed with QSF. If more than one appears, pause and let the user select appropriate video dimension before proceeding with QSF.

Also, is it possible to auto shrink the TVAP window vertically when the window is maximized. I use a double high taskbar and the bottom of the window is cut off even when maximized.


----------



## wgw

I didn't see the Episode Number in the metadata window but was wondering if it was available. I'd love to be able to rename the output file to include the episode number after the title in the file name. Episode Num is not always provided on the Tivo Program Details screen, but when available, it sure would be handy to make it part of the file name. Great program though, Thanks.


----------



## dlfl

wgw said:


> Would it be possible to auto enable filters during QSF processing? .............. It would be great if TVAP could check the enable filters box to see if more than one dimension appears. If only one appears, auto press OK and proceed with QSF. If more than one appears, pause and let the user select appropriate video dimension before proceeding with QSF.


I looked into this briefly and don't see a way to do it via the VRD COM interface that TVAP uses.



wgw said:


> Also, is it possible to auto shrink the TVAP window vertically when the window is maximized. I use a double high taskbar and the bottom of the window is cut off even when maximized.


Not sure I understand here. Are you using 800x600 screen graphics? Even with just 1024x768 graphics, there is plenty of room for a double layer task bar. TVAP is only 576 pixels high. Of course the TVAP window can be resized manually.


----------



## dlfl

wgw said:


> I didn't see the Episode Number in the metadata window but was wondering if it was available. I'd love to be able to rename the output file to include the episode number after the title in the file name. Episode Num is not always provided on the Tivo Program Details screen, but when available, it sure would be handy to make it part of the file name. Great program though, Thanks.


TVAP does read the "episodeTitle" metadata and reports it as sub-title. I don't have a .tivo file that has an episode number in it. The only series I record is "The Office", which doesn't have it. However I do have a "Cranky Geeks" podcast in my NPL and I notice the episode title (which would be sub-title in TVAP) is "Episode 90". (This file cannot be transfered to my PC of course.)

See if you see episode numbers in your files in the sub-title in the TVAP metadata display. Or maybe I just need to get a .tivo that has an episode number field in it distinct from the episodeTitle field. What are some series that you know have the numbers?


----------



## wgw

dlfl said:


> TVAP does read the "episodeTitle" metadata and reports it as sub-title. I don't have a .tivo file that has an episode number in it. The only series I record is "The Office", which doesn't have it. However I do have a "Cranky Geeks" podcast in my NPL and I notice the episode title (which would be sub-title in TVAP) is "Episode 90". (This file cannot be transfered to my PC of course.)
> 
> See if you see episode numbers in your files in the sub-title in the TVAP metadata display. Or maybe I just need to get a .tivo that has an episode number field in it distinct from the episodeTitle field. What are some series that you know have the numbers?


Coming up on KTVIDT, Seinfeld and Stargate SG-1 have "Episode Num". Also CSI Miami on KSDKDT. Family Guy and Chappelle's Show on KPLRDT.

It's shows up even after the file has been transferred to the PC. So it's there somewhere. It's on the additional info screen with all the actors names, directors, producers, etc.


----------



## wgw

dlfl said:


> Are you using 800x600 screen graphics? Even with just 1024x768 graphics, there is plenty of room for a double layer task bar. TVAP is only 576 pixels high. Of course the TVAP window can be resized manually.


Yes, I'm using 800x600 so I can read while reclining from a distance. When I resize the window manually or maximize, the last few lines in the log window disappears and the scroll won't bring them into view. A minor problem but I thought I'd ask. I also frequently run across apps that are more tall than wide and disappear well below the taskbar. But I think those are usually written in "PAL" countries where I guess the monitors are sized differently. But one can't complain too much when it's free.:up:


----------



## dlfl

17 November 2007 Ver. 0.43
- Added Episode # and Movie Year (when available) to the metadata display. Sub-title is now labeled Episode in this display.

Note: this changes the structure of the XML database file, so you will have to go through the start up configuration process again.

@ wgw:
I grabbed a minute or so of a CSI - Miami episode and used it to figure out how to read the ep #. I had been wanting the movie year (for movies) myself.


----------



## dlfl

wgw said:


> Yes, I'm using 800x600 so I can read while reclining from a distance. When I resize the window manually or maximize, the last few lines in the log window disappears and the scroll won't bring them into view. A minor problem but I thought I'd ask. I also frequently run across apps that are more tall than wide and disappear well below the taskbar. But I think those are usually written in "PAL" countries where I guess the monitors are sized differently. But one can't complain too much when it's free.:up:


lol! I too use the (highly ergonomic ) "reclining" position. But I'm able to get by with 1024x768. I sense slightly veiled disdain from younger users who normally use higher resolutions.

There is a standard windows method that you could use to scroll (actually just move) the window up so you can look at the log information, although I don't know if you will find it useful:

Right click on the title bar of the window. Select "Move". Use the up/down arrow keys to move the window up and down. Click on the window to end the move mode. (You can also just drag with the title bar in the move mode, but since you need to get the title bar off screen, that won't work for you.)


----------



## dlfl

Minor GUI fixes:
- Form now cannot be resized. Maximize button is disabled.
- Cleaned up tab order and prevented focus on read-only text display boxes.


----------



## expletive

Sounds neat, anything similar for OS X?


----------



## dlfl

expletive said:


> Sounds neat, anything similar for OS X?


Unfortunately not. It's programmed in Microsoft Visual Studio C# which is tightly integrated wtih the Windows .NET framework.

I've heard of this type project being ported to linux (e.g., Tivo.Net) using a software package called "mono" which (I think) kind of substitutes for the the .NET framework on linux OS.

However I don't have access to a linux box nor the time to do the port. TVAP also uses one COM object and one .NET class library (.dll) furnished by other parties, plus it uses Windows scripting to run VBscripts. Given all this, I suspect the mono port would be very complicated if possible at all.

Sorry!


----------



## saberman

dlfl said:


> No enhancements this time -- fixed a bug that occured if you configured moving .TiVo files to a destination folder.
> 
> Download: ftp://upload:[email protected]/VRD Add-Ons/TiVo-VideoReDo-AutoProcessor/


Can you define automatic edits of the file name during the move? TiVo transfers a file that is in a group with a name like:
Group Name - ''Episode description''

I would like to remove "Group Name - " -- IOW everything befor the double '.

Stu


----------



## dlfl

saberman said:


> Can you define automatic edits of the file name during the move? TiVo transfers a file that is in a group with a name like:
> Group Name - ''Episode description''
> 
> I would like to remove "Group Name - " -- IOW everything befor the double '.
> 
> Stu


Hmmmm... Didn't quite follow that. Can you spell it out in more detail?

Edit: I think I see some of what you're getting at. I'm still using Desktop 2.3 while I understand that from 2.4 on you could group files in subfolders on your pc and the grouping would show up on the TiVo NPL when they were transfered back. Is that what you are talking about? Please post post several samples, plus more details of what you would want done.

How does a file get "grouped" on the TiVo other than being transferred back from a pc?


----------



## dlfl

Off possible interest to anyone using both TVAP and pyTivo:

Schemes to have pyTivo include metadata with files it serves back to the TiVo are under investigation. It appears they will involve a separate text or xml file paired with the video file on your pc. I am monitoring these developments and as soon as a scheme is adopted I plan to mod TVAP so it automatically generates the required metadata file.

See the pyTivo thread for more details on metadata developments.

Edit (later):
I've got this running with a pre-release version of TVAP and a pre-release version of pyTivo (build 6ddab, which can be downloaded from the pyTiVo download site.) By including Series ID, the TTCB files will group properly in the NPL. TVAP generates the required metadata text file and puts it in the same directory as the TVAP-processed output video. Before releasing it, I want to test and refine the TVAP version and I'm hoping an "official" version of pyTivo with the metadata capability will be released soon.


----------



## saberman

dlfl said:


> Hmmmm... Didn't quite follow that. Can you spell it out in more detail?
> 
> Edit: I think I see some of what you're getting at. I'm still using Desktop 2.3 while I understand that from 2.4 on you could group files in subfolders on your pc and the grouping would show up on the TiVo NPL when they were transfered back. Is that what you are talking about? Please post post several samples, plus more details of what you would want done.
> 
> How does a file get "grouped" on the TiVo other than being transferred back from a pc?


Let me try again.

I have grouping set on on the TiVo. Therefore, all of the broadcasts of Boston Legal go into a group call Boston Legal. Let us assume that the description of the a particular episode is ''A mess''. If I transfer that episode to the PC useing TiVo Desktop the file name becomes:
Boston Legal - ''A mess''

When this happens I rename the file to ''A mess'' and move it to a sub directory called Boston Legal. So my question is can I edit the file name to remove the group name that TiVo prepends to the episode name? In this case it is the string |Boston Legal - |. Without the framing |'s.


----------



## dlfl

saberman said:


> .........I have grouping set on on the TiVo. Therefore, all of the broadcasts of Boston Legal go into a group call Boston Legal. Let us assume that the description of the a particular episode is ''A mess''. If I transfer that episode to the PC useing TiVo Desktop the file name becomes:
> Boston Legal - ''A mess''
> 
> When this happens I rename the file to ''A mess'' and move it to a sub directory called Boston Legal. So my question is can I edit the file name to remove the group name that TiVo prepends to the episode name? In this case it is the string |Boston Legal - |. Without the framing |'s.


I understand now. Part of my problem was I've never used grouping on my TiVo NPL and didn't even know how to turn it on and off (until yesterday) 

Are there other users interested in this feature? One problem I have is where to put the check box to turn this on and off. The TVAP GUI is pretty busy already and I'm reluctant to enlarge the form. I have a "special" version of it that I use at home that runs batch files to create XVID and WMV versions of the processed MPEG2 files and some of the real estate that looks empty in the distributed version has check boxes to control these "hidden" features.

Anyway if there is a significant user interest, I would be willing to attempt it.


----------



## wgw

dlfl said:


> Edit (later):
> I've got this running with a pre-release version of TVAP and a pre-release version of pyTivo (build 6ddab, which can be downloaded from the pyTiVo download site.) By including Series ID, the TTCB files will group properly in the NPL. TVAP generates the required metadata text file and puts it in the same directory as the TVAP-processed output video. Before releasing it, I want to test and refine the TVAP version and I'm hoping an "official" version of pyTivo with the metadata capability will be released soon.


The suspense is killing me. I want my metadata.


----------



## dlfl

wgw said:


> The suspense is killing me. I want my metadata.


Made a lot of progress refining it tonight. Channel Number, Station Call Sign and recording date are automatically inserted in the metadata text file now. The recording date requires a mod to pyTivo so I need to get on that thread and talk about it. The call sign and recording date are already in the TTG file name but by sending them back as metadata they show up properly in the screen you get in NPL when you select a program -- this is in the small print at right center of the screen.

And now a break for turkey. Happy Thanksgiving to all!


----------



## dlfl

If you've been following the pyTivo thread you know that armooo (pyTivo author) has really delivered on the metadata thing. TVAP will be able to fill in a lot more items than I had been planning but it will take some more time for me to hook it up.


----------



## dlfl

For mpeg2 output types, TVAP now automatically generates a metadata text file that pyTivo transcoding server (Ver. 143ca....) will automatically use to attach metadata to videos it serves back to your TiVo box.

The name of the file is <videoFileName>.mpg.txt and it is placed in the folder with the final mpeg2 output file of your TVAP process.

These items are supported:
title
series title
episode title
description
series ID (which will support grouping in the NPL)
recording time/date
channel
call sign
original air date (or movie year if it's a movie)
actor(s)
director(s)
genre(s) (called categories in TiVo info display)

pyTivo supports a few more items but this set will be the starting point for TVAP.

Thanks are due to Armooo (pyTivo author) and FrooBrar (tivoDecode author) for making this possible and to Dan203 for general useful info.


----------



## dlfl

Ver. 0.45 was parsing the TivoDecode XML chunk incorrectly and thus creating incorrect seriesID numbers.

If you have processed files with 0.45, their metadata files will have incorrect seriesID numbers. If you've been following the pyTivo thread you know how to get the correct seriesID -- provided the original tivo file is still on your tivo (or can be resurrected from the deleted folder).

If the transferred file is still on your pc in the transfer directory (or can be moved there), here is another way:

1. Shut down TVAP if it's running

2. In the TVAP installation folder, edit TivoFileManager.xml in notepad.

3. Find the <TivoFileData> ..... </TivoFileData> section(s) for each file you want a new seriesID for and delete all the lines including the two tags just given. Close notepad.

4. Restart TVAP then shut it down as soon as it will let you.

This forces TVAP to re-generate the metadata for the files you deleted. Now you can look at TivoFileManager.xml (just double click it and it will come up in your browser - or use notepad again).

The correct seriesID is now there. You can copy and paste it from there to correct your existing metadata text file(s).

Here is the TVAP download site again for your convenience:

ftp://upload:[email protected]/VRD Add-Ons/TiVo-VideoReDo-AutoProcessor/

Edit: Based on a couple of samples I think the correct seriesID string will be the first 8 characters of the one generated by 0.45 with the first two chars changed to "SH".


----------



## wgw

I see you snuck in that concatenation of the series title and episode.  Works for me. The title and episode are now displayed on the tivo when grouping is turned off. As it should be. Hopefully armooo responds to your ticket and can work out something so that transfers, even without metadata, display that way. Thanks for the metadata. Great work.


----------



## dlfl

wgw said:


> I see you snuck in that concatenation of the series title and episode.  Works for me. The title and episode are now displayed on the tivo when grouping is turned off. As it should be. Hopefully armooo responds to your ticket and can work out something so that transfers, even without metadata, display that way. Thanks for the metadata. Great work.


Wasn't sure how that would work out -- may see problems with more experience. Anyway glad you noticed it and liked it (so far).

I convert most of my .tivo-to-mpeg2 files to xvid/avi (to save space) and all one has to do is rename the metadata file appropriately and put it in the right folder and pyTivo will serve the metadata back with the avi. I really like the flexibility of Armooo's metadata scheme!

Actually I have a "special" version of TVAP for personal use only that does the avi conversion and the rest all automatically. I would provide that to the public except it's a real kludge of batch files (with hardwired paths) and freebie video programs (aviSynth, dgIndex) that must be installed. Attempting to make that distributable would be difficult at best.


----------



## wgw

windracer said:


> Seems to work as advertised ... if only I could make Ad-Detective more reliable!


The stars must be in perfect alignment today. Adscan detected every commercial perfectly on one of my shows. That's a first.


----------



## wgw

BTW, were you able to find EpisodeNumber in the tag data?

I have recorded an entire series of a show. Before I transfer them back to the TiVo, I would like to concatenate the EpisodeNumber into the title, like you did with the seriesTitle and EpisodeTitle. I would like to concatenate them in the fomat SeriesTitle+EpisodeNumber+EpisodeTitle. That way the TiVo will sort the episodes in episodeNumber order and I can easily watch them in sequence without drilling down to the Program details page to find the episode number. 

If you create the standalone metadata program you mentioned in the pyTivo thread, would it be possible to create a config file that the user could modify to change how the tag data is output.


----------



## dlfl

wgw said:


> BTW, were you able to find EpisodeNumber in the tag data?
> 
> I have recorded an entire series of a show. Before I transfer them back to the TiVo, I would like to concatenate the EpisodeNumber into the title, like you did with the seriesTitle and EpisodeTitle. I would like to concatenate them in the fomat SeriesTitle+EpisodeNumber+EpisodeTitle. That way the TiVo will sort the episodes in episodeNumber order and I can easily watch them in sequence without drilling down to the Program details page to find the episode number.
> 
> If you create the standalone metadata program you mentioned in the pyTivo thread, would it be possible to create a config file that the user could modify to change how the tag data is output.


lol  I actually had something close to what you want (for ep #) working during development then removed it. One potential problem is some series don't have episodeNumber defined in the TivoDecode xml chunk that I parse. I will try to get this mod in today. I like your alpha-sort idea. However there is a small issue: ep #11 will alpha-sort before ep #2 UNLESS I force all ep# to (e.g.) 3 characters, with leading zeros filled. Of course using 3 chars, there still would be problems if numbers reached 1000. Your thoughts?

Re the metadata utility: yes some sort of user control would be nice. I would rather do it via the GUI (e.g., check boxes as in TVAP) but that can get out of hand if there are too many possible variations. I welcome any specific thoughts on the variations to be implemented. (Obviously one would be how the ep# is handled.) There also could be a checkbox for each item, setting whether it is included.

I haven't so far included all the items that pyTivo can handle. I wonder how important it is to do that?


----------



## wgw

I'd like to see all the available tags dumped into the text file. I think PyTivo would ignore the tags it does not support. But you might want to put all the pytivo supported tags at the top of the txt file and all the unsupported tags at the bottom. Separate them with a line containing "#------------". You might be able to place a "#" in the first position of each line to comment out the unsupported tags. But I guess it would be best to check with armooo to determine the best way to add unsupported text to the metadata file.

For the metadata utility, I was thinking that you might be able to create a template file to be used with the utility. The template might contain something like:



Code:


"description : " <Description>
"title : " <Title>

Which the user could modify to create different templates for the output they want. Like:



Code:


"description : " <seriesId> <Description>
"title : " <Title>" - "<EpisodeNumber>" - "<EpisodeTitle>

For TVAP, I was kind of hoping you could rename the output file to also include EpisodeNumber in the filename, when available. For example,

_Heroes - ''The Line".tivo_

would be renamed to

_Heroes -205 - ''The Line"_QSF.tivo_

or you could use Tivo metadata tag data to create the output filename:

_"_"<EpisodeNumber>"_"<EpisodeTitle>+_QSF.tivo_

And if possible, create a template file defining the output filename which users could modify to adjust the output file name using metadata tag names.

For both TVAP and the metadata utility, you could probably create a dropdown selection list for all of the different templates found in the application folder.

For starters, create a default template and an episode template. As pyTivo changes, or others have unique requests for modified output, publish modifications as new or replacement templates rather than making hard coded changes in the program file.

Well, i've rambled on enough and probably asked for too much. But thanks in advance for anything you can do.


----------



## wgw

Followup to my last post. I found this code in video.py. If I'm reading this right, it ignores lines starting with "#" when reading the metadata text file. As well as lines that do not contain a ":".



Code:


              if line.strip().startswith('#'):
                    continue
                if not ':' in line:
                    continue


----------



## dlfl

Just a minor change in the metadata file format:
If the tivo file header contains an episode number it is inserted in the title item. The number is forced to 3 digits, i.e., 2 becomes 002. This is to support alphabetical sorting by episode number when grouping in the NPL.

example:
title : CSI: Miami (#508) - High Octane

Text preceding the ep # is the series title, which should be constant within a group.


----------



## msmart

dlfl, I just wanted to say thanks for your TVAP application (v0.42). I recently started using it to automatically do Ad-Detective scans after shows have been downloaded to my PC. It works great!! Thanks for all your efforts and continued work on it.


----------



## schwingle

Indeed, this is working really well for me too! I'm very pleased with it! Now all I need is a way to transcode the mpg's to avi. I'm still not finding anything I'm happy with and that is quick and easy to use.


----------



## dlfl

schwingle said:


> ......... Now all I need is a way to transcode the mpg's to avi. I'm still not finding anything I'm happy with and that is quick and easy to use.


I had exactly the same need -- see my post #119 on this thread. I have an automated process that (so far) has done a decent job on various types of content -- although it's not the ultimate in terms of compression vs. quality -- you can't have that and speed/simplicity at the same time.

My xvid/avi's are (currently) encoded at 1050 kbps video and 128 kbps audio for a total of 1178 kbps. Medium quality tivo files are at 2700 kbps (total) and best are around 5800 kbps. So that shows the file size compression ratio you get. The same process could be used for HD videos with increased bit rates of course. For medium quality tivo's on a 3 GHz pc, the encoding times are about 60% of video length.

If you are willing/able to deal with programs like aviSynth and dgIndex (both free), I could put together instructions so you could duplicate what I do without having to become an expert on these programs or ffmpeg (which is also used -- you already have this if you're running pyTivo or Tivo.Net).


----------



## schwingle

I'd definitely be interested in instructions on how you're doing this. I have a spare machine I could dedicate to running this if I need so I guess it doesn't have to be fast as long as it works.


----------



## dlfl

Added *vSeriesGenre* and *vProducer* to the metadata file created for pyTivo.

Download ***here*** 

Don't forget to uninstall any previous version you have.


----------



## HiKent

Hi,

This program is great. A real timesaver. Is there any way to access the desktop plus functionality? In particular, it would be great if there was some way to automatically make the ipod conversion after the automatic scene cut?


----------



## dlfl

HiKent said:


> Hi,
> ........Is there any way to access the desktop plus functionality? In particular, it would be great if there was some way to automatically make the ipod conversion after the automatic scene cut?


I don't even have DT+, not that I'm so cheap but just have never had a strong desire for it.

However I have my own "special" version of TVAP that runs batch files to encode either to 320x240 WMV (for Zune) or 640x480 XVID/AVI (for pyTivo transcoding), and another user was interested in doing that.

I'm toying with the idea of letting the user provide a batch file that would be run by TVAP to further encode the file output by VRD. With this scheme IF there is a command line that would run DT+ to accomplish your ipod encoding then what you want could be done.

TVAP can automatically provide the input file name as an argument to the batch file. TVAP would look for a batch file of a certain name (e.g., TVAPpostEncode.cmd) in the destination folder for your process and run it if it was there. Thus you would have a destination folder to take your TVAP output destined for ipod encoding and put a copy of this batch file in it. The batch file could put the ipod file wherever it wanted to.

So do you or anyone know if the ipod encoding can be implemented with a command line via DT+? Or could Videora or another encoder be used in command line/batch mode? Actually I'm pretty sure ffmpeg could do this.

Is anyone else interested in such a post-encode feature?


----------



## HiKent

Thanks for the program and for getting back to me so quickly. I don't see a "batch" script in the desktop directory, but maybe there's an "exe" that will do it. I think I'll ask.

Thanks again, Kent


----------



## dlfl

From change log:

18 December 2007 Ver. 0.49
- Added "showingBits" field to pyTivo medadata text file
- Killed confusing log message about unable to add metadata.
- *Added automatic running of user-furnished post-processing batch file.*

TVAP will run a batch file of your creation after processing each .mpg file.

-- For mpeg2 outputs, if you place a batch file named *TVAPpostProcess.bat *or *TVAPpostProcess.cmd *in the final destination directory TVAP will run the batch file upon completion of VRD processing of each file output to that folder..

The filename WITHOUT the .mpg extension and without the path is passed as the argument to this batch file. *No configuration is necessary *-- if the batch file is there it will be run.

Regarding this optional user post-process batch file (TVAPpostProcess.cmd):
a.) TVAP just starts the batch and waits for it to complete.
b.) It runs in the final destination folder where it is located.
c.) TVAP has no way to know whether it completed successfully or what it did.
d.) Thus the user is responsible for making the batch file work and not crash or
hang up. And also for not spawning dangling processes that keep on running
after the batch file has exited (unless you REALLY know what you're doing!).
e.) Here is a sample batch file that shows how to add the .mpg extension to
the passed file name and verify the existence of the .mpg file:



Code:


@echo off
setlocal
set mpgName="%~1.mpg"
echo batch file : mpgName is %mpgName%
if exist %mpgName% echo file exists!
pause

@*HiKent*:
If you wish I can supply you a batch file that will create Ipod-compatible files automatically using ffmpeg. I would need to know:

1. Do you have ffmpeg already? (I can tell you how to get it -- free of course.)
2. What size and bitrate (video and audio) do you desire?
3. What folder to you want the batch to put the .mp4 files in? (Or you can edit this in yourself -- need full path).

I don't have an Ipod so there might be a little tuning required. I'm using parameters recommended by ffmpeg for Ipod file creation. I found I have to drop some of the advanced parameters to get files that play in the QuickTime player -- don't know if that is a true test of Ipod compatibility or not, but I'm quite optimistic it can be done.


----------



## dlfl

Use TVAP as before to automatically QSF and AdScan (without autocuts), thus creating a .vprj file in your AdScan destination folder.

TVAP remembers the .vprj file name and time/date stamp (via data in its xml file).

Then you manually review the edit cuts and save the .vprj file (with the same name in the same place).

TVAP detects the change in the time/date stamp (to later) of that .vprj file and then commands VRD to perform the autocut (using your modified edits) creating the final output file (in the AdScan destination folder).

Then TVAP will run the "user supplied" batch file (the feature just added in Ver. 0.49), *if* it ("TVAPpostProcess.cmd") is present in the AdScan destination folder AND if the file extension of the final-edited file is .mpg.

If desired you can do all this from within TVAP. After creating the .vprj file(s), stop processing and run GUI VRD to load and review the cuts. Then when you restart processing the auto-generation of the output file with your modified edits will occur.

If you don't want to use the post-batch file for re-encoding to MPEG4 you could just use it to transfer completed files to another folder and/or delete the .vprj files.

This will entirely automate your process (and mine too!), and you just do the manual edit reviews whenever you want.

This was a complicated mod so there may be bugs. Please let me know. I've left the previous version on the download site so you can revert to it if necessary.


----------



## dlfl

26 December 2007 Ver. 0.51
- Removed "_QSF" from .vprj file names.
- Tightened logic determining when user post-process batch is run.


----------



## MacerX

dlfl said:


> If you wish I can supply you a batch file that will create Ipod-compatible files automatically using ffmpeg. I would need to know:
> 
> 1. Do you have ffmpeg already? (I can tell you how to get it -- free of course.)
> 2. What size and bitrate (video and audio) do you desire?
> 3. What folder to you want the batch to put the .mp4 files in? (Or you can edit this in yourself -- need full path).
> 
> I don't have an Ipod so there might be a little tuning required. I'm using parameters recommended by ffmpeg for Ipod file creation. I found I have to drop some of the advanced parameters to get files that play in the QuickTime player -- don't know if that is a true test of Ipod compatibility or not, but I'm quite optimistic it can be done.


I would appreciate a sample .CMD file! I have some experience with ffmpeg from using pytivo, but my batch file experience is minimal.

I would prefer to know what you use for archiving to be sent back to pyTivo as opposed to ipod though. (I have 2 series 2 649 and 1 HD Tivo 652).

I have been burning many hours experimenting with different codecs and applications as part of a closed loop flow, but since you already seem to have this figured out, I would be thrilled to completely adopt your process and actually get back to watching some TV!!!

Thanks,
MacerX


----------



## dlfl

MacerX said:


> I would appreciate a sample .CMD file! I have some experience with ffmpeg from using pytivo, but my batch file experience is minimal.
> 
> I would prefer to know what you use for archiving to be sent back to pyTivo as opposed to ipod though. (I have 2 series 2 649 and 1 HD Tivo 652).
> 
> I have been burning many hours experimenting with different codecs and applications as part of a closed loop flow, but since you already seem to have this figured out, I would be thrilled to completely adopt your process and actually get back to watching some TV!!!
> 
> Thanks,
> MacerX


The only process I have any significant experience with produces xvid/avi files and uses dgindex and avisynth to feed a .avs stream into ffmpeg. You can of course feed the mpeg2 directly into ffmpeg. The .avs method allows an autocrop, i.e., if the video is a movie with 2.35:1 aspect it will automatically crop and produce a 640x272 output instead of 640x480. This allows faster and more efficient processing both for encoding and for pyTivo transcoding later. (You can do this cropping manually with ffmpeg arguments also but you have to manually configure it for each video.)

I also have a version that produces .mp4 files. However I've only used it twice and the second time it produced an output with bad audio sync shift. The same video processed to xvid/avi was OK. Thus I can't recommend this process (although a change of ffmpeg version or parameter changes might fix it).

And of course my process is tuned to SD, although I assume the mods to make it handle HD would not be difficult, and you can probably figure that out since you've had experience with ffmpeg already.

So I have some questions for you:
1. Is xvid/avi OK or do you have to have .mp4?
2. How do you feel about installing AviSynth and dgIndex (both free and easy to install)?

If you don't want to mess with AviSynth and dgIndex, I can either:

1. Send you my ffmpeg parameters
2. If you need the batch file logic, I will gen and test a batch file that just uses ffmpeg and send it to you.


----------



## philhu

wgw said:


> BTW, were you able to find EpisodeNumber in the tag data?
> 
> I have recorded an entire series of a show. Before I transfer them back to the TiVo, I would like to concatenate the EpisodeNumber into the title, like you did with the seriesTitle and EpisodeTitle. I would like to concatenate them in the fomat SeriesTitle+EpisodeNumber+EpisodeTitle. That way the TiVo will sort the episodes in episodeNumber order and I can easily watch them in sequence without drilling down to the Program details page to find the episode number.
> 
> If you create the standalone metadata program you mentioned in the pyTivo thread, would it be possible to create a config file that the user could modify to change how the tag data is output.


episodeNum is a valid metadata tag and DOES show up on the Tivo. I looked using the INFO button to files transferred to the tivo.

And the Tivo does sort episodes if it is there


----------



## philhu

why would someone want AVI files. MPG seem to work fine, don't they?


----------



## dlfl

philhu said:


> why would someone want AVI files. MPG seem to work fine, don't they?


xvid/avi are mpeg4 compression level, i.e., they only take 1/3 to 1/4 as much space to archive.


----------



## dlfl

philhu said:


> episodeNum is a valid metadata tag and DOES show up on the Tivo. I looked using the INFO button to files transferred to the tivo.
> 
> And the Tivo does sort episodes if it is there


Yep and my programs (linked below) process it. They also add it to the "title" metadata item in parentheses just to be helpful.


----------



## MacerX

dlfl said:


> So I have some questions for you:
> 1. Is xvid/avi OK or do you have to have .mp4?
> 2. How do you feel about installing AviSynth and dgIndex (both free and easy to install)?
> 
> If you don't want to mess with AviSynth and dgIndex, I can either:
> 
> 1. Send you my ffmpeg parameters
> 2. If you need the batch file logic, I will gen and test a batch file that just uses ffmpeg and send it to you.


1. xvid/avi is fine, I'm assuming your talking h.264 when you mention .mp4.
2. I've actually been intending to learn how to use AviSynth anyway, so this will be a good kick in the pants.

1. I would also like to see your ffmpeg parameters for reference.
2. Unfortunately, yes I will need the batch file logic. Also, can you recommend a good online reference for writing batch files?

Thanks,
MacerX

P.S. I'm on business travel so I won't be able to run anything until Friday night at the earliest.


----------



## dlfl

MacerX said:


> ...............
> P.S. I'm on business travel so I won't be able to run anything until Friday night at the earliest.


I'll get something to you by then.


----------



## dlfl

MacerX said:


> 1. xvid/avi is fine, I'm assuming your talking h.264 when you mention .mp4.
> 2. I've actually been intending to learn how to use AviSynth anyway, so this will be a good kick in the pants.
> 
> 1. I would also like to see your ffmpeg parameters for reference.
> 2. Unfortunately, yes I will need the batch file logic. Also, can you recommend a good online reference for writing batch files?
> 
> Thanks,
> MacerX
> 
> P.S. I'm on business travel so I won't be able to run anything until Friday night at the earliest.


Here is the MediaFire link to a zip package containing the batch file and instructions. Start with the BatchNotes.txt file.

Others are welcome to try this TVAPpostProcess.cmd file. You need to have AviSynth, dgIndex and ffmpeg. Here is what it's about:

This batch produces xvid/avi files and uses dgindex and avisynth to feed a .avs stream into ffmpeg. You can of course feed the mpeg2 directly into ffmpeg. The .avs method allows an autocrop, i.e., if the video is a movie with 2.35:1 aspect it will automatically crop and produce a 640x272 output instead of 640x480. This allows faster and more efficient processing both for encoding and for pyTivo transcoding later. (You can do this cropping manually with ffmpeg arguments also but you have to manually configure it for each video.) The .avs method also provides more sophisticated handling of interlacing and field order.

Edit: Changed link to new improved batch file.


----------



## MacerX

dlfl said:


> Here is the MediaFire link to a zip package containing the batch file and instructions. Start with the BatchNotes.txt file.
> 
> Others are welcome to try this TVAPpostProcess.cmd file. You need to have AviSynth, dgIndex and ffmpeg. Here is what it's about:
> 
> This batch produces xvid/avi files and uses dgindex and avisynth to feed a .avs stream into ffmpeg. You can of course feed the mpeg2 directly into ffmpeg. The .avs method allows an autocrop, i.e., if the video is a movie with 2.35:1 aspect it will automatically crop and produce a 640x272 output instead of 640x480. This allows faster and more efficient processing both for encoding and for pyTivo transcoding later. (You can do this cropping manually with ffmpeg arguments also but you have to manually configure it for each video.) The .avs method also provides more sophisticated handling of interlacing and field order.


Thank you for putting this together!

I had a few challenges that I hope are behind me now as everything seems to be working.

1)Autocrop.dll was missing and I had to downoad it seperately.
2)My folder names all had spaces in them, which appeared to be an issue.
3)I downloaded dgindex 1.4.8, but avisynth installation already included 1.5.0 of the dgdecode.dll and I did not overwrite the avisynth version with the version you included so I ended up with a version mismatch.
4)The .cmd file had 2 or 3 instances where the path was hardcoded instead of using the path at the top of the file.

When I get some more time, I'll experiment some more.

I did have a TVAP issue where I was transfering a file with tivodesktop while my wife was using he tivo, so transfer was slow, and TVAP began converting the file prematurely. Is there a way to loosen the timing parameters on TVAP to wait longer to make sure transfers are complete?


----------



## dlfl

MacerX said:


> Thank you for putting this together!
> 
> I had a few challenges that I hope are behind me now as everything seems to be working.
> 
> 1)Autocrop.dll was missing and I had to downoad it seperately.
> 2)My folder names all had spaces in them, which appeared to be an issue.
> 3)I downloaded dgindex 1.4.8, but avisynth installation already included 1.5.0 of the dgdecode.dll and I did not overwrite the avisynth version with the version you included so I ended up with a version mismatch.
> 4)The .cmd file had 2 or 3 instances where the path was hardcoded instead of using the path at the top of the file.
> 
> When I get some more time, I'll experiment some more.
> 
> I did have a TVAP issue where I was transfering a file with tivodesktop while my wife was using he tivo, so transfer was slow, and TVAP began converting the file prematurely. Is there a way to loosen the timing parameters on TVAP to wait longer to make sure transfers are complete?


Sorry for the problems but glad you got it working. I would be interested in your "debugged" batch file if you can get it to me conveniently. I prefer folder names with no spaces in them and bullet-proofing a batch file to handle spaces takes some tedious trial and error testing sometimes.

TVAP just checks the file size every five seconds and if it is non-zero and didn't change for five seconds it declares the file transferred. I have to think of what other pros and cons would be involved in increasing that time span. I would guess doubling it would be no problem but not sure about going any further than that. Doing a windows copy of a .tivo into the transfer folder can really cause problems because windows sets the file size to the total size immediately when the copy starts. Haven't thought of a reasonable way to handle that but I hope it isn't something that users will do very often. Multiple files queued for transfer in Desktop (at least ver. 2.3 that I use) work the opposite way. All the files immediately show up in the directory but with zero size, until a file starts transferring. That one was easily handled by requiring a non-zero file size.


----------



## dlfl

I believe I've addressed all the problems noted by MacerX two posts back and here is the link to download the improved batch file. I also added the AviSynth autocrop plugin that was missing.

MacerX: You asked about H264 encoding. ffmpeg doesn't encode it but does decode it, per their documentation. These xvid/avi encodings use what ffmpeg calls its mpeg4codec.

If you're interested in H264 encoding, take a look at (free) AutoMKV. You already have most of the required free software to support it.


----------



## MacerX

dlfl said:


> Sorry for the problems but glad you got it working. I would be interested in your "debugged" batch file if you can get it to me conveniently.


Looks about the same as your modified batch file.

This is the first time I tried to attach a file so hopefully it comes through OK.

Thanks again!


----------



## MacerX

dlfl said:


> MacerX: You asked about H264 encoding. ffmpeg doesn't encode it but does decode it, per their documentation. These xvid/avi encodings use what ffmpeg calls its mpeg4codec.
> 
> If you're interested in H264 encoding, take a look at (free) AutoMKV. You already have most of the required free software to support it.


I've decided to wait on h264 until I can get a new server/HTPC built. My Athlon 3000+ can become processor limited, especially on HD material with h264 or with multiple operations competing for the single core. I'm looking at dual or quad core next.


----------



## dlfl

MacerX said:


> Looks about the same as your modified batch file.
> 
> This is the first time I tried to attach a file so hopefully it comes through OK.
> 
> Thanks again!


The file came through OK and the differences do look unimportant. One exception: Search for "mp4" in your version and replace it with "avi", one place. This was my error and only makes a difference if the target encoded video file path/name already exists, in which case the batch deletes it.

You're welcome! And I hope you get some use out of it.

BTW I've been looking at the TVAP time delay and think I will increase it from 5 to 15 seconds in the next release, probably tomorrow. It will still update the file size number of files being transferred every five seconds. Thanks for the user feedback on that.


----------



## dlfl

- Increased time interval .TiVo file must have constant size to be declared "done transferring" from 5 seconds to 15 seconds. This is to reduce possible problem experienced by one user when his TiVo box was busy doing other things and DeskTop failed to transfer any bytes during a five second interval -- and TVAP decided the file was done transferring. Note this required increasing the startup delay time from 7 seconds to 18 seconds.

- Added *starRating*, *mpaaRating *and *tvRating *to metadata file.

Follow link in my signature to get download link.


----------



## wgw

Is it possible to launch VideoReDo at low priority from TVAP?


----------



## dlfl

wgw said:


> Is it possible to launch VideoReDo at low priority from TVAP?


Try substituting this special version of TVAP for your executable file. At least in my tests it runs VRD processes at "Below Normal" priority.

You can see the priority in Task Manager (View->Select Columns->Base Priority). Sort by process name in reverse alpha order and look for either "videoReDo.exe" (VRD plus) or "videoReDo3.exe" (TVSuite) while VRD is processing a file.

If this works for you, I solicit opinions from other users as to whether they want this feature permanently in the program. It makes no difference in file processing time in my tests, presumably because I'm not running any competing processes with "Normal" or higher priority.

One side effect is if you should happen to be running another instance of VRD outside TVAP, it also will be set to reduced priority.


----------



## wgw

Thanks, that works.:up:

I would prefer low priority instead of belownormal if you think it's appropriate. I am running pyTivo/ffmpeg at belownormal and don't want TVAP/AdScan to slow down ffmpeg when it's transferring to the Tivo.

I solved the problem of other VRD instances running at below normal priority by making a copy of the VRD executable, renamed it to VRD.exe, and changed my main shortcut to point to the new copy of VRD.exe. Maybe you could have TVAP copy VideoReDo.exe to TVAP-VRD.exe when TVAP is launched and run the copy in low priority instead of the original.

EDIT: Making a copy did not work so well after all. TVAP is using the last VRD executable opened, Regardless of it's file name. Oh well, maybe you can still find a way to copy it from within TVAP.


----------



## dlfl

wgw said:


> Thanks, that works.:up:
> 
> I would prefer low priority instead of belownormal if you think it's appropriate. I am running pyTivo/ffmpeg at belownormal and don't want TVAP/AdScan to slow down ffmpeg when it's transferring to the Tivo.
> 
> I solved the problem of other VRD instances running at below normal priority by making a copy of the VRD executable, renamed it to VRD.exe, and changed my main shortcut to point to the new copy of VRD.exe. Maybe you could have TVAP copy VideoReDo.exe to TVAP-VRD.exe when TVAP is launched and run the copy in low priority instead of the original.
> 
> EDIT: Making a copy did not work so well after all. TVAP is using the last VRD executable opened, Regardless of it's file name. Oh well, maybe you can still find a way to copy it from within TVAP.


TVAP is written in MS DevStudio 2005 C#. The enumeration available for setting process priority is very coarse. The next level below "Below Normal" is "Idle". Maybe that will work but it sounds drastic. Do you want to try it?

Edit: I see there is a one-to-one correspondence of the priority levels settable in Task Manager and the enumeration available in C#. Only difference is C# has "Idle" where Task Manager has "Low". I could easily add a TVAP command line argument, say /p<#> where <#> ranges from 1 (low) to 4 (above normal). Then you just edit your desired priority override into your shortcut command line.

Otherwise I will look for some other way to set priority with a finer scale.

I wonder about the advisability of running multiple simultaneous copies of VRD. Its settings, e.g., Ad Detective parameters, have only a single copy in the registry. (Thus if you change them with in one running instance, you might affect another running instance.) TVSuite and VRD Plus *do* have separate registry settings. Is this an important requirement for you? (Or for any other users reading this?). I don't want to have TVAP renaming executables -- too dangerous I think!

How are you setting your pyTivo/ffmpeg priorities? Any possibility you could set them a notch above "below normal" (but still below normal?).

I think there may be a way for TVAP to identify ONLY the instance of VRD it has launched and only change that one's priority -- will look into it.


----------



## wgw

dlfl said:


> TVAP is written in MS DevStudio 2005 C#. The enumeration available for setting process priority is very coarse. The next level below "Below Normal" is "Idle". Maybe that will work but it sounds drastic. Do you want to try it?


Yes, I think that might do it. It sounds like "Idle" is probably the same as "Low" in Task Manager. I would prefer that TVAP yield to all other processes so that I can perform more important tasks while TVAP is quietly running in the backround and only when other tasks do not require the processor.



> Edit: I see there is a one-to-one correspondence of the priority levels settable in Task Manager and the enumeration available in C#. Only difference is C# has "Idle" where Task Manager has "Low". I could easily add a TVAP command line argument, say /p<#> where <#> ranges from 1 (low) to 4 (above normal). Then you just edit your desired priority override into your shortcut command line.


That works for me. Sounds like that might be the most effective implementation. Unless it would be easier to add a dropdown box within the GUI for the user to select the priority of processes launched by TVAP.



> Otherwise I will look for some other way to set priority with a finer scale.


A range of 1 to 4 should be sufficient. Whatever is easiest.



> I wonder about the advisability of running multiple simultaneous copies of VRD. Its settings, e.g., Ad Detective parameters, have only a single copy in the registry. (Thus if you change them with in one running instance, you might affect another running instance.) TVSuite and VRD Plus *do* have separate registry settings. Is this an important requirement for you? (Or for any other users reading this?). I don't want to have TVAP renaming executables -- too dangerous I think!


I was suggesting making a copy of the executable rather than renaming, but I definitely agree that that is only a last resort if another solution is possible.

I frequently run multiple instances. While TVAP is doing an adscan, I open the previous adscan project and edit the cut points. When I'm done, I save the project. TVAP then sees that the old vprj has changed when it finishes the current adscan and immediately cuts and saves the project I just edited. An excellent feature I might add. Editing a project does not require too much processor so it does not affect the TVAP adscan running in the backround too much.

I can't comment on the separate settings for VRD and TVSuite. I have not upgraded to the latter yet. But will probably do so soon.



> How are you setting your pyTivo/ffmpeg priorities? Any possibility you could set them a notch above "below normal" (but still below normal?).


I run pyTivo in belownormal priority using a batch file containing the following command.



Code:


start /belownormal /b c:\python25\python.exe f:\pyTivo\pytivo.py -i input.dat

OR, by using this method upon Windows startup:
http://www.tivocommunity.com/tivo-vb/showthread.php?p=5662566#post5662566
But I no longer run 5 servers as I mentioned in that post. The recent enhancements I made for pyTivo helped create the new HD compatible version of pyTivo server I was searching for. Boy, I can't believe I was running 5 servers. EEK! Seems like ages ago and I learned a lot since then. Kind of embarrasing to go back and read some of the mistakes I made.



> I think there may be a way for TVAP to identify ONLY the instance of VRD it has launched and only change that one's priority -- will look into it.


Sounds good. Thanks for everything dlfl!


----------



## dlfl

- Added command line option -p<#> to set priority of VRD processes.
0 = low, 1 = below normal, 2 = normal. TVAP defaults to below normal

- Added logic to prevent any possibility of writing empty DisplayMajorNumber item to pyTivo metadata file.

TVAP should *only* set the priority of the VRD processes *it *is controlling.

To add the CL arg to a shortcut, add it after the program path in the shortcut properties, target entry. Do not add it *inside* the quotation marks and *do* put a space between it and what is already there.

*Note: *An example CL arg is: -p1 
There should be no space between the -p and the number.

The priority-setting feature has not been tested on Vista. If you have admin privileges it probably will work fine. Otherwise there are several possibilities:

1. It will still work fine.
2. It won't complain but just won't set priority.
3. It will bring up a message of some kind.

Let me know what you observe. You can see priority in Task Manager by configuring the Base Priority column in its process display.

I have seen three different process names for VRD:

videoredo3.exe
videoredo.exe
VIDEOR~1.exe (name mangling for DOS 8.3 filenames ??)

My computer just suddenly starting using the third one instead of the second one for no apparent reason at all. I think TVAP will handle it OK.


----------



## dlfl

dlfl said:


> I believe I've addressed all the problems noted by MacerX two posts back and here is the link to download the improved batch file. I also added the AviSynth autocrop plugin that was missing.
> ..........


I see a few people have downloaded this xvid/avi TVAP post-process batch file package so just wanted to warn them of a problem I've seen with recent versions of ffmpeg.

I used the batch file to encode a 3.3 hr mpeg2 file and found it had bad audio sync -- OK at the start but audio lagging video by about 3 sec at the end. This occured with ffmpeg versions r11143 or r11562.

Version r8047 on the same input produced no sync problem.

So I created a clip of the first 30 min of the file (long enough to detect the audio lag) and did a binary search with encodings using the 14 versions available at http://ffdshow.faireal.net/mirror/ffmpeg/ between r8047 and r11143. I determined the problem appears after r9767 and before (or starting with) r10141.

A couple of other changes occured with more recent versions:
1. "-acodec mp3" has to be replaced with "-acodec libmp3lame"
2. "-ab 128" needs a k added: "-ab 128k"

The linked batch file was for r8047 so these changes may have to be incorporated if you use a later version. (ffmpeg won't start encoding and tells you the problem if you don't get them right.)

I've reported my audio sync findings to the ffmpeg user list -- we'll see what comes of that.

BTW my test movie was "Dr. Zhivago" -- what a film


----------



## wgw

dlfl,

Would you mind trying the -copyts option with r11143 and your test file to see if it fixes the audio sync without producing any other problems? I'm wondering if this option might be a possible solution that can be added to pyTivo.


----------



## dlfl

wgw said:


> dlfl,
> 
> Would you mind trying the -copyts option with r11143 and your test file to see if it fixes the audio sync without producing any other problems? I'm wondering if this option might be a possible solution that can be added to pyTivo.


I tried this with r11143 and r11562. In both cases it tried to start encoding, and parameters for input and output tracks looked normal, but within a few seconds there was the well known windows error message.

I suspect there could be a conflict with feeding ffmpeg via aviSynth and this option. This would not apply to pyTivo usage of course.

Too bad -- a fix would have been nice.


----------



## dlfl

HandBrake is free easy-to-use transcoding software I just became aware of, thanks to *goodtrip* in this thread.

It seems to be getting popular and it has a CLI so it's a candidate for being called from a user-supplied TVAP post-processing batch file. Based on my *initial *tests it looks good.

I encoded the same 3.3 hr mpeg2 (used in my ffmpeg tests a few posts earlier) to the same specs I usually use for post-processing, i.e., mpeg4 video, mp3 audio, .avi container, and it did a comparable job. Audio sync was good and it auto-cropped perfectly for the 2.35:1 aspect ratio. Encoding speed was blazingly fast.

The HB approach is much simpler than my previous approach and removes any concerns about which version of ffmpeg will work. The CLI method requires only one .exe file and one .dll file for HB and a single line TVAPpostProcess.cmd file. Here is the CL I used:

"C:\Program Files\Handbrake\hbcli.exe" -i "J:\path\Input Video.mpg" -o "J:\path\output video.avi" -e ffmpeg -E lame -w 640 -m -b 900 -B 128 -R 48 -v

I didn't have to compose this CL. The Windows gui version of HB lets you set up an encoding then copy the command line it generates to your clipboard.
The command line arguments are documented here.
My example CL was for my mediocre quality SD TV, thus the width of 640 ("-w 640") and the bitrate of 900 kbps ("-b 900"). Note that autocropping is default -- doesn't require a CL option. (You can manually crop if desired.)

If you want to try it just download the windows gui package and install it. The CLI executable and required cygwin1.dll are included in that package since all the GUI does is set up CL args for the .exe and run it.

I need more mileage on this before blessing it, but if it holds up I'm thinking about putting together several HB-based TVAP post processing batch files to distribute with TVAP, each for a different "profile" (starting with the one given above for SD TV). TVAP users with different encoding needs could help with this by testing CL's for their target(s) and posting them.

One fly in the HB ointment could be handling different interlace conditions. The aviSynth method I've previously used is *presumably *more robust although HB also has CL options for deinterlace, telecine, etc. (but these must be set manually). So far all I can say is it handled one huge video just fine.


----------



## dlfl

I've put a TVAP post-process batch file using Handbrake, and instructions, in this MediaFire download.

I'm using/testing it myself so keep your fire extinguisher handy.


----------



## msmart

> TVAP users with different encoding needs could help with this by testing CL's for their target(s) and posting them.


Here's what I came up using Handbrake's "*iPod Low-Rez*" preset, with two exceptions, lowering the video bitrate to 384 and frame rate to 25 (to match what I use in SUPER).

"C:\Program Files\Handbrake\hbcli" -i "G:\path\Input Video.mpg" -o "G:\path\Output Video.m4v" -e x264b30 -E faac -w 320 -b 384 -r 25 -x keyint=300:keyint-min=30:bframes=0:cabac=0:ref=1:vbv-maxrate=384:vbv-bufsize=2000:analyse=all:me=umh:subme=6:no-fast-pskip=1 -B 160 -R 48

After one test CLI run: Handbrake positive vs SUPER, video is cropped so black border from TiVo files are gone. Handbrake negative vs SUPER, Handbrake uses more CPU.

However, since not every show I process via TVAP will be destined for the iPod, I'm not sure if I'll want to add a Handbrake script to a post-processing batch file. On the other hand, I could let it run then just delete the ones I don't want.


----------



## msmart

dl, you have a typo in your Handbrake post-process batch file, the "set metafile" statement towards the bottom uses a variable of "outdir2" that isn't previously defined. It should be just "outdir".

Back to my thought of not wanting every show to be processed by the post-process batch file...

Is there any way to add a "Post-Process" option flag to the default options list? The thought is that after I kick off a TTG transfer, I would restore TVAP and deselect the Post Process option for the shows I don't want post-processed. If not through the GUI, I wouldn't mind editing the TivoFileManager file changing (the hoped for) <PostProcess>true</PostProcess> variable to false.

Possible?


----------



## dlfl

msmart said:


> dl, you have a typo in your Handbrake post-process batch file, the "set metafile" statement towards the bottom uses a variable of "outdir2" that isn't previously defined. It should be just "outdir".


Yes, sorry. Glad you had your fire extinguisher handy! And thanks for the IPod Handbrake command line!



msmart said:


> Is there any way to add a "Post-Process" option flag to the default options list? The thought is that after I kick off a TTG transfer, I would restore TVAP and deselect the Post Process option for the shows I don't want post-processed. ......


Yes, I will add that to the next release, in a few days. I'm thinking of a "Do Postprocess" check box in the per-file settings. It would default to checked (although nothing would happen if the batch file wasn't in place). Or maybe a "No postprocess" check box that defaults to unchecked. (???).


----------



## msmart

Thank you.


> I'm thinking of a "Do Postprocess" check box in the per-file settings. It would default to checked (although nothing would happen if the batch file wasn't in place).


That's my vote as the others start off with Do... Default to checked, yes.


> And thanks for the IPod Handbrake command line!


You're welcome. I'm glad to help in what little way I can.

BTW, *Contratulations on 10,000+ Views!!*


----------



## dlfl

29 January 2008 Ver. 0.54
- Added Do post-process check box to per-file settings. Defaults to checked.
If checked, optional user-supplied TVAPpostProcess.cmd file will be run on
the completed mpeg2 file.

Now you can control which files are post-processed. If you don't have a post-process batch file in place, nothing will happen and it doesn't matter whether the new check box is checked.

For download follow TVAP link in my signature below.


----------



## msmart

> Now you can control which files are post-processed.


This is GREAT!!! It works just as I asked. Thank you for this added feature.


----------



## dlfl

4 February 2008 Ver. 0.55
- Fixed: Always ran user-supplied TVAPpostProcess.cmd file after manual review of .vprj file, ignoring Do post process checkbox setting.

And thanks to *msmart* for calling this to my attention!


----------



## dlfl

Here is the mediafire.com link to a new and improved TVAPpostProcess.cmd file for creating SD AVI files using Handbrake.

Improvements are:
1. The '&' character in video file name no longer breaks the batch.
2. Corrected "outdir2" typo near end.


----------



## dlfl

5 February 2008 Ver. 0.56
- If your TVAPpostProcess.cmd uses Handbrake (hbcli.exe), its priority will be set to the same level as VRD processes, per the TVAP -p# command line option. (See Ver. 0.53 info in TVAPreadme.txt for priority setting.)
Note side effect: Any other instances of hbcli.exe running when your batch starts will also be set to this priority.

- Installer no longer removes Desktop shortcut on uninstall, and upon installation offers "Don't create a start menu folder" option which, if checked will not create a new shortcut -- thus preserving any -p# option you had edited into the shortcut target line.
Side effect: The start menu entry is also not created if this option is checked.

Note you can delete any shortcut by selecting it and hitting Shift-Del (in case you uninstall TVAP and want to get rid of the shortcut).


----------



## dlfl

If you've wondered about when or whether to use QSF, take a look at *this thread* on the VideoReDo forum.


----------



## dlfl

Handbrake 0.9.2 was released 19 Feb and everything in it has changed. I haven't tried it yet but here are several immediate comments/suggestions:

1. If you are already happily using the previous version, don't be too quick to install over it. When you run the Windows installer, modify the installation directory, e.g., ...../HandBrake92 instead of ...../HandBrake. Then you can have both versions. Note the installer will automatically update the desktop shortcut to point to the latest version.

2. The name of the command-line program has changed from hbcli.exe to HandBrakeCLI.exe. (It was already HandBrakeCLI.exe in the command-line-only distribution, and appeared to be the identical file.) This means you need to change the program name in your batch file(s). This also means TVAP will have to be modified so it will set process priority for that name. (Does not break Ver. 0.56, just means the priority setting won't work on HandBrake processes until I fix it.)

3. Changes to the GUI and CLI version appear to be substantial. There is an option to invoke the presets in the CLI now.


----------



## dlfl

24 February 2008 Ver. 0.57
- Handles process priority setting of new Ver. 0.9.2 Handbrake CLI executable name ("HandBrakeCLI.exe") in user TVAPpostProcess.cmd batch file. Continues to handle old executable name ("hbcli.exe").

Reminder: You can download a TVAPpostProcess.cmd file that uses HandBrake to create xvid/avi encodings of your VRD-processed mpeg2 files at this mediafire.com link. On an initial test, it appears to work as-is with the new HandBrake CLI version, if you edit in the right .exe name.


----------



## jetJock3315

Thanks for the great app and the support you've offered though the forum.

Is there an automated way to remove the QSF files after processing? I have the "Delete TIVO" box checked and that file is properly deleted but I now have both the intended file *.DVR-MS in my Recorded TV folder, but the *_QSF.DVR-MS exist in its working folder as well. No doubt there is Post-process script I could figure out, but I though I would check to make sure I hadn't overlooked a required setting.

Thanks for your time.


----------



## dlfl

jetJock3315 said:


> Thanks for the great app and the support you've offered though the forum.
> 
> Is there an automated way to remove the QSF files after processing? I have the "Delete TIVO" box checked and that file is properly deleted but I now have both the intended file *.DVR-MS in my Recorded TV folder, but the *_QSF.DVR-MS exist in its working folder as well. No doubt there is Post-process script I could figure out, but I though I would check to make sure I hadn't overlooked a required setting.
> 
> Thanks for your time.


First, welcome to the forum.

At present you would have to do this in TVAPpostProcess.cmd. However I'm thinking about making deletion of the QSF file automatic after AdScan cuts are applied (either after manual edit of the .vprj or after auto-cut).

There could be situations where you might want to keep the QSF file, I imagine. Or I could try to squeeze in another checkbox for "Delete QSF" so you could have it either way.

User opinions are invited!


----------



## wgw

I love lots of boxes, gimme more.

Seriously though, that would be nice feature. I run out of disk space frequently when processing lots of HD files.


----------



## msmart

> User opinions are invited!


OK, you asked for it...

Yes, a check box, but place it in the "Settings for Selected File" section so we can pick and choose which files to delete rather than a default setting.

Speaking of picking and choosing, presently, after files are QSFed and Scanned, they disappear from the Transferred Status window. I would like to keep them there until after I edit the .vprj file and Auto Cut is run. This way we'll have the opportunity to check/uncheck Do Post Process (and the new Delete QSF)


----------



## dlfl

msmart said:


> ......... presently, after files are QSFed and Scanned, they disappear from the Transferred Status window. I would like to keep them there until after I edit the .vprj file and Auto Cut is run. This way we'll have the opportunity to check/uncheck Do Post Process (and the new Delete QSF)


I assume by "Transferred Status Window" you mean the "Transferred TiVo Files" list (?). Also I assume you have Delete TiVos checked (?). (Files will stay on the list as long as the .tivo file remains in the transfer folder.) However there was no intent to allow the user to change the Do Postprocess status after the adscan (without autocuts) was completed. Currently TVAP sets status of such files as COMPLETED, even though a subsequent manually edited cut and postprocess may occur. This resulted because these two features were patched on rather than designed in from the start.

I'll look into doing what I think you want, i.e., allowing you to change the do postprocess status after the .vprj file has been created and before you have manually edited the cuts. And this will of course require keeping the file on the file list until after all processing has been done, even if Delete Tivos is checked.

Is this what you had in mind?


----------



## dlfl

- Files waiting for manual editing/cuts now remain on the file list, even if the TiVo file
has been deleted. The Status for these is "AWAITING CUTS". This allows you to change the
Do Postprocess and Delete QSF settings for the file.
If the Tivo file is gone and you click the Reset button, you get a dialog offering to
let you remove the file from the list -- which will also mean it is no longer waiting for
manual editing/cuts.

- *Two delete QSF buttons:* Default Settings and per-file. If your process includes QSF followed
by AdScan (with or without autocuts), the intermediate QSF file will be deleted after all 
processing on the file is done -- including manual cuts and post-process batch file.

Since this change added new elements to the XML data file, you will get the initial startup message about can't find a valid file. You can avoid this with some editing work on the file:

1. Add this line:

<DeleteQsfFiles>true</DeleteQsfFiles>

Anywhere in the <ConfigurationItems> section.

2. Add this line:

<DeleteQSF>true</DeleteQSF>

anywhere in *each* <TivoFileData> section.

Of course you can change "true" to "false" per your preferences.

I've done a fair amount of testing but with all the possible combinations of file types, sequences and settings it's not practical to do exhaustive testing. So I won't be surprised if you find a bug or two. Please try to furnish a detailed description if you find one.


----------



## msmart

YES!!! That's exactly what I wanted. Thank you again.



> Since this change added new elements to the XML data file, you will get the initial startup message about can't find a valid file. You can avoid this with some editing work on the file:
> 
> 1. Add this line:
> 
> <DeleteQsfFiles>true</DeleteQsfFiles>
> 
> Anywhere in the <ConfigurationItems> section.
> 
> 2. Add this line:
> 
> <DeleteQSF>true</DeleteQSF>
> 
> anywhere in each <TivoFileData> section.
> 
> Of course you can change "true" to "false" per your preferences.


Slight change: Add item 1, launch TVAP, start processing, stop processing, close TVAP, add item 2.

I did both before launching 0.58, but found that after closing TVAP, the <DeleteQSF> entries were deleted so I had to add them back in. I had about 8 shows that were waiting when I upgraded from 0.56. The shows don't appear in the Transferred TiVo Files window but I would expect that because of the upgrade but the File Manager file knows about them so I'm sure they'll process as expected.

*Added:* Okay, did one short show and it DID work as expected. However, don't close TVAP or the <DeleteQSF> entries will get deleted from the waiting shows (I forgot to change the variable to false). But this should only happen to shows that were already waiting when TVAP was upgraded. I know this won't happen to new shows processed by TVAP v0.58 from the start. I just thought I would mention this little caveat for those that may also upgrade with files waiting.

Thanks again dlfl for the quick implementation of our requests.


----------



## jetJock3315

Wow! What service.

It installed clean and I'm sure it will work great with the next show that gets pulled of the Tivo.

This is truely a great tool to help process and distibute my recorded shows to any location I want to watch them from - the way all media should be enjoyed!


----------



## Clusty

Is there a way to automate a mpeg2 to mp4 after I run the .tivo through VideoReDo with this automation?


----------



## dlfl

Clusty said:


> Is there a way to automate a mpeg2 to mp4 after I run the .tivo through VideoReDo with this automation?


Definitely, using a TVAPpostProcess.cmd batch file. See ***this post***. for example. Download HandBrake and find a profile that generates the kind of mp4 you want. Then get the command line and insert it in the TVAPpostProcess.cmd file. The example batch file linked in the referenced post generates XVID/AVI, which is one type of mpeg4. But HandBrake will also generate .mp4, including H264 encodings. The readme file for TVAP details how the user-supplied TVAPpostProcess.cmd file works.


----------



## dlfl

Just to let you know I'm aware of issues that HD TiVo users have had with QSF failing on multi-dimensioned videos that can result from TTG transfers. These failures put the kabosh on TVAP's automatic processing flow.

There is hope for an automatic solution and I'm on the case. But I can't predict how soon it will happen. (The cleanest approach requires a new COM function from VRD that will determine the dominant dimensions so the QSF filter dimensions can be preset. They are considering doing it.)

If you want the gory details see the TVAP thread in the VRD forum , starting at post #63.

Also:

I just learned that TVSuite apparently has a better QSF function than Plus, per this thread in the VRD forum. I think VRD plans to update the Plus version but it's not clear how soon.

Reminder:
If you have both Plus and TVS installed, TVAP uses whichever one you last had open in the normal manual GUI mode for its automated VRD processing. I don't know how to get around this. There is a log message each timeTVAP starts a VRD process that tells you what version is being used.


----------



## dlfl

Concerning the TVAPpostProcess.cmd file available *at this link*:

*Changes due to new Handbrake version (9.2, released 19 Feb 2008):*

1. The name of the executable must be changed from hbcli.exe to HandBrakeCLI.exe .

2. The fourCC values inserted in the .avi file have changed from divx/DX50 to fmp4/FMP4. Per my testing these do not bother either ffmpeg (e.g., as used by pyTivo) or the VLC software player. OP have reported player compatibility issues and there is free software that allows you to change the fourCC codes. For more details see *this thread in the HandBrake forum*.

*Correction: *:

I've described the downloadable post-process file as creating XVID/AVI files. This is incorrect -- it creates MPEG4/AVI files using the ffmpeg MPEG4 video codec (which has the fourcc of FMP4). If you read the forum thread linked above you will see this is not a major distinction in many cases.

I have noted that if you specify XVID encoding in Handbrake 9.2 the encoding process runs MUCH slower. I guess I fall into the "blind" category as I still haven't seen the significant advantages of the encodings that take several times the video length over the fast ones that take much less than the video length (e.g. those using the MPEG4 encoder selection in Handbrake, single pass). But then I'm viewing SD videos via pyTivo on a SD 27" CRT TV.


----------



## blah238

thanks for a great program dlfl.

two issues though:

1) i am having a problem with metadata, specifically TVAP doesn't seem to be finding any. I'm using TiVo Desktop 2.6.1, VideoRedo TVSuite 3.1.4.549 and TVAP 0.58.

I have a Series2 40hr TiVo, serial starting w/ 540. I am using TiVo Desktop to auto-transfer several series, and everything seems to work swimmingly, except there is no metadata when I right click a file in TVAP's list, and in the log it simply says "No metadata found" for the .tivo file of every episode of every show it's processed so far. Here is my log up to now:



Code:


4/13/2008 5:23:50 AM Found no starting log file - starting new one.
4/13/2008 5:23:50 AM Started program
4/13/2008 5:50:33 AM Started QSF, input: MythBusters - ''MacGyver Myths'' (Recorded Feb 20, 2008, DSC)
4/13/2008 5:50:34 AM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 5:50:44 AM VideoReDo completed QSF, creating: E:\Video\TiVo\MythBusters - ''MacGyver Myths'' (Recorded Feb 20, 2008, DSC)_QSF.dvr-ms
4/13/2008 5:50:44 AM No metadata found for: MythBusters - ''MacGyver Myths'' (Recorded Feb 20, 2008, DSC).TiVo
4/13/2008 5:50:44 AM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 5:50:44 AM Started Ad Scan/auto-cuts, input: MythBusters - ''MacGyver Myths'' (Recorded Feb 20, 2008, DSC)
4/13/2008 5:50:44 AM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 5:51:12 AM VideoReDo completed ADSCAN, creating: E:\Video\TiVo\MythBusters - ''MacGyver Myths'' (Recorded Feb 20, 2008, DSC).dvr-ms
4/13/2008 5:51:12 AM No metadata found for: MythBusters - ''MacGyver Myths'' (Recorded Feb 20, 2008, DSC).TiVo
4/13/2008 5:51:12 AM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 5:51:12 AM Deleted QSF: E:\Video\TiVo\MythBusters - ''MacGyver Myths'' (Recorded Feb 20, 2008, DSC)_QSF.dvr-ms
4/13/2008 5:51:12 AM Deleted .TiVo file: MythBusters - ''MacGyver Myths'' (Recorded Feb 20, 2008, DSC)
4/13/2008 7:02:15 AM Started QSF, input: Family Guy - ''Play It Again, Brian'' (Recorded Mar 2, 2008, KTBC)
4/13/2008 7:02:15 AM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 7:02:47 AM VideoReDo completed QSF, creating: E:\Video\TiVo\Family Guy - ''Play It Again, Brian'' (Recorded Mar 2, 2008, KTBC)_QSF.dvr-ms
4/13/2008 7:02:47 AM No metadata found for: Family Guy - ''Play It Again, Brian'' (Recorded Mar 2, 2008, KTBC).TiVo
4/13/2008 7:02:47 AM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 7:02:47 AM Started Ad Scan/auto-cuts, input: Family Guy - ''Play It Again, Brian'' (Recorded Mar 2, 2008, KTBC)
4/13/2008 7:02:48 AM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 7:04:34 AM VideoReDo completed ADSCAN, creating: E:\Video\TiVo\Family Guy - ''Play It Again, Brian'' (Recorded Mar 2, 2008, KTBC).dvr-ms
4/13/2008 7:04:34 AM No metadata found for: Family Guy - ''Play It Again, Brian'' (Recorded Mar 2, 2008, KTBC).TiVo
4/13/2008 7:04:34 AM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 7:04:34 AM Deleted QSF: E:\Video\TiVo\Family Guy - ''Play It Again, Brian'' (Recorded Mar 2, 2008, KTBC)_QSF.dvr-ms
4/13/2008 8:17:45 AM Started QSF, input: MythBusters - ''MacGyver Myths'' (Recorded Feb 20, 2008, DSC)
4/13/2008 8:17:47 AM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 8:18:49 AM VideoReDo completed QSF, creating: E:\Video\TiVo\MythBusters - ''MacGyver Myths'' (Recorded Feb 20, 2008, DSC)_QSF.dvr-ms
4/13/2008 8:18:49 AM No metadata found for: MythBusters - ''MacGyver Myths'' (Recorded Feb 20, 2008, DSC).TiVo
4/13/2008 8:18:49 AM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 8:18:49 AM Started Ad Scan/auto-cuts, input: MythBusters - ''MacGyver Myths'' (Recorded Feb 20, 2008, DSC)
4/13/2008 8:18:49 AM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 8:21:42 AM VideoReDo completed ADSCAN, creating: E:\Video\TiVo\MythBusters - ''MacGyver Myths'' (Recorded Feb 20, 2008, DSC).dvr-ms
4/13/2008 8:21:42 AM No metadata found for: MythBusters - ''MacGyver Myths'' (Recorded Feb 20, 2008, DSC).TiVo
4/13/2008 8:21:42 AM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 8:21:42 AM Deleted QSF: E:\Video\TiVo\MythBusters - ''MacGyver Myths'' (Recorded Feb 20, 2008, DSC)_QSF.dvr-ms
4/13/2008 9:32:20 AM Started QSF, input: Dirty Jobs - ''Buoy Cleaner'' (Recorded Feb 24, 2008, DSC)
4/13/2008 9:32:21 AM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 9:33:01 AM VideoReDo completed QSF, creating: E:\Video\TiVo\Dirty Jobs - ''Buoy Cleaner'' (Recorded Feb 24, 2008, DSC)_QSF.dvr-ms
4/13/2008 9:33:01 AM No metadata found for: Dirty Jobs - ''Buoy Cleaner'' (Recorded Feb 24, 2008, DSC).TiVo
4/13/2008 9:33:01 AM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 9:33:01 AM Started Ad Scan/auto-cuts, input: Dirty Jobs - ''Buoy Cleaner'' (Recorded Feb 24, 2008, DSC)
4/13/2008 9:33:02 AM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 9:36:00 AM VideoReDo completed ADSCAN, creating: E:\Video\TiVo\Dirty Jobs - ''Buoy Cleaner'' (Recorded Feb 24, 2008, DSC).dvr-ms
4/13/2008 9:36:00 AM No metadata found for: Dirty Jobs - ''Buoy Cleaner'' (Recorded Feb 24, 2008, DSC).TiVo
4/13/2008 9:36:00 AM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 9:36:00 AM Deleted QSF: E:\Video\TiVo\Dirty Jobs - ''Buoy Cleaner'' (Recorded Feb 24, 2008, DSC)_QSF.dvr-ms
4/13/2008 10:42:48 AM Started QSF, input: Dirty Jobs - ''Brown Plate Special'' (Recorded Feb 26, 2008, DSC)
4/13/2008 10:42:49 AM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 10:43:47 AM VideoReDo completed QSF, creating: E:\Video\TiVo\Dirty Jobs - ''Brown Plate Special'' (Recorded Feb 26, 2008, DSC)_QSF.dvr-ms
4/13/2008 10:43:47 AM No metadata found for: Dirty Jobs - ''Brown Plate Special'' (Recorded Feb 26, 2008, DSC).TiVo
4/13/2008 10:43:47 AM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 10:43:47 AM Started Ad Scan/auto-cuts, input: Dirty Jobs - ''Brown Plate Special'' (Recorded Feb 26, 2008, DSC)
4/13/2008 10:43:48 AM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 10:47:03 AM VideoReDo completed ADSCAN, creating: E:\Video\TiVo\Dirty Jobs - ''Brown Plate Special'' (Recorded Feb 26, 2008, DSC).dvr-ms
4/13/2008 10:47:03 AM No metadata found for: Dirty Jobs - ''Brown Plate Special'' (Recorded Feb 26, 2008, DSC).TiVo
4/13/2008 10:47:03 AM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 10:47:03 AM Deleted QSF: E:\Video\TiVo\Dirty Jobs - ''Brown Plate Special'' (Recorded Feb 26, 2008, DSC)_QSF.dvr-ms
4/13/2008 11:42:38 AM Started QSF, input: Survivorman - ''Mountain'' (Recorded Mar 9, 2008, DSC)
4/13/2008 11:42:39 AM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 11:43:11 AM VideoReDo completed QSF, creating: E:\Video\TiVo\Survivorman - ''Mountain'' (Recorded Mar 9, 2008, DSC)_QSF.dvr-ms
4/13/2008 11:43:11 AM No metadata found for: Survivorman - ''Mountain'' (Recorded Mar 9, 2008, DSC).TiVo
4/13/2008 11:43:11 AM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 11:43:11 AM Started Ad Scan/auto-cuts, input: Survivorman - ''Mountain'' (Recorded Mar 9, 2008, DSC)
4/13/2008 11:43:11 AM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 11:45:52 AM VideoReDo completed ADSCAN, creating: E:\Video\TiVo\Survivorman - ''Mountain'' (Recorded Mar 9, 2008, DSC).dvr-ms
4/13/2008 11:45:52 AM No metadata found for: Survivorman - ''Mountain'' (Recorded Mar 9, 2008, DSC).TiVo
4/13/2008 11:45:52 AM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 11:45:52 AM Deleted QSF: E:\Video\TiVo\Survivorman - ''Mountain'' (Recorded Mar 9, 2008, DSC)_QSF.dvr-ms
4/13/2008 12:42:39 PM Started QSF, input: Survivorman - ''African Plains'' (Recorded Mar 9, 2008, DSC)
4/13/2008 12:42:41 PM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 12:43:12 PM VideoReDo completed QSF, creating: E:\Video\TiVo\Survivorman - ''African Plains'' (Recorded Mar 9, 2008, DSC)_QSF.dvr-ms
4/13/2008 12:43:12 PM No metadata found for: Survivorman - ''African Plains'' (Recorded Mar 9, 2008, DSC).TiVo
4/13/2008 12:43:12 PM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 12:43:12 PM Started Ad Scan/auto-cuts, input: Survivorman - ''African Plains'' (Recorded Mar 9, 2008, DSC)
4/13/2008 12:43:13 PM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 12:45:51 PM VideoReDo completed ADSCAN, creating: E:\Video\TiVo\Survivorman - ''African Plains'' (Recorded Mar 9, 2008, DSC).dvr-ms
4/13/2008 12:45:51 PM No metadata found for: Survivorman - ''African Plains'' (Recorded Mar 9, 2008, DSC).TiVo
4/13/2008 12:45:51 PM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 12:45:51 PM Deleted QSF: E:\Video\TiVo\Survivorman - ''African Plains'' (Recorded Mar 9, 2008, DSC)_QSF.dvr-ms
4/13/2008 1:41:47 PM Started QSF, input: Survivorman - ''Arctic'' (Recorded Apr 4, 2008, DSC)
4/13/2008 1:41:49 PM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 1:42:20 PM VideoReDo completed QSF, creating: E:\Video\TiVo\Survivorman - ''Arctic'' (Recorded Apr 4, 2008, DSC)_QSF.dvr-ms
4/13/2008 1:42:20 PM No metadata found for: Survivorman - ''Arctic'' (Recorded Apr 4, 2008, DSC).TiVo
4/13/2008 1:42:20 PM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 1:42:20 PM Started Ad Scan/auto-cuts, input: Survivorman - ''Arctic'' (Recorded Apr 4, 2008, DSC)
4/13/2008 1:42:21 PM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 1:45:00 PM VideoReDo completed ADSCAN, creating: E:\Video\TiVo\Survivorman - ''Arctic'' (Recorded Apr 4, 2008, DSC).dvr-ms
4/13/2008 1:45:00 PM No metadata found for: Survivorman - ''Arctic'' (Recorded Apr 4, 2008, DSC).TiVo
4/13/2008 1:45:00 PM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 1:45:00 PM Deleted QSF: E:\Video\TiVo\Survivorman - ''Arctic'' (Recorded Apr 4, 2008, DSC)_QSF.dvr-ms
4/13/2008 2:44:14 PM Started QSF, input: The Sopranos - ''The Legend of Tennessee Moltisanti'' (Recorded Apr 9, 2008, AETV)
4/13/2008 2:44:15 PM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 2:44:47 PM VideoReDo completed QSF, creating: E:\Video\TiVo\The Sopranos - ''The Legend of Tennessee Moltisanti'' (Recorded Apr 9, 2008, AETV)_QSF.dvr-ms
4/13/2008 2:44:47 PM No metadata found for: The Sopranos - ''The Legend of Tennessee Moltisanti'' (Recorded Apr 9, 2008, AETV).TiVo
4/13/2008 2:44:47 PM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 2:44:47 PM Started Ad Scan/auto-cuts, input: The Sopranos - ''The Legend of Tennessee Moltisanti'' (Recorded Apr 9, 2008, AETV)
4/13/2008 2:44:48 PM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 2:47:34 PM VideoReDo completed ADSCAN, creating: E:\Video\TiVo\The Sopranos - ''The Legend of Tennessee Moltisanti'' (Recorded Apr 9, 2008, AETV).dvr-ms
4/13/2008 2:47:34 PM No metadata found for: The Sopranos - ''The Legend of Tennessee Moltisanti'' (Recorded Apr 9, 2008, AETV).TiVo
4/13/2008 2:47:34 PM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 2:47:34 PM Deleted QSF: E:\Video\TiVo\The Sopranos - ''The Legend of Tennessee Moltisanti'' (Recorded Apr 9, 2008, AETV)_QSF.dvr-ms
4/13/2008 3:43:57 PM Started QSF, input: The Sopranos - ''Boca'' (Recorded Apr 10, 2008, AETV)
4/13/2008 3:43:58 PM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 3:44:27 PM VideoReDo completed QSF, creating: E:\Video\TiVo\The Sopranos - ''Boca'' (Recorded Apr 10, 2008, AETV)_QSF.dvr-ms
4/13/2008 3:44:27 PM No metadata found for: The Sopranos - ''Boca'' (Recorded Apr 10, 2008, AETV).TiVo
4/13/2008 3:44:27 PM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 3:44:27 PM Started Ad Scan/auto-cuts, input: The Sopranos - ''Boca'' (Recorded Apr 10, 2008, AETV)
4/13/2008 3:44:28 PM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 3:47:16 PM VideoReDo completed ADSCAN, creating: E:\Video\TiVo\The Sopranos - ''Boca'' (Recorded Apr 10, 2008, AETV).dvr-ms
4/13/2008 3:47:16 PM No metadata found for: The Sopranos - ''Boca'' (Recorded Apr 10, 2008, AETV).TiVo
4/13/2008 3:47:16 PM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 3:47:16 PM Deleted QSF: E:\Video\TiVo\The Sopranos - ''Boca'' (Recorded Apr 10, 2008, AETV)_QSF.dvr-ms
4/13/2008 4:43:39 PM Started QSF, input: The Sopranos - ''A Hit Is a Hit'' (Recorded Apr 11, 2008, AETV)
4/13/2008 4:43:40 PM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 4:44:11 PM VideoReDo completed QSF, creating: E:\Video\TiVo\The Sopranos - ''A Hit Is a Hit'' (Recorded Apr 11, 2008, AETV)_QSF.dvr-ms
4/13/2008 4:44:11 PM No metadata found for: The Sopranos - ''A Hit Is a Hit'' (Recorded Apr 11, 2008, AETV).TiVo
4/13/2008 4:44:11 PM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 4:44:11 PM Started Ad Scan/auto-cuts, input: The Sopranos - ''A Hit Is a Hit'' (Recorded Apr 11, 2008, AETV)
4/13/2008 4:44:12 PM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 4:47:06 PM VideoReDo completed ADSCAN, creating: E:\Video\TiVo\The Sopranos - ''A Hit Is a Hit'' (Recorded Apr 11, 2008, AETV).dvr-ms
4/13/2008 4:47:06 PM No metadata found for: The Sopranos - ''A Hit Is a Hit'' (Recorded Apr 11, 2008, AETV).TiVo
4/13/2008 4:47:06 PM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 4:47:06 PM Deleted QSF: E:\Video\TiVo\The Sopranos - ''A Hit Is a Hit'' (Recorded Apr 11, 2008, AETV)_QSF.dvr-ms
4/13/2008 5:42:44 PM Started QSF, input: The Sopranos - ''The Fleshy Part of the Thigh'' (Recorded Apr 11, 2008, AETV)
4/13/2008 5:42:46 PM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 5:43:17 PM VideoReDo completed QSF, creating: E:\Video\TiVo\The Sopranos - ''The Fleshy Part of the Thigh'' (Recorded Apr 11, 2008, AETV)_QSF.dvr-ms
4/13/2008 5:43:17 PM No metadata found for: The Sopranos - ''The Fleshy Part of the Thigh'' (Recorded Apr 11, 2008, AETV).TiVo
4/13/2008 5:43:17 PM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 5:43:17 PM Started Ad Scan/auto-cuts, input: The Sopranos - ''The Fleshy Part of the Thigh'' (Recorded Apr 11, 2008, AETV)
4/13/2008 5:43:18 PM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 5:46:01 PM VideoReDo completed ADSCAN, creating: E:\Video\TiVo\The Sopranos - ''The Fleshy Part of the Thigh'' (Recorded Apr 11, 2008, AETV).dvr-ms
4/13/2008 5:46:01 PM No metadata found for: The Sopranos - ''The Fleshy Part of the Thigh'' (Recorded Apr 11, 2008, AETV).TiVo
4/13/2008 5:46:01 PM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 5:46:01 PM Deleted QSF: E:\Video\TiVo\The Sopranos - ''The Fleshy Part of the Thigh'' (Recorded Apr 11, 2008, AETV)_QSF.dvr-ms
4/13/2008 6:42:27 PM Started QSF, input: The Sopranos - ''Mayham'' (Recorded Apr 13, 2008, AETV)
4/13/2008 6:42:28 PM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 6:42:58 PM VideoReDo completed QSF, creating: E:\Video\TiVo\The Sopranos - ''Mayham'' (Recorded Apr 13, 2008, AETV)_QSF.dvr-ms
4/13/2008 6:42:58 PM No metadata found for: The Sopranos - ''Mayham'' (Recorded Apr 13, 2008, AETV).TiVo
4/13/2008 6:42:58 PM Check: TivoMetaDecode.ocx is registered and MAK is valid
4/13/2008 6:42:58 PM Started Ad Scan/auto-cuts, input: The Sopranos - ''Mayham'' (Recorded Apr 13, 2008, AETV)
4/13/2008 6:42:59 PM VideoReDo said: INFO: VideoReDo version  3. 1. 4. 549 - Dec 12 2007
4/13/2008 6:45:43 PM VideoReDo completed ADSCAN, creating: E:\Video\TiVo\The Sopranos - ''Mayham'' (Recorded Apr 13, 2008, AETV).dvr-ms
4/13/2008 6:45:43 PM No metadata found for: The Sopranos - ''Mayham'' (Recorded Apr 13, 2008, AETV).TiVo
4/13/2008 6:45:43 PM Check: TivoMetaDecode.ocx is registered and MAK is valid

As you can see it runs QSF, adscan with cuts, and converts to DVR-MS. I am using Vista Media Center (x64 Ultimate) to watch the folder the .tivo and .dvr-ms files are created in and they show up and play in Vista Media Center, but because there is no metadata each episode shows up as a different show name instead of grouped under that show name (eg. "The Sopranos - ''Mayham'' (Recorded Apr 13, 2008, AETV)" instead of just "The Sopranos").

Any ideas why no metadata is being found? It is clearly there, when I look at the Now Playing list in TiVo desktop, the episode name, description, etc. are all there. So I am confident that the metadata is there, in the .tivo file, but TVAP does not seem able to find it.

2) No thumbnails. I know this is kind of a long-standing issue but it is so close to being perfect that I hope you can get this feature in -- I read that the creator of DVRMSToolbox has a functional program to create a .jpg thumbnail of a given DVR-MS file, I can't imagine it would be hard to make it save a thumbnail to the file's metadata itself. Check it out: http://babgvant.com/blogs/andyvt/ar...map-of-a-dvr-ms-file-at-a-specified-time.aspx

I hope you can manage to get such a feature into TVAP, or perhaps just modify that program to write to a DVR-MS file's metadata and then it could be used with a batch file for post processing with TVAP.

Thanks again for a great piece of software!


----------



## dlfl

TVAP reads the metadata from the .tivo file as soon as it completes transferring. It's stored in the XML data file and the info displayed for right clicks comes from there. When you output to DVR-MS, some of this metadata is inserted. I wondered if DT 2.6.1 might be the culprit but no, I just put that on one of my PC's and TVAP reads metadata from files it transfers OK.

What I'm suspecting is the tivocom.dll that TVAP uses to read metadata (and your MAK) either isn't getting properly registered by the installer, or some Vista security issue is preventing it from running. The Start->Run command I know for manually registering it is: regsvr32 tivocom.dll. After a little reading on MSDN I think Vista should be able to run the 32 bit stuff. What happens if you manually register the dll?

Also are you running with admin privileges? Check out this MS KB article.

I don't run Vista but I know other TVAP users do. I will look into this further, and also the thumbnail thing.


----------



## blah238

Thanks for the quick response!

I looked through the TivoFileManager.xml in my TVAP folder and like you would expect, the metadata fields are empty. You mentioned TVAP only looks for metadata right after a transfer finishes. What about for preexisting .tivo files? I.e. if I delete and reinstall TVAP, and I already have a bunch of .tivo files, does it look up their metadata when it reads my TiVo folder, or would I have to delete my .tivo files and transfer them again while TVAP is running? That could prove very cumbersome while trying to troubleshoot this problem. I will go record a 1-minute segment so I have something small to transfer and play with.

I'm using administrator account and UAC is disabled so I don't think it is a permissions issue. I did a file search for *tivo*.dll and the only results were Interop.tivocomLib.dll and TiVoDirectShowFilter.dll. So I don't even have a tivocom.dll on my machine. That be the problem? I've reinstalled TiVo Desktop several times so I don't know why that is.

Thanks again

edit: just for grins I tried running TVAP in Windows 95 compatibility mode and right clicked it and ran it as administrator (even though I already am one). Same problem.
edit2: also tried TD 2.5 and 2.6, same problem still (also no tivocom.dll with any of them).
edit3: also tried pyTivoMetaGen... it seems to have a similar problem (after selecting a .tivo file to generate metadata from, it just says 0 of 1 file processed, and no .txt file is generated). Also no tivocom.dll exists (still).
edit4: I found Froobrar's tivocom.dll 1.2 (here) -- unzipped and registered it with regsvr32. Neither pyTivoMetaGen or TVAP works still. Very strange. Is it a 64-bit problem? I am running Vista Ultimate x64.


----------



## dlfl

TVAP will read metadata from existing files the first time it encounters them.

The tivocom.dll is installed in the Windows\System32 folder. I'm pretty sure the current version from the link you gave is not compatible with TVAP, which uses an older version. I suggest:

1. Unregister the tivocom dll you found.
2. Uninstall and re-install TVAP.
3. Is tivocom.dll now in the Windows\System32 folder?
4. If so, register it manually and try TVAP. (Re-registering doesn't hurt even if it's already registered.)

If the tivocom.dll is not being installed in the system32 folder, I will get a copy to you.


----------



## blah238

dlfl said:


> TVAP will read metadata from existing files the first time it encounters them.
> 
> The tivocom.dll is installed in the Windows\System32 folder. I'm pretty sure the current version from the link you gave is not compatible with TVAP, which uses an older version. I suggest:
> 
> 1. Unregister the tivocom dll you found.
> 2. Uninstall and re-install TVAP.
> 3. Is tivocom.dll now in the Windows\System32 folder?
> 4. If so, register it manually and try TVAP. (Re-registering doesn't hurt even if it's already registered.)
> 
> If the tivocom.dll is not being installed in the system32 folder, I will get a copy to you.


nope it is not being installed -- I did unregister the one I downloaded. then uninstalled and reinstalled TVAP. No tivocom.dll in the system32 folder or anywhere else. if you want to send me the file(s) you can email me at blah238 at gmail dot com

thanks!


----------



## dlfl

blah238 said:


> nope it is not being installed -- I did unregister the one I downloaded. then uninstalled and reinstalled TVAP. No tivocom.dll in the system32 folder or anywhere else. if you want to send me the file(s) you can email me at blah238 at gmail dot com
> 
> thanks!


Actually you can download the version I use directly from the tivodecode site, I found: http://tivodecode.sourceforge.net/tivocom/tivocom.zip. At http://tivodecode.sourceforge.net/tivocom you find the links to both versions.

If you can manually register it and that makes metadata work in TVAP, then the problem is apparently an interaction between the installer and your version of Windows.


----------



## blah238

will try it, thanks


----------



## blah238

nope, still same problem (both pyTivoMetaGen and TVAP). i'm stumped!


----------



## dlfl

Try unregistering tivocom.dll, moving the file to your %systemRoot%\sysWOW64 folder and re-registering.

Also, does TVAP install to program files\TVAP or program files(x86)\TVAP ?

Apparently there is "registry redirection" in x64 Windows and since tivoCom.dll does registry reads, that could be an issue, i.e., it might have to be specifically programmed for x64. Of course TVAP reads your Tivo Desktop transfer directory from the registry and apparently that works.

Google "wiki wow64" for more info.


----------



## blah238

dlfl said:


> Try unregistering tivocom.dll, moving the file to your %systemRoot%\sysWOW64 folder and re-registering.


OK, did that -- but still the same problem.



> Also, does TVAP install to program files\TVAP or program files(x86)\TVAP ?


The (x86) one.



> Apparently there is "registry redirection" in x64 Windows and since tivoCom.dll does registry reads, that could be an issue, i.e., it might have to be specifically programmed for x64. Of course TVAP reads your Tivo Desktop transfer directory from the registry and apparently that works.
> 
> Google "wiki wow64" for more info.


I tried every combination of having the tivocom files in one or both of system32 and syswow64, registering the tivocom.dll in one or both of those directories, and tested both with TVAP and pyTivoMetaGen. No change. Stubborn bug this!

Not sure whether this indicates tivocom.dll needs to be rewritten for x64 but if it does that is a bummer.

What would be nice to know is if there is anyone else running Vista x64 and their experience with TVAP. If it works on other people's Vista x64 configs then at least we know that's not the problem.

*So if anyone out there is running Vista x64 and TVAP tell us!* 
(specifically about the metadata issue -- TVAP actually works great in Vista x64 other than that)


----------



## jhoward15

This may be a stupid question, but I'd like to start TVAP processing automatically on my media PC on bootup - basically click the start processing button automatically when the app runs. Is there a way to do this through a command-line arg? Are there other command-line args?


----------



## dlfl

jhoward15 said:


> This may be a stupid question, but I'd like to start TVAP processing automatically on my media PC on bootup - basically click the start processing button automatically when the app runs. Is there a way to do this through a command-line arg? Are there other command-line args?


Welcome to the forum!

I'll look into doing this with a CL arg. There is now one CL arg, which is to adjust the processor priority of the VRD processes (Default is "below normal", see the TVAPreadme.txt file for more details).

I assume you would want it to start minimized (to the system tray) also?


----------



## jhoward15

dlfl said:


> Welcome to the forum!
> 
> I'll look into doing this with a CL arg. There is now one CL arg, which is to adjust the processor priority of the VRD processes (Default is "below normal", see the TVAPreadme.txt file for more details).
> 
> I assume you would want it to start minimized (to the system tray) also?


That's just what I was thinking (although with a shortcut I can start it minimized)... Everything else is great!


----------



## dlfl

16 April 2008 Ver. 0.59
- Added command line option "-hotstart". If present, TVAP starts processing on startup without
clicking the Start Processing button, and minimizes itself (after the usual 18 second delay
to check for new TiVo files).

Add the option (and/or the -p# process priority option) as follows in the Target section of the TVAP shortcut properties:

"<Path>\Tivo-VideoReDo-AutoProcessor.exe" -hotstart

Also remember with this option you will not have a chance to review process settings for new tivo files prior to starting processing.


----------



## blah238

FYI I formatted and went back to Vista 32-bit and TVAP and pyTivoMetaGen both work properly now. So I'd hazard a guess and say that means tivocom.dll needs a 64-bit rewrite.


----------



## FrooBrar

blah238 said:


> I tried every combination of having the tivocom files in one or both of system32 and syswow64, registering the tivocom.dll in one or both of those directories, and tested both with TVAP and pyTivoMetaGen. No change. Stubborn bug this!
> 
> Not sure whether this indicates tivocom.dll needs to be rewritten for x64 but if it does that is a bummer.
> 
> What would be nice to know is if there is anyone else running Vista x64 and their experience with TVAP. If it works on other people's Vista x64 configs then at least we know that's not the problem.
> 
> *So if anyone out there is running Vista x64 and TVAP tell us!*
> (specifically about the metadata issue -- TVAP actually works great in Vista x64 other than that)


I have tested tivocom on Vista x64 and it worked fine for me. I put up my test app on that same URL from before (http://tivodecode.sourceforge.net/tivocom/), for both 1.1 and 1.2 versions of the DLL. Extract the ZIP, register both DLLs, and open the test_tivo.hta. Make sure your MAK is right (if not, set it), then browse to the input file (.tivo file) and choose to "Show chunk". If some valid-looking XML shows up, tivocom is working properly.

I do not use TVAP, nor do I know exactly what it involves. However, tivocom should not require being rewritten for x64. If anything, it would just need to be recompiled, but this is unlikely since it must be the same bitness (32 or 64) as the process which loads it, and I bet that the loading app is 32-bit. If you want to try a 64-bit DLL, I can easily compile one for you.

dlfl: The only differences between the 1.1 and 1.2 dlls are that the OpenTivoFile method now takes the MAK as an optional parameter (leave it an empty string if you want the default) instead of always using the one in the registry, and it now allows decoding the MPEG data as well as the metadata. Also, you should NEVER Install stuff into system32, period. That's what the registry is all about. You can register a COM dll anywhere and it will work. Putting non-OS components in system32 is a bad practice to be in, which dates from the windows 3.1 days. Put the DLL in your program files directory and register it there, or possibly put it in a subdirectory of program files\common files and register it there.

Good luck.


----------



## dlfl

Well, there you have it, unfortunately too late for you to test, I guess.

TVAP is a 32-bit application programmed in C# and using the .NET framework. I did verify you could put the dll in the TVAP runtime folder and register it there and TVAP recovered metadata OK, so I will probably modify the installer to do that in the future, per *froobrar*'s advice.

Note that to register the dll in that folder you must use the path and enclose it in quotes if it contains any spaces, e.g.:

regsvr32 "c:\program files\TVAP\tivocom.dll"

*OR* you can run the regsvr32 command in a Command Window logged to the folder containing tivocom.dll, in which case the path isn't needed.

*Edit: *More info on registering on *64-bit windows*:
Apparently there are two versions of *regsvr32*. To register a 32-bit dll you have to run the one in the sysWOW64 folder, see this MS KB article. And you can't have the dll on the System32 folder, because that is reserved for 64-bit apps (yes you read correctly!). The article is dated Dec 2007 but it says it applies to XP x64, (presumably NOT Vista x64, as I understand there are differences). Perhaps they removed the dual-regsvr32 thing in Vista x64 ??


----------



## dlfl

20 April 2008 Ver. 0.59a
- No changes to program.
- Installer changes:
1. TivoCom.dll (TivoDecode COM file for reading metadata from Tivo files) is now installed
in C:\Program Files\Common Files\TivoDecode folder.
2. The shared DLL counting feature of Windows registry is used to count number of programs
currently using this DLL. Uninstall will not unregister or delete until count is zero.
These changes were needed because two programs that I know of (TVAP and pyTivoMetaGen) both
use the same DLL and uninstalling one could cause the other to stop reading metadata. Also
to get the DLL out of the system32 folder which is not recommended. It is hoped but not tested
that the installer will provide a functioning TivoCom.dll install on Vista x64 systems now.

*Note:* If you use both TVAP and pyTivoMetaGen you should uninstall both and reinstall them with the latest versions (links in signature). This will keep the registry tracking of programs using the TivoCom.dll from getting confused. The new version of pyTivoMetaGen (0.35a) is also an installer-only change to implement TivoCom.dll sharing and counting.


----------



## FrooBrar

dlfl said:


> More info on registering on *64-bit windows*:
> Apparently there are two versions of *regsvr32*. To register a 32-bit dll you have to run the one in the sysWOW64 folder, see this MS KB article. And you can't have the dll on the System32 folder, because that is reserved for 64-bit apps (yes you read correctly!). The article is dated Dec 2007 but it says it applies to XP x64, (presumably NOT Vista x64, as I understand there are differences). Perhaps they removed the dual-regsvr32 thing in Vista x64 ??


Nope. There are still the 32 and 64-bit regsvr32 executables on Vista x64. Although, it appears that MS somehow automatically notices if you try to run the 64-bit one against a 32-bit dll and runs the 32-bit one instead. Very nice of them.

And yes, my coworkers and I got a good laugh out of the system32/syswow64 naming mess as well (you put your 64-bit dlls in the directory with 32 in the name, and your 32-bit dlls in the directory with 64 in the name. Makes perfect sense...)

If you tried to put a 32-bit dll in system32 (which you could not do from a 32-bit installer without some trickery), the windows filesystem redirection would effectively prevent any 32-bit apps from using it. And since it is a 32-bit dll, no 64-bit apps could use it either.


----------



## blah238

thanks guys. I will try a dual boot with Vista x64 and let you know how it goes.


----------



## dlfl

blah238 said:


> thanks guys. I will try a dual boot with Vista x64 and let you know how it goes.


Based on new info just received from *FrooBrar* via PM, it probably won't work. It looks like I need to change one of the project settings to "force" 32 bit operation. (Apparently x64 is running the main app as 64bit because the default project setting is "any processor", -- and then it can't talk to the 32bit DLL.) More on this when I can get to it, perhaps by PM since we are testing.


----------



## dlfl

No functional program changes.

This installer and program build will install and run TVAP correctly on either a 32bit (x86) or 64bit (Vista x64) system.

Thanks to *blah238* and *froobrar* for testing and info.


----------



## blah238

cool, glad to help test it.

Now if you were looking for more to do ...

I noticed that dvr-ms files in Vista Media Center are missing some metadata such as duration, original airdate, date & time recorded, channel name/number, and of course thumbnails.

Other than thumbnails which I know is a complicated issue, is the other metadata supposed to be there and just isn't showing up in Vista Media Center, or does TVAP just not transfer those metadata fields to dvr-ms?


----------



## dlfl

More metadata items in DVR-MS output files.

Thanks to *blah238* for testing in Media Center.

The order of first/last names in credits is now correct.

*NOTE REGARDING THUMBNAILS IN VISTA MCE*:

Looks like VideoReDo is solving this problem for us! See this thread on the VideoReDo forums.


----------



## jdsnov73

dlfl said:


> Just to let you know I'm aware of issues that HD TiVo users have had with QSF failing on multi-dimensioned videos that can result from TTG transfers. These failures put the kabosh on TVAP's automatic processing flow.
> 
> There is hope for an automatic solution and I'm on the case. But I can't predict how soon it will happen. (The cleanest approach requires a new COM function from VRD that will determine the dominant dimensions so the QSF filter dimensions can be preset. They are considering doing it.)
> 
> If you want the gory details see the TVAP thread in the VRD forum , starting at post #63.
> 
> Also:
> 
> I just learned that TVSuite apparently has a better QSF function than Plus, per this thread in the VRD forum. I think VRD plans to update the Plus version but it's not clear how soon.
> 
> Reminder:
> If you have both Plus and TVS installed, TVAP uses whichever one you last had open in the normal manual GUI mode for its automated VRD processing. I don't know how to get around this. There is a log message each timeTVAP starts a VRD process that tells you what version is being used.


I just started playing around with this last night, using a trial version of VRD TV Suite. This seems to be exactly what I have been looking for to consolidate my recordings from my TivoHD and VistaMediaCenter, cut the junk from the files, and stream them to my XBOX360.

I mainly record HD shows. I've tried a few shows, and all works fine. I just tried "Gene Simmons Family Jewels", and it got the 'Video Dimensions changed' error during a commercial while doing the QSF.

So I tried to run it in VRD on its own, and I used the "enable filters" option, and changed the "sample" from 8 to 128, as specified in this thread:

http://www.videoredo.net/msgBoard/showpost.php?p=37929&postcount=4

This allowed the QSF to finish.

What do I need to do to get TVAP to apply this filter? Not sure if the 128 sample size will solve all problems, but it did allow this file to process. I will keep running my recordings through it and see how it goes.

I really like the fact that once it is all done, the shows that work appear in my RecordedTV section of MediaCenter, with a thumbnail and all MetaData.

Thanks for the great work, and hopefully I can get things to work consistently on all files, before I spend $75 for VideoReDo.

THanks!


----------



## dlfl

jdsnov73 said:


> .........I just tried "Gene Simmons Family Jewels", and it got the 'Video Dimensions changed' error during a commercial while doing the QSF.
> 
> So I tried to run it in VRD on its own, and I used the "enable filters" option, and changed the "sample" from 8 to 128, as specified in this thread:
> 
> http://www.videoredo.net/msgBoard/showpost.php?p=37929&postcount=4
> 
> This allowed the QSF to finish.
> 
> What do I need to do to get TVAP to apply this filter? Not sure if the 128 sample size will solve all problems, but it did allow this file to process. I will keep running my recordings through it and see how it goes.
> ............
> THanks!


So far the only solution is to modify your QSF.vbs file (in the TVAP install folder) per posts #68 and #74 in the VRD TVAP thread. You have to manually pre-determine which shows need filter dimensions set, the dimensions to set, and a string fragment in the titles that will reliably identify them. For your example "Simmons" might work.

Still waiting and hoping VRD will come up with the COM function to determine the dominant video dimensions. That is what's needed to have TVAP do this automatically.

If you need help modifying the QSF file just PM me. This will only work with TVSuite -- the VRD Plus COM interface doesn't have the set filter dimensions function yet. VRD says with the next Plus update, its COM interface will catch up with TVSuite. No hint as to when that will be however.


----------



## jdsnov73

I still haven't looked into this. I seem to have only found a couple shows that have this issue. I can live with just converting these shows to .dvr-ms and using the 30 second skip in MediaCenter to skip through.

However, I do have a few other questions I hope you could answer for me.

I was testing VideoReDo out for the trial period and just purchased it last night. I had a batch of 5 or 6 shows that I was using TVAP to process, but (2) of the shows gave an error when starting the AD function. It said VideoReDo was unable to open the file that was just QSF'd. But, when I went to VideoReDo and opened the files from directly within the program, they both opened fine and it performed the AD. I'm not sure if this would be a TVAP or VRD issue since VRD is able to open the file. Also, after I manually run the AD in VRD, TVAP does not recognize this step and still shows the show in the QSF stage. I can manually complete out the process through VRD, but was wondering if there was anyway to trigger TVAP to recognize the manual .vprj file and continue on as normal?

The other question I have is, I am trying to consolidate all my recordings to MediaCenter, and use VRD to clean up the recordings. I saw this post on your thread over at VRD, asking about a way to modify TVAP to process files that aren't .TIVO to begin with:

http://www.videoredo.net/msgBoard/showpost.php?p=34230&postcount=25

Is this possible, or was it ever looked into further?

I know I can do batch processing in VRD, but would rather have some sort of automation. I have no idea how to create a batch process on my own to handle this automatically.

Thanks


----------



## dlfl

*jdsnov73*,

The file open errors are puzzling. I've never experienced them and there have been no other complaints. Could you post or pm me the section of the log file ("TiVoVRDAutoProcessLog.txt") showing the error and the version of VRD you are using? Had you done the trial registration or completed your purchase when the errors occurred?

TVAP will only keep track of the status and location of files that it has processed. There is no easy way to fool it.

A version of TVAP that started with other than TiVo files would be a significant mod. So far there haven't been enough requests to justify the effort -- sorry!

You can download a TVAPpostProcess batch file that uses HandBrake (free) to convert your outputs to MPEG4 format ***here***.


----------



## dlfl

26 May 2008 Ver. 0.61
- Added time delays of a few seconds and two retries in VideoReDo AdScan file open to prevent file open errors encountered by one user on DVR-MS files.

If you haven't been experiencing file open errors there is really no reason to install this version. (Changes will be in all future versions, of course.)


----------



## dlfl

You can create .mp4 files that will synch to an 80GB Zune without conversion, i.e., in a few seconds, with ***this batch file***  that uses the (free) Handbrake encoder.

Download the zip file and extract the .cmd file to the final destination folder of your TVAP process (normally the QSF or AdScan destination folder). Do not change the file name -- TVAP looks for that particular file name.

Download and install HandBrake.

Edit the batch file to substitute the correct paths for *HBFolder*, *localDir *and *outDir*. (See remarks "REM" in the file for description of each folder.)
Be sure to include the final backslash ('\') at the end of each path!

This process will encode much faster than the HandBrake IPOD lowRez profile, which will also work on the 80GB Zunes.


----------



## jdsnov73

dlfl said:


> You can create .mp4 files that will synch to an 80GB Zune without conversion, i.e., in a few seconds, with ***this batch file***  that uses the (free) Handbrake encoder.
> 
> Download the zip file and extract the .cmd file to the final destination folder of your TVAP process (normally the QSF or AdScan destination folder). Do not change the file name -- TVAP looks for that particular file name.
> 
> Download and install HandBrake.
> 
> Edit the batch file to substitute the correct paths for *HBFolder*, *localDir *and *outDir*. (See remarks "REM" in the file for description of each folder.)
> Be sure to include the final backslash ('\') at the end of each path!
> 
> This process will encode much faster than the HandBrake IPOD lowRez profile, which will also work on the 80GB Zunes.


Thanks for putting this together. I got sidetracked after you sent me that test .mp4 file.

I will look into this tonight after I get home from work.

Couple of Questions though:

I use TVAP to output .dvr-ms files so I can view everything on MediaCenter. Since my QSF files are output in .dvr-ms, will handbrake need these converted to .mpg? And if so, how do I incorporate that into a post-process activity?

What are the parameters of the conversion? Does it matter if the original file is SD or HD video?

Thanks,
Jeff


----------



## dlfl

jdsnov73 said:


> ..........
> Couple of Questions though:
> 
> I use TVAP to output .dvr-ms files so I can view everything on MediaCenter. Since my QSF files are output in .dvr-ms, will handbrake need these converted to .mpg? And if so, how do I incorporate that into a post-process activity?
> 
> What are the parameters of the conversion? Does it matter if the original file is SD or HD video?
> .......


Unfortunately, HandBrake won't input a DVR-MS file. Also, TVAP will only run the TVAPpostProcess.cmd file if it is configured to output mpeg2 files.

You would have to set the output type to DVR-MS, process all your files, then Reset all of them, set the output type to MPEG2 and process them again. (Do not check Delete TiVos for the first round of processing, of course, or the file won't be there to process the second time).

This isn't actually taking any longer than if it was completely automated, since VRD can only output one type at a time.

The batch file should work on any mpeg2 format, producing a 320x240 output with a video bitrate of 700kbps, which is comfortable for Zune. However I haven't actually tried it on HD inputs. If the input is letterboxed, HandBrake will autocrop so the output is 320 x W, where W is less than 240. This will play letterboxed on the Zune.

I have an automated solution for your process. I will post it shortly with download links and instructions.


----------



## dlfl

28 May 2008 Ver. 0.62
- TVAPpostProcess batch file will be run for EITHER mpeg2 or dvr-ms outputs.

This was done to support running a TVAPpostProcess file for *jdsnov73* to:

1. Create a mpeg2 from the dvr-ms output from VRD.
2. Run Handbrake on the mpeg2 to create a Zune-compatible .mp4
3. Delete the temporary mpeg2 file.

To do this, I found a version of ffmpeg  designed specifically to pull the mpeg2 out of a dvr-ms. The revised TVAPpostProcess.cmd file and the ffmpeg files can be downloaded here.

The batch file is very similar to the previous Zune version but you see I've defined a dvr-ms file name (dvrmsName) and if the file exists, the special ffmpeg is called to create the mpeg2 file. This is a very fast process -- much faster than running VRD on the file a second time (and automatic).

Unzip the entire contents into your TVAP final destination folder.
Edit the folder names in the batch file to match your local setup (don't forget the final backslashes!)
Install the new 0.62 version of TVAP (Uninstall your older version first).

Run your processes with DVR-MS output type selected and Do PostProcess checked. That should do it.

Note the logic in the batch file allows it to also handle .mpeg2 outputs from VRD/TVAP. It just bypasses the DVR-MS-to-mpeg2 conversion.


----------



## jdsnov73

dlfl said:


> 28 May 2008 Ver. 0.62
> - TVAPpostProcess batch file will be run for EITHER mpeg2 or dvr-ms outputs.
> 
> This was done to support running a TVAPpostProcess file for *jdsnov73* to:
> 
> 1. Create a mpeg2 from the dvr-ms output from VRD.
> 2. Run Handbrake on the mpeg2 to create a Zune-compatible .mp4
> 3. Delete the temporary mpeg2 file.
> 
> To do this, I found a version of ffmpeg  designed specifically to pull the mpeg2 out of a dvr-ms. The revised TVAPpostProcess.cmd file and the ffmpeg files can be downloaded here.
> 
> The batch file is very similar to the previous Zune version but you see I've defined a dvr-ms file name (dvrmsName) and if the file exists, the special ffmpeg is called to create the mpeg2 file. This is a very fast process -- much faster than running VRD on the file a second time (and automatic).
> 
> Unzip the entire contents into your TVAP final destination folder.
> Edit the folder names in the batch file to match your local setup (don't forget the final backslashes!)
> Install the new 0.62 version of TVAP (Uninstall your older version first).
> 
> Run your processes with DVR-MS output type selected and Do PostProcess checked. That should do it.
> 
> Note the logic in the batch file allows it to also handle .mpeg2 outputs from VRD/TVAP. It just bypasses the DVR-MS-to-mpeg2 conversion.


THANKS!

This works great. It was much faster than I expected. The conversion to .mpeg took the longest. The final encode was really fast. The HD file worked fine. I will play around with HandBrake to see how different parameter change the process. I won't be converting most videos, but when travel comes up, this will be a great option to have.

Would it be possible to add a check box to the default settings to have .vprj files deleted upon completion, as is done with .tivo and .qsf files? Once the .qsf file is deleted, the .vprj file is of no use.

Thanks


----------



## dlfl

jdsnov73 said:


> ........ Would it be possible to add a check box to the default settings to have .vprj files deleted upon completion, as is done with .tivo and .qsf files? Once the .qsf file is deleted, the .vprj file is of no use. .........


Yes. I'm thinking about making it automatic if you have Delete QSF checked, rather than additional check boxes. *Any user comments on that?*

As a simple temporary fix, you could include this at the end of your TVAPpostProcess.cmd file

set vprjFile="%localDir%%~1.vprj"
if not exist %vprjFile% goto noVprj
del %vprjFile%
:noVprj


----------



## jdsnov73

I'd rather have it automatic as you suggest. I'll continue to delete them manually for now since I don't plan on running post-processing on every file.

Thanks


----------



## msmart

> Once the .qsf file is deleted, the .vprj file is of no use.


True, so deleting it automatically can't hurt. However, the metadata file that TVAP creates is located "alongside" the .vprj file so something has to be done with that as well. Currently, I manually copy it to a "show descriptions" folder then delete it from the AdScan folder. If I wanted to automate that, adding it to the post-process batch file is the way to go. (*Added:* but, I too, don't post process every file - what if you created a "TVAPpostHouskeeping.cmd" batch file that was run on every file regardless of Post Process setting?)

I guess what I'm saying is that, yes, I vote to automatically delete the .vprj file.


----------



## dlfl

31 May 2008 Ver. 0.63
- If a QSF file is automatically deleted, the project (.vprj) file linked to it is also deleted.

- If a batch file named *TVAPcleanUp.cmd* (or TVAPcleanUp.bat) is present in the final destination folder when an output file is completed, it will automatically be run by TVAP. The single argument passed to the file is the "bare" video file name (no path, no extension). If a TVAPpostProcess file is used, the cleanup batch is run afterwards, not before.

- A new command-line argument, *-noMeta*, will prevent TVAP from writing any pyTivo-style meta-data files. Default continues to be writing the files.


----------



## goodtrips

Hey DLFL,

Was hoping you could help me with a problem that seems to be occurring more often than not. It seems that after TVAP running for about 3-4 days non-stop, I start to see these errors in the log file:



Code:


7/6/2008 3:36:44 AM Started Ad Scan/auto-cuts, input: Foobar with the stars
7/6/2008 3:36:44 AM Ad Scan canceled: Input file not found: D:\TiVo\Foobar with the stars.mpg

This will basically cripple all other encodes in queue until I do a full system restart. The issue continually pops up again after a few days of use. Things seem to transfer from the tivo fine, the file is physically there, but just chokes on it. Any thoughts you have would be great.

BTW, have just loved this app since I installed it -- could absolutely not be happier with it, and anyone reading this who hasn't given it a shot needs to take the plunge!


----------



## dlfl

goodtrips said:


> Hey DLFL,
> 
> Was hoping you could help me with a problem that seems to be occurring more often than not. It seems that after TVAP running for about 3-4 days non-stop, I start to see these errors in the log file:
> 
> 
> 
> Code:
> 
> 
> 7/6/2008 3:36:44 AM Started Ad Scan/auto-cuts, input: Foobar with the stars
> 7/6/2008 3:36:44 AM Ad Scan canceled: Input file not found: D:\TiVo\Foobar with the stars.mpg
> 
> This will basically cripple all other encodes in queue until I do a full system restart. The issue continually pops up again after a few days of use. .........


Hmmm... That's a puzzler! One suggestion just on defensive general principles would be to shut down and restart TVAP every couple of days. Do you see any growth in memory usage in Task Manager as TVAP runs for several days?

This error message is generated when TVAP checks for the existence of the file it's about to process and doesn't find it. If you are doing a QSF on this video first, it's remotely possible the operating system glitches at the end of writing the QSF'ed file and doesn't report it present, even though I already insert time delays there to let the OS catch up in case it needs to. This could be aggravated if D: is a network or USB drive.
However, your log info doesn't have "_QSF" as part of the file name -- either you edited it out or you are going directly from .TiVo to the AdScan process. In that case it's impossible for me to see how the OS could report the file missing.

If you actually are doing QSF first on these files, let me know -- I'll boost the time delays in a new version.


----------



## goodtrips

dlfl said:


> If you are doing a QSF on this video first, it's remotely possible the operating system glitches at the end of writing the QSF'ed file and doesn't report it present, even though I already insert time delays there to let the OS catch up in case it needs to. This could be aggravated if D: is a network or USB drive.
> However, your log info doesn't have "_QSF" as part of the file name -- either you edited it out or you are going directly from .TiVo to the AdScan process. In that case it's impossible for me to see how the OS could report the file missing.
> 
> If you actually are doing QSF first on these files, let me know -- I'll boost the time delays in a new version.


Thanks for the quick response!

I am in fact doing QSF prior to running ad scan (for what it's worth, D: is a local/internal drive). To be fair, though, the computer I run this on is old and this is really the only thing I use it for. Here is a more complete sample from the log file:



Code:


7/6/2008 3:34:39 AM Started QSF, input: Foobar with the Stars
7/6/2008 3:36:44 AM VideoReDo completed QSF, creating: D:\TiVo\Foobar with the Stars_QSF.mpg
7/6/2008 3:36:44 AM Started Ad Scan/auto-cuts, input: Foobar with the Stars
7/6/2008 3:36:44 AM Ad Scan canceled: Input file not found: D:\TiVo\Foobar with the Stars_QSF.mpg

(sorry about the foobar thing -- I obviously need to find new ways to amuse myself).


----------



## dlfl

7 July 2008 Ver. 0.64
- Added additional time delays and retries detecting input files -- defensive programming to minimize possible problems due to OS glitches.

If TVAP takes more than 5 seconds to detect the presence of a file needed for input to AdScan or QSF, a log message is created. The maximum it will wait without declaring failure is 20 seconds.

*goodtrips*:
Your first post prompted me to do this without waiting for your next post. It's a good thing in general and the cost is insignificant.

If you happen to see any of those new log messages I would appreciate knowing about it.


----------



## goodtrips

wow -- thanks so much dlfl! I will definitely let you know if I'm still seeing the issue with this new version. 

I also forgot to answer your earlier question about resources over time -- I haven't noticed that in the past, but will keep an eye out for it moving forward.


----------



## goodtrips

On a total random whim, thought I would also throw this out to you dlfl to get your thoughts --

I've been using a heavily modified batch file script that recompiles the completed MP4 with iTunes meta data (atomic parsley) and then automatically adds that to iTunes with a script called addToPlaylist.js. I'll be happy to share how sloppy my cmd file is if you're interested.

That being said, the way I am producing metadata for the mp4 is through a really rough parsing of the file name variable (%~1), since thankfully TiVo tends to name the files pretty consistently. I end up with double spaces in weird places, weird characters breaking the naming convention, etc -- but it works just well enough.

Since the metadata text file is not generated by TVAP until after the batch script is completed, I'm never able to use that data.

What would you think about passing the batch file variables for some of the core data points (i.e. Show, Episode, Title, Date, Channel, etc)? Something similar to how %~1 is passed when launching the script?


----------



## dlfl

*goodtrips:*
The metadata (.txt) file should be in your adscan destination folder by the time the post process script is launched. Can't your script use it to get the metadata?


----------



## goodtrips

that's the thing -- that file is not created (at least for me) until after the post process script is completed. again, not really a big deal; was just asking more on a whim than anything.


----------



## dlfl

9 July 2008 Ver. 0.65
- Corrected sequencing error that caused pyTivo metadata file not to be written until after the TVAPpostProcess batch file ran -- when AdScan with Autocuts was done.

*goodtrips:*
I believe you were running Adscans with autocuts. The bug didn't occur if you created .vprj only then reviewed the cuts.

Thanks for the find!


----------



## goodtrips

hey, very cool! had no idea that wasn't the way it was designed to work


----------



## goodtrips

man, i've been having nothing bad luck lately dlfl.

so this is what my log files are looking lately since the last release:


Code:


7/21/2008 2:40:26 AM Started QSF, input: Friday Night Lights - ''There Goes the Neighborhood'' (Recorded Jan 4, 2008, WMAQDT)
7/21/2008 2:40:27 AM VideoReDo said: INFO: VideoReDo version  3. 1. 5. 564 - Jul  5 2008
7/21/2008 3:02:15 AM VideoReDo completed QSF, creating: D:\TiVo\TiVo Dumps\Friday Night Lights - ''There Goes the Neighborhood'' (Recorded Jan 4, 2008, WMAQDT)_QSF.mpg
7/21/2008 3:02:15 AM Started Ad Scan/auto-cuts, input: Friday Night Lights - ''There Goes the Neighborhood'' (Recorded Jan 4, 2008, WMAQDT)
7/21/2008 3:02:16 AM VideoReDo said: INFO: VideoReDo version  3. 1. 5. 564 - Jul  5 2008
7/21/2008 3:02:17 AM VideoReDo said: INFO: Failed file open: D:\TiVo\TiVo Dumps\Friday Night Lights - ''There Goes the Neighborhood'' (Recorded Jan 4, 2008, WMAQDT)_QSF.mpg. Will retry
7/21/2008 3:02:22 AM VideoReDo said: INFO: Failed file open twice: D:\TiVo\TiVo Dumps\Friday Night Lights - ''There Goes the Neighborhood'' (Recorded Jan 4, 2008, WMAQDT)_QSF.mpg. Will retry
7/21/2008 3:02:33 AM VideoReDo said: ERROR: Unable to open file/project: D:\TiVo\TiVo Dumps\Friday Night Lights - ''There Goes the Neighborhood'' (Recorded Jan 4, 2008, WMAQDT)_QSF.mpg

A couple of notes about my set-up:

I'm using a modified QSF file to manually define video dimensions
I'm selecting all options -- QSF, Ad Scan, Auto Cuts, etc
I'm still getting the "Video Dimensions have changed" pop-up from VideoReDo, even though the QSF file that used to work doesn't seem to be anymore

I tried to find an older version of TVAP on your server to revert to, but I think it's down. Any help, as always, would be great -- just totally stumped.


----------



## dlfl

*goodtrips:*

Bummer! The download site is back up and I've added Ver. 0.57 if you want to try that. VideoReDo occasionally wipes out the download folder during housekeeping I think.

Looking at your log data, there was a 16 second interval between the first and third attempts to open the file. Seems like that should be long enough, doesn't it? Assuming you were using 0.65, it's interesting that the "File Exists" check that I added, which executes before launching the VRD adScan, did NOT show a problem. In other words, the operating systems was reporting the file present to TVAP yet VRD could not open it, even with three re-tries over 16 seconds.

It might suggest that the VRD QSF COM process is showing itself as completed to the OS (and thus to TVAP) but maybe there is a thread still running and writing output to the QSF'ed file. Thus the QSF file is present, but not complete, when TVAP launches the AdScan process and the open fails because VRD sees the file is not complete. If this is what's happening, there are two approaches:

1. Ridiculously long worst-case pauses in TVAP at the end of every VRD process.
2. I need to be able to detect the thread that is still running in the process list so TVAP can wait for it to complete.

I'm stumped too!


----------



## goodtrips

OK -- emailed with support at VideoReDo (and sent them my modified QSF.vbs file that had the manual shows set at custom resolutions).

Turns out, the show keywords have to be case sensitive. I don't remember this being an issue before I upgraded to the new version of TVS, but I've done 2 tests so far after modifying that file and it seems to have worked.

VideoReDo, if you happen to read this -- you really need to update your app to automatically default to the dominant resolution of the file. It's very disappointing that the new release didn't address this. I have to assume that a large &#37; of your users are TiVo customers, and when more upgrade to a TiVo HD/Series 3, these complaints are only going to grow louder.

dlfl, as always, you are a rockstar.


----------



## dlfl

*goodtrips*

Cool! I hope that fixes all the problems.

You could modify your filter dimension logic by sending log messages back to TVAP about what dimension was selected or that none was. That way you would know what happened.

All you need is a statement like this:

wscript.stdout.writeline("INFO: VideoReDo version " & VideoReDo.VersionNumber)

(Where you substitute your own string for the message.)

Be sure you start it with "INFO:" , which tells TVAP that it's just something to put in the log file.

Also, I'm sure there is a string function in VBS that will convert your video file name string to all lower case. Then you use all lower case for your matching string and you don't have to worry about case sensitivity.

The case sensitivity (assuming you are talking about your added filter dimension logic) is purely a function of VBS scripting so TVS cannot be the culprit. Now if you're saying TVS suddenly has become case sensitive for file names in COM function arguments like *FileOpenBatch*, that would be a different thing! (And very surprising for a Windows program, since file names are not case sensitive in Windows, as opposed to Linux.)


----------



## blah238

Hello again dlfl! I've been getting back into TVAP/VRD automation and have a bit of a laundry list of questions/suggestions:

1) Vista Media Center and VideoRedo Plus (recent beta version 600, shares same codebase as TVSuite) don't seem to get along. If Media Center is running while TVAP (0.65) calls VideoRedo, an error message is shown about not being able to play the video file (I will update this post with the specific error when I run into it again). Due to this, I can't let TVAP process in the background while Media Center is running. Do you have any suggestions or workarounds for this? Which brings me to my next question:

2) One workaround for the above would be to implement scheduling, such that TVAP only continues processing during a user-defined schedule. A better one would of course be to figure out why VRD and Media Center conflict, but I imagine this may be one of those unfixable issues.

3) Vista Media Center never refreshes metadata on its own, so if TVAP outputs a dvr-ms file into one of Vista Media Center's watched folders while Media Center is running, and before TVAP copies the metadata into the file, Media Center will never show metadata for that file unless it is manually removed from the folder and replaced. To work around this I've tried using a post-process batch file which copies the .dvr-ms file from the source folder to the watched folder after TVAP has done its work (including copying metadata), however it seems that TVAP sometimes doesn't release the file quickly enough and the batch file's move command fails. I had to make the batch file a little more complex by inserting pauses and retries, but I'm still testing this. Which brings me to my next question:

4) My batch file appends TiVoVRDAutoProcessLog.txt with the results of whether the move command was successful or not, however these lines don't seem to show up in TVAP's log window. Is there a way I can make that happen? Do the lines need to be in a certain format? The %date% and %time% variables in cmd.exe have a somewhat different format.

5) To avoid all the batch file business... would it be possible to implement a change in the order of operations in TVAP such that metadata is added BEFORE the dvr-ms file is moved to its final destination? Something like an optional temporary folder.

6) Here is a random feature request I've found myself wanting more and more as my recorded TV collection grows: the ability to select multiple files in TVAP's file list and change their checkboxes or reset them en masse. Without this you really have to be savvy with a text editor and find/replace stuff in the TivoFileManager.xml file (or be extremely patient if you have a large number of files you're working with).

Alternatively (or additionally), if we could at least scroll up and down in the file list with the arrow keys while using the mouse to check the settings boxes on the right, that would be a big help. Right now if you click anywhere outside of the file list box, key focus is stolen and the arrow keys only move between the various GUI controls. It would be nice to have it intercept arrow keys or the mouse scroll wheel movements and always send them to the list box for scrolling between files.

7) More metadata fun stuff: The recorded date/time as shown by Vista Media Center is being incorrectly set by either TVAP or VRD to the date/time the file was processed, not the date/time it was recorded on the TiVo. I know that the correct recorded date/time exists in the original .TiVo metadata (shown as <RecordingTimeDate> in TivoFileManager.xml) so would it be possible to get that into the .dvr-ms on the copy metadata step?


----------



## dlfl

blah238 said:


> Hello again dlfl! I've been getting back into TVAP/VRD automation and have a bit of a laundry list of questions/suggestions:
> 
> 1) Vista Media Center and VideoRedo Plus (recent beta version 600, shares same codebase as TVSuite) don't seem to get along. If Media Center is running while TVAP (0.65) calls VideoRedo, an error message is shown about not being able to play the video file (I will update this post with the specific error when I run into it again). Due to this, I can't let TVAP process in the background while Media Center is running. Do you have any suggestions or workarounds for this?


Media Center stuff is hard for me to work on since I don't have Vista or Media Center. What if you just start VRD and load a file manually (outside TVAP) while MC is running? If you get an error in that case you should definitely get on the VRD forums with it.


blah238 said:


> Which brings me to my next question:
> 
> 2) One workaround for the above would be to implement scheduling, such that TVAP only continues processing during a user-defined schedule. A better one would of course be to figure out why VRD and Media Center conflict, but I imagine this may be one of those unfixable issues.
> ?


You can schedule TVAP to start using the Windows Scheduler (Control Panel, Scheduled Tasks in XP, and search "scheduler" in Windows Help). You use the -hotstart command line option for TVAP which you add in the Advanced Settings of the Task Scheduler Wizard, or the properties of the scheduled task item. TVAP will start up in processing mode and minimized (after an initial 18 second delay where the GUI shows).

The question is how do you stop it? You can tell the scheduler to stop it after a certain run time but that is not acceptable and in fact I don't even know what that would do with TVAP. If you are interested in pursuing this idea I could look at adding a command line argument that would specify a run time. TVAP would stop as soon as it finished processing a video after the specified run time had elapsed. (This could mean TVAP would run up to several hours past the specified time.)



blah238 said:


> 3) Vista Media Center never refreshes metadata on its own, so if TVAP outputs a dvr-ms file into one of Vista Media Center's watched folders while Media Center is running, and before TVAP copies the metadata into the file, Media Center will never show metadata for that file unless it is manually removed from the folder and replaced. To work around this I've tried using a post-process batch file which copies the .dvr-ms file from the source folder to the watched folder after TVAP has done its work (including copying metadata), however it seems that TVAP sometimes doesn't release the file quickly enough and the batch file's move command fails. I had to make the batch file a little more complex by inserting pauses and retries, but I'm still testing this. Which brings me to my next question:
> 
> 4) My batch file appends TiVoVRDAutoProcessLog.txt with the results of whether the move command was successful or not, however these lines don't seem to show up in TVAP's log window. Is there a way I can make that happen? Do the lines need to be in a certain format? The %date% and %time% variables in cmd.exe have a somewhat different format.
> 
> 5) To avoid all the batch file business... would it be possible to implement a change in the order of operations in TVAP such that metadata is added BEFORE the dvr-ms file is moved to its final destination? Something like an optional temporary folder.
> ?


TVAP doesn't actually *move* files -- it just tells VRD to output the file to the destination folder. I don't believe the code I use to insert metadata in dvr-ms files will work until the file already exists -- thus it has to be done after VRD finishes outputting the file. I think your post-process batch file is probably the best way to go -- just put in enough delay.

The only time TVAP reads the log file is at start up. Then if the file is small it copies the log info into the log window of the GUI. To get log info from a postprocess (or clean up) batch file to display in the log window would require re-directing stdout (ECHO outputs) from the batch file into TVAP. This is done with the VBS script files that TVAP runs. I can look into doing it for the batch files. Then if you have a line like

ECHO INFO: blah blah blah

in your batch file, it will become a TVAP log file/display line.



blah238 said:


> 6) Here is a random feature request I've found myself wanting more and more as my recorded TV collection grows: the ability to select multiple files in TVAP's file list and change their checkboxes or reset them en masse. Without this you really have to be savvy with a text editor and find/replace stuff in the TivoFileManager.xml file (or be extremely patient if you have a large number of files you're working with).
> 
> Alternatively (or additionally), if we could at least scroll up and down in the file list with the arrow keys while using the mouse to check the settings boxes on the right, that would be a big help. Right now if you click anywhere outside of the file list box, key focus is stolen and the arrow keys only move between the various GUI controls. It would be nice to have it intercept arrow keys or the mouse scroll wheel movements and always send them to the list box for scrolling between files.
> ?


I'll think about what can be done on this. I've experienced the same inconvenience.



blah238 said:


> 7) More metadata fun stuff: The recorded date/time as shown by Vista Media Center is being incorrectly set by either TVAP or VRD to the date/time the file was processed, not the date/time it was recorded on the TiVo. I know that the correct recorded date/time exists in the original .TiVo metadata (shown as <RecordingTimeDate> in TivoFileManager.xml) so would it be possible to get that into the .dvr-ms on the copy metadata step?


I'm afraid what you see is what you're going to get on this one. I beat on this quite a bit a while back and I think it's as good as it's going to get.


----------



## blah238

Thanks for the quick reply!


dlfl said:


> Media Center stuff is hard for me to work on since I don't have Vista or Media Center. What if you just start VRD and load a file manually (outside TVAP) while MC is running? If you get an error in that case you should definitely get on the VRD forums with it.


I do not get an error when I run VRD and load a video directly with Media Center running in a window. I need to test this more though.



> You can schedule TVAP to start using the Windows Scheduler (Control Panel, Scheduled Tasks in XP, and search "scheduler" in Windows Help). You use the -hotstart command line option for TVAP which you add in the Advanced Settings of the Task Scheduler Wizard, or the properties of the scheduled task item. TVAP will start up in processing mode and minimized (after an initial 18 second delay where the GUI shows).
> 
> The question is how do you stop it? You can tell the scheduler to stop it after a certain run time but that is not acceptable and in fact I don't even know what that would do with TVAP. If you are interested in pursuing this idea I could look at adding a command line argument that would specify a run time. TVAP would stop as soon as it finished processing a video after the specified run time had elapsed. (This could mean TVAP would run up to several hours past the specified time.)


That sounds like it would do the trick. Simple but effective.



> TVAP doesn't actually *move* files -- it just tells VRD to output the file to the destination folder. I don't believe the code I use to insert metadata in dvr-ms files will work until the file already exists -- thus it has to be done after VRD finishes outputting the file. I think your post-process batch file is probably the best way to go -- just put in enough delay.


I have to test it overnight but I think I'm good to go with the batch file I have now. At worst it will at least tell me what errors occurred.


> The only time TVAP reads the log file is at start up. Then if the file is small it copies the log info into the log window of the GUI. To get log info from a postprocess (or clean up) batch file to display in the log window would require re-directing stdout (ECHO outputs) from the batch file into TVAP. This is done with the VBS script files that TVAP runs. I can look into doing it for the batch files. Then if you have a line like
> 
> ECHO INFO: blah blah blah
> 
> in your batch file, it will become a TVAP log file/display line.


I think that would be a handy feature. Alternatively, if I were to rewrite my postprocess batch script in VBS would I be able to output messages directly to TVAP's log window? And if so, how? Any other caveats to writing in VBS?



> I'll think about what can be done on this. I've experienced the same inconvenience.


Glad I'm not alone! I was thinking that, if you have multiple files selected, and they have different settings checked, the checks in the checkboxes would show up as gray to signify they weren't all the same. Then you click once to mark that setting as true for the whole selection, or click again to uncheck it. I believe that's the normal Windows behavior anyways. You could also click the reset button to set everything in the selection to the defaults as well as the status to New.



> I'm afraid what you see is what you're going to get on this one. I beat on this quite a bit a while back and I think it's as good as it's going to get.


Darn, that stinks. The way it's handled in Vista Media Center is all the newest recorded files are shown first, so I have 90 something files I just processed with TVAP at the front, even though I recorded them on the TiVo several months ago. I also have ATSC recordings recorded with Media Center itself jumbled in there so optimally if they had the correct recorded date they would be sorted chronologically which would help a lot.

On the plus side, thumbnails show up fine in the new beta version of VideoRedo Plus.

Do you think DanR on the VRD forums would be able to help? What exactly was the issue?


----------



## blah238

Ok so I've narrowed down the problem to a conflict between Vista Media Center in full-screen mode and the ad-scan feature of VRD. The ad-scan feature needs to "playback" the video in order to do its business, but when Media Center is in full screen mode, VRD can't play a video. I've tried every different renderer on the playback devices option menu in VRD to no avail. Interestingly the problem does not exist as long as I stay in windowed mode. Otherwise it would seem I am SOL, since you can't change VMC's renderer and it doesn't seem to want to share with anyone else


----------



## dlfl

*blah238:*

So your conflicts between VRD and Vista MC are not a TVAP problem, correct?

Re-directing Stdout requires changes in TVAP to capture the stdout from postprocess and/or cleanup scripts, so no you couldn't force it using VBS or anything else external to TVAP.

Best I can remember, I tried to find any DVR-MS metadata tag where I could poke the desired recording date but nothing worked. It was as if it was already burned in by VRD and couldn't be changed.


----------



## blah238

dlfl said:


> *blah238:*
> 
> So your conflicts between VRD and Vista MC are not a TVAP problem, correct?


I was actually able to reproduce the problem with VRD's batch processor so you are correct that it has nothing to do with TVAP.

Here is the error given in a messagebox when it occurs:


Code:


Unable to play video:
     Unable to initialize display.
Please check videoredo.log

...and here's the relevant part of the VRD logfile:


Code:


2008-08-04 21:14:19 VideoReDo Plus started. Licensed to: Trial Key, Version:  2. 5. 7. 600 - Jul 29 2008 (0051003fR4WJ4U}
2008-08-04 21:14:19 Starting up with silent and batch: 0  3252e38
2008-08-04 21:14:19  
 
                   ***** Loading: G:\Shared\TiVo\The Sopranos - ''University'' (Recorded May 13, 2008, AETV).TiVo
 

2008-08-04 21:14:19 Starting stream open for: G:\Shared\TiVo\The Sopranos - ''University'' (Recorded May 13, 2008, AETV).TiVo
2008-08-04 21:14:19 After aStream open.
2008-08-04 21:14:19 Is DVRMS: 0.
2008-08-04 21:14:19 Seek to begin.
2008-08-04 21:14:19 Packet classes created.
2008-08-04 21:14:19 Opening file: G:\Shared\TiVo\The Sopranos - ''University'' (Recorded May 13, 2008, AETV).TiVo, filetype is: MPEG2  PIDs: x00 / x00 
2008-08-04 21:14:19 Startup - Number of PTS checks: 8
2008-08-04 21:14:20 Using display driver: VMR9
2008-08-04 21:14:20 Error initializing video:  VMR9 Error, BuildVideoMixingGraph9 (Windowed), hr=0x80004002, No such interface supported  , Overlay Flag: 0, Accel Flag: 1
2008-08-04 21:14:20 Unable to play video: Unable to initialize the video display.
Please check VideoReDo.log




> Re-directing Stdout requires changes in TVAP to capture the stdout from postprocess and/or cleanup scripts, so no you couldn't force it using VBS or anything else external to TVAP.


Makes sense. I just figured the easiest thing would be to have TVAP read the logfile in realtime.


> Best I can remember, I tried to find any DVR-MS metadata tag where I could poke the desired recording date but nothing worked. It was as if it was already burned in by VRD and couldn't be changed.


So it's just a matter of finding the right field name or possibly a formatting issue? VRD has an option under Options->MCE/dvr-ms output called "Set Program Time to Edited Date & Time" but that is unchecked and that seems to be what it's doing anyways.

In any case I would think that if VRD can set it, we could just ask them how  I think I will ask on the VRD forums about these 2 issues. I will let you know if I find anything useful out!


----------



## dlfl

5 August 2008 Ver. 0.66
- Can now navigate Transferred TiVo File list with up/down arrow keys while changing settings in the Settings For Selected File panel without having to mouse click in list to recover focus.
- New Command-line argument: -shutdown:## where ## is the minutes after startup when TVAP will automatically shutdown -- but only after completing whatever video it was processing when the shutdown time was reached. This feature is only active if the -hotstart CL argument is used. 
This allows TVAP to be started by the Windows scheduler, run for (at least) the specified time then shut down. Note: no spaces allowed anywhere in this argument.

*blah238:*

This addresses a couple of your requests. Give it a try!

I started on the batch file stdout capture then realized it's probably not a good idea because of two problems:

1. Some users' batch files will echo stdout that they want to see in the command window where the batch is running. TVAP would have to capture all the stdout.

2. Some batch files (e.g., one running HandBrake) will produce voluminous stdout lines, some of which users may want to see, others of which are useless garbage to most users.

One way that seems simple and should work:
1. Batch file writes one or more lines to uniquely named file while it's running.
2. TVAP waits a second or two after it detects completion of the batch file, then reads the log file (if present) and appends it to the TVAP log. Then it deletes the file.
Would this be useful to you?

For real-time log updates, the idea of having the batch file write to a specially named text file which TVAP would read also occurred to me but you have to prevent problems of contested file access and synchronization of read/writes. The only bullet proof way I can think of involves two specially named files: Semaphore and message files. The presence of the semaphore file is used by both TVAP and the batch file for message synchronization. The batch file must not write the message file until it detects the semaphore file is NOT present. After writing the message file it creates the semaphore file. TVAP looks for the semaphore file and when present it reads the message file. Then it deletes both files. Obviously this puts some burden on the batch file code for proper operation, and if the batch file should happen to generate messages faster than TVAP reads them, it would be slowed down.
If you have a strong preference for this mode, we can do it.

Both of these methods would be transparent to users who don't use them, which is nice.


----------



## blah238

Oh wow, I will definitely be playing with this! I think it's just awesome how quickly you can do all of this.

I agree with you that capturing all stdout output would be problematic. I would think that specifically outputting only certain messages to a file is the way to go. Which is what I already am doing, although it goes straight to the TVAP log instead of an intermediate file like you're suggesting. That would work perfect for me I think.

The real-time log updates idea was brought about by my remembering of some log viewer utility which was able to read/display/format any text-based logfile in real-time. I don't remember the name but I imagine it's a tricky subject. Similarly the simplest method is usually the best especially when it comes to writing batch files, as anything more complex than adding 1+1 is damn near impossible in batch, lol. So I like the first method you suggested, if you deem realtime reading of the main TVAP log impractical.

Also, I got around to posting on VRD's forum about those other issues I am having: http://www.videoredo.net/msgBoard/showthread.php?t=6991

Thanks again!


----------



## blah238

Hmm, the -shutdown option doesnt seem to be doing anything for me.
I set up a hotstart/shutdown shortcut last night and it launched and did all my 60 or so remaining files (only took about 4 hours and I had set it for 6 hours). And when I checked it this evening TVAP was still running and still in processing mode (the Stop Processing button was shown).

Is it supposed to close the program, or stop processing when the timer elapses? What if there are no more videos for it to work on? Also what happens (both before and after the timer elapses) if a new TiVo file gets transferred?

I just now tried giving it a 1 minute shutdown timer while there was 1 file to process and another had about 4 minutes to go on a TiVo desktop transfer. After the first file had finished processing, it didn't shutdown or stop processing, but instead started up on the next file as soon as it finished transferring.

Did I do something wrong with my command line?


Code:


"C:\Program Files (x86)\TVAP\TiVo-VideoReDo-AutoProcessor.exe" -hotStart -shutdown:1


----------



## dlfl

blah238 said:


> Hmm, the -shutdown option doesnt seem to be doing anything for me.


Oops! My bad. Try 0.67. I did test it but ... it's a long story not worth the telling! You did nothing wrong and it should work just as you expect.


----------



## blah238

Cool, will do!


----------



## dlfl

blah238 said:


> ...... Is it supposed to close the program, or stop processing when the timer elapses? What if there are no more videos for it to work on? Also what happens (both before and after the timer elapses) if a new TiVo file gets transferred? .....


Yes, the program should just end and disappear when it shuts down. It puts an autoshutdown message in the log file so you know it ended that way.

If a video is being processed when it reaches the time limit it should finish processing *that* video (complete through post-processing and clean up) but should then shut down rather than starting to process another video.

Files being transferred should make no difference and should not be interfered with by the shutdown.

Let me know if it doesn't behave this way.


----------



## blah238

Appears to be working fine, other than that I forgot to close Media Center before heading to bed so when the scheduled task ran at 2AM TVAP got stuck on the first ad-scan (due to the aforementioned conflict between VRD and Media Center) and didn't finish it til I checked it in the morning.

May just write an AHK script to window or close Media Center if it's running and then run TVAP.


----------



## blah238

One little quibble, the tray icon for TVAP does not remove itself when it shuts itself down. Other than that, looks like everything is peachy. Here are my scripts in case anyone is interested:

Post-processing batch file that moves the TVAP output to your Recorded TV folder, AFTER TVAP has written metadata to the file. Writes results to the TVAP log. Change the target and logfile lines as needed.


Code:


@ECHO OFF
setlocal
set srcfile="%~1.dvr-ms"
set retrycount=0
set target="G:\Recorded TV\"
set logfile="C:\Program Files (x86)\TVAP\TiVoVRDAutoProcessLog.txt"
echo Attempting to move %srcfile% to %target%

:TRANSFER
move %srcfile% %target%2>errortemp.txt
echo %errorlevel%
if %errorlevel% NEQ 0 (GOTO RETRY) else (GOTO SUCCESS)

:RETRY
FOR /F "delims=" %%R IN (errortemp.txt) DO SET result=%%R
del errortemp.txt
if %retrycount% GTR 0 echo Retry #%retrycount%...
echo Error: %result%
if %retrycount% GEQ 3 GOTO FAIL
set /a retrycount = retrycount + 1
PING 1.1.1.1 -n 1 -w 5000 >NUL
GOTO TRANSFER

:FAIL
echo %date% %time% File move for %srcfile% failed after 3 retries with error: %result%
echo %date% %time% File move for %srcfile% failed after 3 retries with error: %result%>>%logfile%
GOTO EOF

:SUCCESS
del errortemp.txt
echo %date% %time% File move for %srcfile% successful
echo %date% %time% File move for %srcfile% successful>>%logfile%
GOTO EOF

:EOF

And here's the AHK script for dealing with Media Center if it's running while TVAP is set to run. Paste into a file ending with .ahk. You'll need AutoHotkey installed to run it. You can set this as your Task Scheduler target. Change the RunWait line near the bottom if necessary.



Code:


; ehshell.exe is the name of Windows Media Center
Process, Exist, ehshell.exe
; Process sets ErrorLevel to the ProcessID (PID) of ehshell.exe
WMCPid = %ErrorLevel%

; If Media Center is running...
If WMCPid > 0
{
  ; ... checks to see if Media Center is in full-screen, and if so, unmaximizes the window
  WinGetPos, , , Width, Height, ahk_pid %WMCPid%
  If (Width = A_ScreenWidth And Height = A_ScreenHeight)
  {
    Remax = 1
    WinActivate, ahk_pid %WMCPid%
    Send !{Enter}
  }
}

; Runs TVAP, waits for it to close, and restores Media Center to full-screen if it was originally
; Change the path and options if necessary
RunWait, C:\Program Files (x86)\TVAP\TiVo-VideoReDo-AutoProcessor.exe -hotStart -shutdown:300, C:\Program Files (x86)\TVAP\
If Remax = 1
{
  WinActivate, ahk_pid %WMCPid%
  Send !{Enter}
}
ExitApp ;Done


----------



## dlfl

blah238 said:


> One little quibble, the tray icon for TVAP does not remove itself when it shuts itself down. Other than that, looks like everything is peachy. Here are my scripts in case anyone is interested:
> ...........


Thanks for posting the scripts. Glad it's working for you.

I've noticed the lingering-tray-icon effect on a number of programs. Usually if you pass or hover the mouse pointer over the icon it disappears. If this doesn't work, check task manager to see if there is a TVAP process actually still running. (Hopefully not!) I suspect this is a Windows quirk but maybe there's something that could be put in the program to force its removal.


----------



## blah238

It's just a graphical glitch. There's actually an AHK script that looks for and cleans up orphaned tray icons, however I think there must be a way for programs to clean up after themselves.

Maybe this AHK script will give you some clues.



Code:


SetTimer, TrayIcons, 500
^!a::msgbox % TrayIcons()

TrayIcons:
TrayIcons()
Return

TrayIcons(sExeName = "")
{
   DetectHiddenWindows, On
   idxTB := GetTrayBar()
   WinGet, pidTaskbar, PID, ahk_class Shell_TrayWnd

   hProc := DllCall("OpenProcess", "Uint", 0x38, "int", 0, "Uint", pidTaskbar)
   pRB := DllCall("VirtualAllocEx", "Uint", hProc, "Uint", 0, "Uint", 20, "Uint", 0x1000, "Uint", 0x4)

   VarSetCapacity(btn, 20)
   VarSetCapacity(nfo, 24)

   SendMessage, 0x418, 0, 0, ToolbarWindow32%idxTB%, ahk_class Shell_TrayWnd   ; TB_BUTTONCOUNT
   max = %errorlevel%

   Loop, %max%
   {
      i := max - A_index
      SendMessage, 0x417, i, pRB, ToolbarWindow32%idxTB%, ahk_class Shell_TrayWnd   ; TB_GETBUTTON

      DllCall("ReadProcessMemory", "Uint", hProc, "Uint", pRB, "Uint", &btn, "Uint", 20, "Uint", 0)

      dwData   := NumGet(btn,12)

      DllCall("ReadProcessMemory", "Uint", hProc, "Uint", dwData, "Uint", &nfo, "Uint", 24, "Uint", 0)

      hWnd   := NumGet(nfo, 0)

      WinGet, pid, PID,              ahk_id %hWnd%

      ifwinnotexist, ahk_id %hWnd%
      {
      idx := i+1
      ;MsgBox, 4, , Delete tray icon %idx%?
      ;IfMsgBox Yes
      deletetrayicon(idx)
      }

      tmp = index=%a_index%, i=%i%, pid=%pid%`n
      strayicons .= tmp

   }

   DllCall("VirtualFreeEx", "Uint", hProc, "Uint", pRB, "Uint", 0, "Uint", 0x8000)
   DllCall("CloseHandle", "Uint", hProc)

   Return   sTrayIcons
}

DeleteTrayIcon(idx)
{
   idxTB := GetTrayBar()
   SendMessage, 0x416, idx - 1, 0, ToolbarWindow32%idxTB%, ahk_class Shell_TrayWnd   ; TB_DELETEBUTTON
   SendMessage, 0x1A, 0, 0, , ahk_class Shell_TrayWnd
}

GetTrayBar()
{
   WinGet, ControlList, ControlList, ahk_class Shell_TrayWnd
   RegExMatch(ControlList, "(?<=ToolbarWindow32)\d+(?!.*ToolbarWindow32)", nTB)

   Loop, %nTB%
   {
      ControlGet, hWnd, hWnd,, ToolbarWindow32%A_Index%, ahk_class Shell_TrayWnd
      hParent := DllCall("GetParent", "Uint", hWnd)
      WinGetClass, sClass, ahk_id %hParent%
      If (sClass <> "SysPager")
         Continue
      idxTB := A_Index
         Break
   }

   Return   idxTB
}

Not sure what TVAP is written in but there is probably a way to do something similar in it.


----------



## dlfl

10 August 2008 Ver. 0.68
- Fixed: Tray Notify Icon remained after auto-shutdown.
- If your TVAPpostProcess or TVAPcleanUp batch file writes text lines to a file named TVAPlog.txt located in the folder containing the batch script, these text lines will be added to the TVAP log display and log file AFTER the batch completes. TVAP will prepend "BATCH MSG: " before each log line. TVAP attempts to delete the file after it has read it. If it can't (perhaps due to some permission problem) it adds a log message to that effect.

Here is an example of how to write a TVAP log line from your batch files:


Code:


set localDir=I:\videos\adscan\
echo Your text message line >> "&#37;localDir%TVAPlog.txt"

localDir should be the folder containing the batch file and be sure to include the final '\' at the end.

You can echo as many lines as you choose (but they are only added to the TVAP log after your batch file completes).


----------



## blah238

Works great! No problems to report. For the batch messages, I like that it puts the timestamp on it for you.

What was the key to making the tray icon disappear?

Now about that "recorded date/time" field... have not gotten a response on the VRD forums yet. What is different about this field versus any other metadata in a dvr-ms?


----------



## dlfl

blah238 said:


> ......What was the key to making the tray icon disappear?
> 
> Now about that "recorded date/time" field... have not gotten a response on the VRD forums yet. What is different about this field versus any other metadata in a dvr-ms?


A single statement "disposing" the notifyIcon object just before TVAP kills itself was needed. This doesn't seem to be needed (happens automatically) when the program is terminated normally by the user. It's a C# program.

I don't know what's different about the recorded date/time field. All I know is if TVAP sets it there is no error but it just doesn't take in files written by VRD while all the other tags do take. I have successfully set this tag in files that did not come out of VRD.


----------



## dlfl

6 September 2008 Ver. 0.69
- If you click the "Run VideoReDo" button for a file with status AWAITING CUTS (i.e., one for which AdScan without autocuts has been run, and it is waiting for you to do manual cuts), the project (.vprj) file will be loaded into VideoReDo.


----------



## dlfl

I got this question in a pm but am posting it and my answer here:



> .... What I would prefer is just to have your software move the .tivo recording off the TiVo box, convert to dvr-ms format, and copy to my Vista Media Center storage location on my Windows Home Server box. Then I can use the excellent DVRMSToolkit add-on and view shows with commercial skip. I move mainly movies from TiVo so I am not concerned by the length of time to process.
> 
> So, is there a way to set up TVAP to skip the Video-Re-Do portion- just move show off, convert to dvr-ms format, and store on Windows Home server?


Note that TVAP doesn't "move .tivo files off the TiVo box" -- that must be done by other means, such as TiVo Desktop or TivoPlaylist.

Just set TVAP up to do only the QSF, select the DVR-MS output type, and set the QSF destination folder where you want it to go. You will basically just be using VideoReDo as a file converter, although you also get the benefit of the "clean up" that QSF may do, and TVAP will poke metadata in the output file too.

Of course for this to work TVAP must be able to see your Vista Media Center storage location as a folder. Not sure if there are any complications regarding that.


----------



## dlfl

If you are interested in having automated MPEG4 conversion built into TVAP, instead of requiring a user-defined post process batch file as is currently done, please chime in here.

A recently released Source Forge project called fflib.net makes it relatively easy to add this capability to TVAP.

The advantage would be simplicity. However if you are already using the post process batch method there will be no advantage. In fact the price for simplicity is limited configurability. You will not have all the parameters and options for fine tuning conversions that you have when using HandBrake in a post process batch.

fflib.net is somewhat of a black box. There is almost no documentation. However in my initial testing it has converted to .mp4 with H264 video and AAC audio, .avi with MPEG4 video and mp3 audio, and FLV. You can set the video size and video- and audio-bitrates --- or you can let them default to automatic settings which seem halfway reasonable at least.

In one test I converted an hour long .mpg, which was generated by VideoReDo performing a QSF on a .tivo file. The output file was a .avi and I sent it back to my TiVo via pyTivo. It was quite acceptable.

I don't know if the .mp4's it produces are iPod compatible. If someone will tell me the video format and bitrates I will convert a small .mp4 and get it to them for test on their iPod.

My current thought is to have this capability as an automatic option in TVAP. If the fflib.net DLL file is installed in the run-time directory, TVAP will enable the option. The current post process batch capability would still be there in either case. I would add a button to pop up a configuration page where you would select video size, file fomat and bitrates, or defaults.

Let me know if you're interested.


----------



## jrusch

I am new to Tivo and new to trying to use this software. I need help. When I try and use this software, 0 byte files are created. 

This is from the log file:
12/11/2008 10:08:35 PM Started QSF, input: GaryUnmarried
12/11/2008 10:08:37 PM VideoReDo said: INFO: VideoReDo version 3. 1. 5. 564 - Jul 5 2008
12/11/2008 10:08:42 PM VideoReDo completed QSF, creating: D:\Export\GaryUnmarried_QSF.mpg
12/11/2008 10:08:42 PM Started Ad Scan/auto-cuts, input: GaryUnmarried
12/11/2008 10:08:44 PM VideoReDo said: INFO: VideoReDo version 3. 1. 5. 564 - Jul 5 2008
12/11/2008 10:08:45 PM VideoReDo said: INFO: Failed file open: D:\Export\GaryUnmarried_QSF.mpg. Will retry
12/11/2008 10:08:49 PM VideoReDo said: INFO: Failed file open twice: D:\Export\GaryUnmarried_QSF.mpg. Will retry
12/11/2008 10:08:59 PM VideoReDo said: ERROR: Unable to open file/project: D:\Export\GaryUnmarried_QSF.mpg


----------



## dlfl

jrusch:

I think your problem is a bad version (564) of TVSuite. Install the latest revision and try again. http://www.videoredo.net/msgBoard/showthread.php?t=6961

From the changelog for TVSuite version 566:
[Fix] COM: FileOpenBatch and FileOpenBatchPIDs don't work starting with Build 564

COM: FileOpenBatch is what TVAP uses for QSF. According to your log excerpt the QSF only took 7 seconds which seems suspiciously short.


----------



## dlfl

Tiny change: The title item in the pyTivo metadata file no longer incorporates the episode # and episode name (for series).

Remember to uninstall the previous version.


----------



## msmart

Speaking of metadata files...

I'm trying to figure out how to take the metadata text files created by TVAP and import them into an Excel file. Each line (without the header (before the ":")) to a column. Has anyone done this?

It would be nice to have the information contained in the metadata files in one file.

Oooh..... Feature Request... append the metadata information for a show directly into an Excel file on the next available row as TVAP processes each show.


----------



## dlfl

msmart said:


> Speaking of metadata files...
> 
> I'm trying to figure out how to take the metadata text files created by TVAP and import them into an Excel file. Each line (without the header (before the ":")) to a column. Has anyone done this?
> 
> It would be nice to have the information contained in the metadata files in one file.
> 
> Oooh..... Feature Request... append the metadata information for a show directly into an Excel file on the next available row as TVAP processes each show.


I know how to do this but I see it as risky because of complications due to possible variations in OS and version of Office installed.

I thought about an option to output a single line (per video) text file with delimited fields that would be easy to import into Excel with "Text-to-data". However this, (and the direct Excel write), has the issue of what do you do with multiple-entry fields such as vActor etc.? I guess you could assign a certain number of fields, i.e., four actor fields, and just take the first four(?).

There are some other design questions to be addressed if this goes forward, but first is a text file for import of interest to you?


----------



## msmart

Ah yes, the vActor and version dilemmas, understood.

I really only need three fields; description, seriesTitle, and episodeTitle. I copy those fields into an Excel spreadsheet to create a list of shows/movies that I've burned to DVD. I also copy the data into an application I use (Epson Print CD) to print the title and description directly onto printable DVD media.

I know this can be done with an Excel VB script but I'm not that good at it. I would be most appreciative if I could impose upon you to write one for me. It would open each of the metadata files in a directory and place the three fields into separate columns. I'm on Windows XP SP2 using Excel 2003.

If you were to add such a feature, I agree, use the first four actors and leave it at that. As for the pipe between first and last names, write it as is and leave it up to us to use find/replace to change it to a space or comma in Excel.


----------



## dlfl

Could you go for a C# program that does what you want? (TVAP is a C# program BTW.) If so, do you need to maintain more than one xl file? And do you want it to always process all files in a selected directory or select one or more files in a file browser? Should it create a new xl file each run, or add to an existing file? In the latter case it has to have logic to prevent duplicates.

The simplest case is there is only one xl file in a fixed location and it is completely recreated on each run using all metadata files in one folder. Many variations are possible but the programming gets more complex.

Fortunately we have the same OS and version of Office.


----------



## msmart

A C# program would be great.



> If so, do you need to maintain more than one xl file?


No.



> And do you want it to always process all files in a selected directory or select one or more files in a file browser?


All files. Once processed, I will move the files to a different folder.



> Should it create a new xl file each run, or add to an existing file? In the latter case it has to have logic to prevent duplicates.


A new one each time. I can copy its contents to a different "master" file.



> The simplest case is there is only one xl file in a fixed location and it is completely recreated on each run using all metadata files in one folder. Many variations are possible but the programming gets more complex.


Keep it simple, all files in folder to a new xl file each time the program is run.

Me thanks you in advance.


----------



## wgw

dlfl,

Would you you be able to add partCount and PartIndex to your metadata extracts? I does not get transferred to the Tivo, but it is viewable on the Info screen. Here is a sample from TiVoVideoDetails. I've added the fields to my pytivo git branch.



Code:


<partCount>2</partCount>
<partIndex>1</partIndex>


----------



## dlfl

wgw said:


> dlfl,
> 
> Would you you be able to add partCount and PartIndex to your metadata extracts? I does not get transferred to the Tivo, but it is viewable on the Info screen. Here is a sample from TiVoVideoDetails. I've added the fields to my pytivo git branch.
> 
> 
> 
> Code:
> 
> 
> <partCount>2</partCount>
> <partIndex>1</partIndex>


What are these? I don't see anything with those names in the TivoDecode XML data that TVAP reads from TiVo files via TivoDecode.dll. (I also don't see them in the pyTivo Wiki metadata page.)


----------



## wgw

They only appear when it's a multi part episode or series. When present, text like "Part Index 1 of 2", "Part Index 2 of 2" will appear on the info detail screen. For example, Man vs Wild - Siberia, airing this saturday on Discovery is part 1 of a 2 part episode. And "Land of Ice" airing Jan 19 is part 2.

I still need to add them to the wiki, as well as my other templates.


----------



## dlfl

OK, I'll record the Man vs. Wild so I can have a sample to test the XML parsing with. If it's in the XML string it should be no problem to add it to the metadata files. I assume the format would be:

partCount : 2
partIndex : 1

Correct? I also assume that either both items should be present or neither of them, correct?


----------



## wgw

dlfl said:


> OK, I'll record the Man vs. Wild so I can have a sample to test the XML parsing with. If it's in the XML string it should be no problem to add it to the metadata files. I assume the format would be:
> 
> partCount : 2
> partIndex : 1
> 
> Correct? I also assume that either both items should be present or neither of them, correct?


Yes, thats correct on all counts.


----------



## dlfl

pyTivo metadata output file now includes partCount and partIndex items if they are both present in the TiVo file metadata. This adds two items to the XML data file for each video, but there should be no complications. TVAP will create default values (empty strings) if the data isn't in the XML file, rather than failing due to missing data.

PyTivoMetaGen has been similarly modified.

Be sure to uninstall previous versions.


----------



## dlfl

If QSF is your entire VRD processing chain (i.e., no AdScan) and the "_QSF" in the output file name is undesirable, see this post on the VideoReDo forum.

This should work even if you are using a TVAPpostProcess batch file, since it is performed later in the TVAPcleanUp batch file. It should be fairly obvious how to extend it to rename whatever new video file (e.g., .mp4) is created by your TVAPpostProcess script.


----------



## dlfl

If you use HB 0.9.3 you might be interested in this post in another thread.


----------



## dlfl

7 February 2009 Ver. 0.72
- Added HandBrake stall detection for TVAPpostProcess scripts. If the script runs HandBrake, TVAP checks every 5 minutes to see if HandBrake used less than 10% of CPU time over 5 minutes. If so it kills HandBrake. A descriptive log message is written.

HandBrake completed an encode but didn't terminate the other day. Per the HandBrake forum such stalls occasionally happen to others, also. If you have several videos waiting to be processed, they are blocked since the TVAP post process never ends. This should prevent this.

If you suspect a problem due to this new feature please let me know -- and revert to Ver. 0.71, which is still on the download site.


----------



## CanMan00

Hey dlfl, I'm interested in seeing your HB post-processing scripts! I don't have 10 posts yet so I can't see any links in your signature.

I love the internet... Every time I think to myself, "Damn, this task I'm trying to do is a hassle. I wish I could make it easier..." I end up stumbling across a solution that someone much smarter than me has already been able to figure out.

First I found VideoReDo, then your TVAP program. Then I wrote my own PowerShell script to do some magic with the HandBrakeCLI afterwards and it looks like you may have already solved my problems there too. Thanks for writing it and sharing it with the rest of us!


----------



## msmart

I don't want to steal dlfl's thunder but I'll offer up mine so you can compare after he posts. My output is for iPod. I use the smaller resolution and a lower bitrate to make smaller filesizes but the picture quality is still good IMO.

The Handbrake version I've been using is a development version, newer than 0.9.2 but before 0.9.3 became final. I saw on the Handbrake forum that 0.9.3 introduced some undesirable side effects (won't go into them here you can visit their forum and make up your own mind). The svn1477 version seemed, to me, a little better than 0.9.2 so I've stuck with it.

TVAPpostProcess.bat


Code:


@echo off
setlocal

rem all folder path values should end with the '\' character

rem folder containing hbcli.exe (Handbrake installation folder)
set HBFolder=C:\Program Files\Handbrake_svn1477\

rem folder containing this batch file and .mpg video input file
set localDir=G:\VideoReDo AdScan\

rem destination folder for encoded output video
set outdir=L:\iPod Ready Video\

set mpgName="&#37;localDir%%~1.mpg"
set m4vName="%outDir%%~1.m4v"
if not exist %mpgName% goto done2
if exist %m4vName% del %m4vName%


"%HBFolder%HandBrakeCLI.exe" -i %mpgName% -o %m4vName% -e x264b30 -E faac -w 320 -b 384 -r25 -x keyint=300:keyint-min=30:bframes=0:cabac=0:ref=1:vbv-maxrate=384:vbv-bufsize=2000:analyse=all:me=umh:subme=6:no-fast-pskip=1 -B 160 -R 48

rem next line creates a log file of processed videos, if you uncomment it
echo %m4vName% >> "%outdir%HandbrakeBatchLog_svn1477.txt"

rem rename and copy pyTivo metadata file (if present) to output folder
rem if not exist "%localDir%%~1.mpg.txt" goto done2
rem set metafile="%outdir%%~1.m4v.txt"
rem copy "%localDir%%~1.mpg.txt" %metafile%
:done2
rem pause

Then there is the cleanup batch file which runs right after Post Process:

TVAPcleanUp.bat


Code:


rem @echo off
setlocal
set localDir=G:\VideoReDo AdScan\

set mpgName="%localDir%%~1.mpg"
set MetaDataName="%localDir%%~1.mpg.txt"

copy %MetaDataName% "M:\TiVo Edited Movies\Show Descriptions\%~1.mpg.txt"
del "%~1.mpg.txt"
del "%~1.vprj"

rem pause

Obviously you'll need to edit it to conform to your directory structure.

TVAP is a great tool, isn't it!! :up:

*ADDED:* CanMan, I just saw your post in the other thread, since you have 1080 files, my HB settings may not help you. But what you can do is use the HB GUI and get your settings the way you want them then there is a tab that creates a CLI string which can be copied to the batch file.


----------



## dlfl

No thunder to steal, msmart! Your batch files are as good as any using HB. All you have to do is set up the folders per the comments and modify the HandBrakeCLI arguments for your desired encoding.

I would say use msmart's script(s) and post problems here so we can help you out. There are aspect ratio quirks for TiVo files with HB 0.9.3 that caused me problems autocropping and encoding to 640x480 (4:3) or 640x360 (16:9), etc. and I can supply more info and links if you have that kind of problem. HB 0.9.2 didn't have these issues, but I don't want to be stuck in the past.

msmart, is the version of HB you use still downloadable from their site?


----------



## msmart

> msmart, is the version of HB you use still downloadable from their site?


 It doesn't appear so, NO. 1477 was 0.9.2 Snapshot Build 2. I tried build 3 but didn't like it so went back to 2. However, it looks like 1477 already had the aspect ratio problem per THIS thread.

So it would appear that 0.9.2 is your best bet with 1080 video for now. I saw your posts on the HB forum, looks like you're working on them.


----------



## CanMan00

Thanks guys! This will save me a lot of time by mooching off your work rather than trying to figure out how to automate it all from scratch. I appreciate it!

I'm not 100% sure yet, but I think the autocropping might be part of the problem that the PS3 is choking on. I got one 1080i video from TBS HD to work. For some reason the Tivo grabs the file as 1920x108*8*. When I set HandBrake to crop it to 1920x1080 the PS3 was able to play it. But I was also messing around with some of the x264 settings at the same time. I need to go back and use a little scientific method to narrow it down to make sure that's what the problem was.

But, that was just one show from one channel. It still choked on some shows originally shot in SD that were played on Showtime HD. Those had some kind of strange 1580x1080 resolution (I don't remember exactly what the resolution was other than something silly like that).

I'd appreciate any links you've found that would help explain exactly what the problem is and how I can work around it.


----------



## goodtrips

Hey dlfl, haven't posted in a while so hope all is good.

Unfortunately i've had a recurrence of an old issue and haven't had any luck fixing it. qsf starts, but can't seem to find the file. The progress bar stays blank, and I get the following windows notification about 10 seconds after starting:

VideoREDo - TVSuite
Mpeg stream error: Video program stream not found.

When I click OK, it then tries to do ad scan, but of course chokes because there's no QSF file. I've downloaded the latest version (72) with no luck. It's almost as if TVAP doesn't have write access to the target directory. Nothing changed from a set-up standpoint, but I've noticed that the properties for that target folder have Read Only selected (green box). I've tried to change this but it doesn't seem to stick; to my knowledge, though, the folder has always been set this way.

Here is a log file snippet that is indicative of the failure:



Code:


3/21/2009 8:09:58 AM Started QSF, input: The Daily Show With Jon Stewart (Recorded Mar 16, 2009, COMEDY)
3/21/2009 8:10:01 AM VideoReDo said: INFO: VideoReDo version  3. 1. 5. 564 - Aug  5 2008
3/21/2009 8:10:32 AM VideoReDo completed QSF, creating: C:\Documents and Settings\goodtrips\My Documents\TiVo\TiVo Dumps\The Daily Show With Jon Stewart (Recorded Mar 16, 2009, COMEDY)_QSF.mpg
3/21/2009 8:10:32 AM Started Ad Scan/auto-cuts, input: The Daily Show With Jon Stewart (Recorded Mar 16, 2009, COMEDY)
3/21/2009 8:10:54 AM Ad Scan canceled: Input file not found: C:\Documents and Settings\goodtrips\My Documents\TiVo\TiVo Dumps\The Daily Show With Jon Stewart (Recorded Mar 16, 2009, COMEDY)_QSF.mpg

Any thoughts?


----------



## dlfl

goodtrips,

My immediate thought is I see you're using a rather old version of TVSuite. Unless you have some objection, I would suggest upgrading to the latest version (572). I've been using 568 recently.

Will the problem tivo file open and QSF "manually" using the TVSuite program?

Also, uninstall and re-install TVAP and reboot your PC, just as precautions.

Diagnostic questions:
1. Is the TiVo file that QSF is failing to find just finishing up being transferred or copied to the TiVo transfer folder?

2. Is the TiVo file on your HD (e.g., C: )?

If the file is being *copied* by Windows, or another program or script, rather than *transferred* by TivoDesktop, Windows sets the file size to the total size immediately at the start of the copy, so TVAP has to use special logic to be sure it waits for the copy to be complete before it launches a QSF (or Adscan). Without going into the gory details, if the copy takes longer than 60 sec per GB of file size, the kind of problem you are seeing could occur. (QSF is being attempted on a file that is not complete.) This would be most likely if you are copying to or from a USB HD or a network drive. Transfers via Desktop do not have this issue -- they increment the file size gradually during the transfer and TVAP can just check that the file size has not increased over a certain time period to determine the transfer has ended.


----------



## goodtrips

thanks dlfl. couple of things:



> My immediate thought is I see you're using a rather old version of TVSuite. Unless you have some objection, I would suggest upgrading to the latest version (572). I've been using 568 recently.


I looked for an update today, but it looks like the version I'm using (564) is the most recent release, at least per their website. Is there a link to beta releases available?



> Diagnostic questions:
> 1. Is the TiVo file that QSF is failing to find just finishing up being transferred or copied to the TiVo transfer folder?)


Yes, everything has completely transferred. At this point, I'm working with a week's worth of files that are stacking up. 



> 2. Is the TiVo file on your HD (e.g., C: )?


Yes, everything is located locally on my C: drive

I had one other thought: I received a notification from TiVo Desktop to upgrade to a newer version and declined the update. Files have been continuing to transfer successfully from the TiVoHD to the computer (as far as I can tell), so not sure if that is a valid data point or not. Just seems odd that everything would work for 6+ months and then stop.


----------



## dlfl

goodtrips,

For TVSuite updates go to their Forum in the TVSuite Beta section for the link.

I just duplicated your problem and concluded the time I'm allowing for file copies was not enough in some cases. However, if all your tivo files have already been in place for some time, this would not explain your problem.

I've come up with a better method for checking copy completions and hope you (and any one else who volunteers) will test it. It's on the TVAP download site, the file with "test" in its name. This is just the TVAP executable file, not an installer package. Just move or rename your current executable to save it, and sub the test version, renamed without the "test" in the name.

Also, can you watch a tivo file in Windows Explorer while DeskTop is transferring it? Keep clicking View->Refresh and observe the file size. Does it start small and grow (like mine does) or does it jump immediately to the full file length at the start of transfer? It's possible later versions of Desktop or different versions of Windows have different behavior.

However, as I said, this change should make no difference if you are having problems with tivo files that have been in place for a while, rather than just finishing being transferred or copied. I hope maybe updating your TVS version will help in that case.

Another thought: If desktop is still running (even though it transferred your tivo file long ago) and is buggy enough, it might still be telling Windows that it is "using" the tivo file. This will prevent another program from opening it. Do you leave Desktop running all the time?


----------



## goodtrips

So a couple of updates:

Updated VideoReDo to 572 and tested out your test exe file. Still no luck unfortunately.

I believe TiVo Desktop runs as a background service, so that is always running. I do have to open the application from time to time, and might leave it open for a day or two, but close it with no effect. I do notice when I restart that one of the TiVo services always needs to be forced closed before the machine will reboot (don't remember which one).

I'm not sure what other application other than Desktop could be using that file, but that made me think of another potential data point: I do "share" a few of the directories in the My Documents parent directory, but have never had an issue in the past. I've read that this could have some wonky effect on directory permissions (and potentially the read-only behavior I mentioned earlier).

I'm working from memory, but I'm fairly confident you can see the file size increase in explorer as it is being transferred.


----------



## dlfl

Do the problem files process OK if you open them in TVSuite?

There are problems with QSF if the video dimensions change within a file but I know your are quite familiar with that issue from reviewing your posts in the TVAP thread of the VRD forum. I don't think it generates the messages you are getting.


----------



## dlfl

Another long shot:

Maybe the total path name of the tivo file is too long for the VRD COM interface(?) Try renaming the file to just "test.tivo". (Stop TVAP processing, transfer the file then rename and restart TVAP processing.)


----------



## goodtrips

OK, I think there's been some progress, but very strange behvaior.

I tried renaming the file to video.TiVo. I started TVAP and dragged the file into the source folder. The QSF process started (with progress bar) and completed successfully. Ad Scan started, but then choked because of the resolution issue (my filters in the QSF.vbs file are based off of file name).

But... changed the file name to Colbert.TiVo (to match the filter). That file failed on QSF as everything has been.

Changed the file name to the lowercase colbert.TiVo (and seemed to work), but my QSF filter must be case sensitive, because it failed again on the resolution change.

Changed the QSF filter to lowercase "colbert", tested lowercase colbert.TiVo, failed on QSF again.

Changed the QSF filter to uppercase "Colbert", tested lowercase clbert.TiVo, QSF worked, failed on ad scan resolution.

From what I can tell, my QSF.vbs file is at least partially responsible for breaking the process. Here is what it looks like:



Code:


percentComplete=0.0
set Args = Wscript.Arguments
'Wcript to perform QSF
rem Set VideoReDo = WScript.CreateObject( "VideoReDo.Application" )
set VideoReDoSilent = WScript.CreateObject( "VideoReDo.VideoReDoSilent" )
set VideoReDo = VideoReDoSilent.VRDInterface

rem Wscript.echo( VideoReDo.VersionNumber) 
VideoReDo.SetQuietMode( true ) ' Save without any display
wscript.stdout.writeline("INFO: VideoReDo version " & VideoReDo.VersionNumber)

openFlag = VideoReDo.FileOpenBatch( args(0) )
if openFlag = false then
	wscript.stdout.WriteLine( "ERROR: VideoReDo failed to open file/project: " & Args(0) )
	Wscript.quit 1
end if
if instr(Args(0), "Daily Show") > 0 then
   VideoReDo.SetFilterDimensions 704, 480
elseif instr(Args(0), "Colbert") > 0 then
   VideoReDo.SetFilterDimensions 704, 480
end if

dim filesys
Set filesys=CreateObject("Scripting.FileSystemObject")

rem Wscript.echo( "fps = "& VideoReDo.GetFrameRate() & ", Duration = " &  
VideoReDo.GetProgramDuration())
 
if NOT VideoReDo.FileSaveAsEx (Args(1), Args(2)) = 0 then
	While( VideoReDo.IsOutputInProgress() )
		on error resume next
		percentComplete = CInt(VideoReDo.OutputPercentComplete)
		if NOT err.number = 0 then
			percentComplete = 0
		end if
		on error goto 0
		Wscript.StdOut.WriteLine(percentComplete)
		Wscript.Sleep 2000
		If filesys.FileExists(".\stopper.txt") Then
			wscript.stdout.WriteLine("Aborted QSF: " & Args(0) )
			wscript.quit 3
		end if
	Wend
else
	wscript.stdout.WriteLine("ERROR: VideoReDo failed to save file: " & Args(1) )
	Wscript.quit 2
end if


VideoReDo.Close()
Wscript.quit 0


----------



## dlfl

Hmmm... Kind of confusing results.

Are you using the "test" version of TVAP? If you are copying files into the tivo transfer folder, from a folder on the same drive, while TVAP is processing, you should be using that version. (That is the case were all released versions may not allow enough time for the copy.)

Are your dimension-change errors always occuring during AdScan, not during QSF? (I would think they should occur during QSF.) OR, maybe QSF is just producing an empty file because nothing in the video matches the filter dimensions, and then AdScan fails because of trying to load an empty file (??). If you uncheck Delete QSF you should be able to check that easily.

Are your QSF failures always the same failed-to-open message?

Yes the string comparisons you're using in QSF.vbs are case sensitive. There are VBScript string functions that could convert both strings to upper or lower case before comparison, but I don't remember them right now.

I don't remember whether I tested this back when, but maybe the filter dimension statements should go *before* the VideoReDo.FileOpenBatch statement(?).

Eventually, if we have to, we will set up a test case outside TVAP where we just call the QSF.vbs or AdScan.vbs with test arguments. Then we can post the test case on the VRD forum and ask for help. I can help do this.

I don't know when VRD is ever going to add a COM function to pre-scan a video and find the dominant video dimensions, (or return a list of video dimensions), which would allow TVAP to automate filter setting.


----------



## goodtrips

So I think I've managed to pair this down a little:

I'm using two file types:
A) a file with a QSF filter set (for the resolution issue)
B) a file that does not have a resolution issue and no filter in QSF

First Test:
I disabled QSF and tested both A&B. Both files fail with the following error:
*VideoReDo said: INFO: Failed file open: [location/file name]. Will rety.*
It then attempts two more times (fails both) and moves on the to next file.

Second Test:
Re-enabled QSF. File type A (with filter).
QSF begins, error window quickly pops up: *Mpeg stream error: Video Program Stream Not Found*

Third Test:
QSF Enabled. File type B (without filter)
QSF begins, progress bar in TVAP works and completes.
Strangely, just started working. Was getting the same error in first test above, though.

Of course, the thing that is really confusing is that everything (including the filters) worked for about 6 months without a hiccup.


----------



## dlfl

I'm still curious: Do these files open and process manually in VRD ?

Do they play in WMP? Both VRD and WMP use the Direct Show codecs installed with TiVoDesktop to input the TiVo files.


----------



## goodtrips

Yes on both counts -- they open and play fine in WMP and opening them manually in VideoReDo has no issues. I've been adding new files to my test group every day, and they all exhibit the same behavior from TVAP.


----------



## dlfl

All I can suggest at the moment is uninstall both VRD and TVAP and reboot, maybe a couple of times. Then re-install. Just desperation moves, actually.

Also, you could try an older version of TVAP. The last two versions are on the download site. Can you relate when the trouble started to TVAP version numbers?


----------



## goodtrips

sadly, i've uninstalled tvap & videoredo, cleaned up the registry (cc cleaner), reinstalled, changed target directories, multiple restarts... still no dice.

short of doing a complete wipe and reinstalling xp, i'm coming to terms with the fact that i'm out of luck. thanks for all your help, though, dlfl!


----------



## dlfl

As illustrated in this post on the VRD forums (free program) comskip is viewed as an attractive alternative to VRD AdScan for detecting commercials.

If there is user interest I will look into adding a comskip option to TVAP.


----------



## jimbob111

mewbie question. does this app allow videos of the same name, i.e. TV Shows back to the tivohd in a folder for convenient filing/storage after the shows have been edited and transferred back to the tivohd? thanks!


----------



## dlfl

jimbob111 said:


> mewbie question. does this app allow videos of the same name, i.e. TV Shows back to the tivohd in a folder for convenient filing/storage after the shows have been edited and transferred back to the tivohd? thanks!


TVAP doesn't send or receive files to/from your TiVo. I see you've already posted in the StreamBaby thread. Your question might also be appropriate in the kmttg and pyTivo threads.


----------



## dlfl

dlfl said:


> As illustrated in this post on the VRD forums (free program) comskip is viewed as an attractive alternative to VRD AdScan for detecting commercials.
> 
> If there is user interest I will look into adding a comskip option to TVAP.


OK, that idea is dropped due to underwhelming user interest!

So time for a new one! How about (optional) automatic pushing of videos back to your TiVo after TVAP finishes processing them?

This idea was inspired by a recent post by *cadmium*, who was kind enough to share a code snippet showing how to do it. It relies on pyTivo to do the pushing -- all TVAP has to do is send an HTTP command to pyTiVo.

A possible feature would be for TVAP to queue up pending pushes and only command the pushes when (1) TVAP is not processing any videos and (2) pyTivo is running This feature could be of value if you're concerned about the processor loading of simultaneous TVAP-controlled encoding and pyTivo pushing (which also may involve encoding).

I usually transfer my encoded .mp4 files back to the tivo to check how they look on the TV, although their intended purpose is archiving.

I don't expect much user interest in this but .... surprise me!


----------



## lrhorer

This program has the basic mechanics of just what I want, but doesn't seem to quite fit the bill. I avoid using TiVo Desktop as much as possible, and none of the (very large number of) files I want to process are .TiVo files. What I want to do is auto-select .ts files from a specific directory and run the VRD Ad Detective on them automatically, saving the .vprj file for later manual inspection of the cuts before final processing. Is there any possibility the ability to handle other file types than just .TiVo files could be incorporated?


----------



## lrhorer

dlfl said:


> So time for a new one! How about (optional) automatic pushing of videos back to your TiVo after TVAP finishes processing them?


I don't think this is possible. Nothing I have read suggests TTGB transfers can be initiated from the PC side at this time. I would love to be proved wrong on this.



dlfl said:


> I don't expect much user interest in this but .... surprise me!


Oh, I would definitely be interested, if it's possible, but I don't believe either the HMO or HME interfaces allow for PC side initiated PC => TiVo transfers.


----------



## dlfl

Irhorer,

As stated in my previous post:



> It relies on pyTivo to do the pushing -- all TVAP has to do is send an HTTP command to pyTiVo.


pyTivo, at least wmcbrine's version, has been pushing videos back to TiVo for months now. However, due to underwhelming interest (including not much on my part actually) the TVAP-push idea has been abandoned.

There has been some interest from time to time in having TVAP work on input files other than TiVo. Don't know if I will ever get around to making such a program -- it's not just a trivial mod of TVAP and I don't have a personal need for it -- not yet at least.

Right now, I think DirMon is the way to automate this. It will monitor folders and you should be able to have it launch a batch or script file that would run VideoReDo via its COM interface, which is what TVAP does.


----------



## lrhorer

That's lrhorer, if you please, not irhorer.

OK, I misread wmcbrine's post talking about the inability to push .tivo files, taking it to mean no files could be pushed to the TiVo. That .mpg files can be pushed is really good news, as that is all with which I am dealing.

As to the other, it looks to me like DirMon is a windows application. I don't need a Windows application if pyTiVo has an interface for transferring files to the TiVo. Worst case I can use Expect to pass the info to pyTivo via http.


----------



## smithcferg

Hi, great program.

Is there a way you could include closed caption decoding into the pipeline?

Perhaps incorporate t2sami.exe? or tivodecode? Would be great for my spouse and other hearing impaired would be grateful too.

Thanks for all your hard work on this!

Craig


----------



## dlfl

smithcferg said:


> .......Is there a way you could include closed caption decoding into the pipeline?.........


I think so. I'm assuming you just want TVAP to create a .srt file as part of the workflow -- is that correct? It looks like this can then be used with StreamBaby to provide CC's. I'm just now graduating to HD TiVo so will be able to test this with StreamBaby soon. This will work if you use a TVAP post-process file to transcode the TiVo/Mpeg2 to an MPEG4 format.

If you just use VideoReDo (e.g., via TVAP) to create an edited mpeg2 file (.mpg) or TiVo (.tivo) file, the CC info is still embedded and correctly edited in the stream and will display if you transfer it back with pyTiVo.

Actually the creation of the .srt (or SAMI) file would be quite easy using the (user supplied) TVAPpostProcess batch file capability built into TVAP already. You would just install T2SAMI and then a line or two in the post-process script file would run its extraction command-line program on the mpeg2 file that resulted from the TVAP/VideoReDo work flow.

Just FYI, CC will work in VLC media player with either type caption file extracted from the mpeg2 file output from VideoReDo when you play the .mp4 file transcoded from this file (e.g., with HandBrake using a TVAPpostprocess batch file). I tested this with a movie that had been heavily edited to remove commercials. The CC's stayed in sync throughout.

My current thinking is that running the CC extraction from the post-process file is so easy that integrating it into TVAP may not be worth the trouble. If anyone is interested I'll be glad to provide instructions and a sample script file for this -- or if someone beats me to it, please post here for everyone.

EDIT: Well I went ahead and did it. Just install T2Sami in its default location then here is what you put in your TVAPpostProcess.cmd file:



Code:


@echo off
setlocal

rem all folder path values should end with the '\' character

rem folder containing this batch file and .mpg video input file
set localDir=I:\videos\adscan\

rem destination folder for transcoded output video
set outDir=J:\Videos\mp4transcodes\

set mpgName="&#37;localDir%%~1.mpg"
if not exist %mpgName% goto done2

rem Generate CC file with T2Sami
set t2samiFolder=C:\Program Files\T2Sami\
"%t2samiFolder%t2extract.exe" -f srt %mpgName%
if not exist "%localDir%%~1.srt" goto doneCC
set ccFile="%outDir%%~1.srt"
copy "%localDir%%~1.srt" %ccFile%
del "%localDir%%~1.srt"
:doneCC

rem transcoding commands here

:done2

Most of the lines were required because I couldn't get the -p (output path) option of t2extract.exe to work so I could specify my transcoded file folder as the place for it to put the .srt file.

If you want a SAMI formatted CC file, just remove the "-f srt" option and change ".srt" to ".smi" everywhere.

Of course you have to substitute folder names appropriate to your system.


----------



## jmemmott

dlfl said:


> Most of the lines were required because I couldn't get the -p (output path) option of t2extract.exe to work so I could specify my transcoded file folder as the place for it to put the .srt file.


I checked out the version that is up there now and there is a problem with the separator between the directory and filename when you use the -p option. If you are in a hurry, you can use Unix style forward slashes and it will work :

"C:\Program Files\T2Sami\t2extract.exe" -f srt -p "D:/My Video/" -f srt "E:\Tivo\Sanctuary - Revelations.mpg"

creates "D:\My Video\Sanctuary - Revelations.srt"

Otherwise, I am currently regression testing a new release that adds support for DVD subtitle streams => .srt and/or closed captions. Should be available in a couple of days. It will have a fix for this in it as well.


----------



## dlfl

dlfl said:


> I think so. I'm assuming you just want TVAP to create a .srt file as part of the workflow -- is that correct? It looks like this can then be used with StreamBaby to provide CC's. I'm just now graduating to HD TiVo so will be able to test this with StreamBaby soon. This will work if you use a TVAP post-process file to transcode the TiVo/Mpeg2 to an MPEG4 format.
> ........
> Just FYI, CC will work in VLC media player with either type caption file extracted from the mpeg2 file output from VideoReDo when you play the .mp4 file transcoded from this file (e.g., with HandBrake using a TVAPpostprocess batch file). I tested this with a movie that had been heavily edited to remove commercials. The CC's stayed in sync throughout.
> ..........


Follow up: I've now tested this with StreamBaby on my new TiVo HD. Worked great!


----------



## dlfl

jmemmott said:


> I checked out the version that is up there now and there is a problem with the separator between the directory and filename when you use the -p option. .... I am currently regression testing a new release that adds support for DVD subtitle streams => .srt and/or closed captions. Should be available in a couple of days. It will have a fix for this in it as well.


Just tested the t2sami release dated 5/28 with the added DVD subtitle support -- but doesn't look like it fixed the -p separator issue (?).


----------



## jmemmott

dlfl said:


> Just tested the t2sami release dated 5/28 with the added DVD subtitle support -- but doesn't look like it fixed the -p separator issue (?).


Could you give the exact command line you are using. I just ran the following against the current release :

"C:\Program Files\T2Sami\t2extract.exe" -f srt -p "D:\My Video" "E:\Tivo\Sanctuary - Revelations.mpg"

and it created a 75KB captioning file :

D:\My Video\Sanctuary - Revelations.srt

as expected. Something not so obvious seems to be happening.


----------



## dlfl

jmemmott said:


> Could you give the exact command line you are using. I just ran the following against the current release :
> 
> "C:\Program Files\T2Sami\t2extract.exe" -f srt -p "D:\My Video" "E:\Tivo\Sanctuary - Revelations.mpg"
> .......


Try adding a final '\' at the end of your output path. When I removed that it ran OK.


----------



## goodtrips

> If there is user interest I will look into adding a comskip option to TVAP.


OK, I'll bite. An unfrotunately delayed bite, however.

Recently I've been using a completely custom batch file (scheduled) to run through all the tasks once a TiVo file has been downloaded (Tivo File > VRD QSF > Comskip > VRD VPrj Cut > Handbrake > AtomicParsley for meta data > iTunes. Upgraded to the Windows 7 beta and have been nothing but issues with the Task Scheduler, though, and am looking at TVAP as a possible solution once again.

Having used both the commercial cutters in VRD and Comskip, in my opinion Comskip consistently does a more thorough and accurate job. Not perfect, but a significant improvement over VRD imo.

I know you're only getting one vote, but here's hoping


----------



## dlfl

goodtrips,

I thought you were unable to use TVAP because of mysterious file open problems, which to my knowledge were never resolved. Have you run TVAP on Windows 7 ? Would hate to add Comskip just to find you couldn't use TVAP anyway, since you appear to be part of a very small minority interested in using comskip.

If I did add it, I hope I can count on you for some help regarding installation, configuration and command line arguments, since I've never used comskip myself. One question is whether comskip should be distributed via the TVAP installer or just installed separately.


----------



## dlfl

ComSkip commercial detection may be sustituted for VideoReDo Ad Detective by checking "Use ComSkip Ad Scans" in Default Settings. The "Do Ad Scan" check boxes in Default Settings and in "Settings For Selected File" determine whether commercial detection (of any type) will be done. ComSkip will be used only if
1. The output type is MPEG2.
2. A QSF is performed. (ComSkip cannot use a .TiVo file as input.)
3. ComSkip.exe and a valid ComSkip.ini file are present in the ComSkip subfolder of the TVAP installation folder. The TVAP installer places these files there although it will not uninstall or overwrite an existing ComSkip.ini file.

If the conditions to use ComSkip are not met, Ad Scans will default to using VideoReDo Ad Detective as before.

More details may be found in the TVAPreadme.txt file, in particular the "Things To Know" section, item 20.

The ComSkip.ini file can of course be customized as desired. Users are referred to the ComSkip web sites ( http://www.comskip.org/ and http://www.kaashoek.com/comskip/ ) for additional ComSkip information.

My experience with ComSkip has been just what it took to get it integrated into TVAP. So I hope I haven't done anything too ridiculous. It seemed to work fine in my (limited) testing with the default ini file.

Post any problems or suggestions and, as always, the previous version is available on the download site.


----------



## Icarus

Hi,

I'm just getting started with tvap, using video-redo to do the cuts, and save a project file, then manual review/save.

The first couple of files, I had it save the file as mpg, and did the cuts using the mpg file, but I think the resulting file (trimmed to ipod touch resolution using handbrake) didn't have the meta data. I see some text files in the directory I set up for the vprj files, but I had no idea what to do with them to get the meta data back in the final file.

So, this time around, I'm giving it a try saving the intermediate files as tivo files, and the plan is to use my modified ttg+ h.264 profile to do the final conversion to mp4, which, I believe should retain all the meta data for itunes. Is that correct? I think I will have to exit tvap, move the files back to the tivo dir, and then run ttg's gui to do the final conversions. Is there a better way to do this? I like the output files I got from handbrake, as they were better optimized for the ipod touch, but I don't like the loss of the meta data because itunes doesn't recognize it as a tv show and doesn't categorize the file properly.

I'm also wondering what tvap is waiting for now with all those files in the "waiting for cuts" state. How do I get rid of that? Cleaning up the directories? What does it intend to do? I do have it set to delete the original tivo file and intermediate qsf file. Does it want to delete the qsf file? Is that it? Where am I supposed to save the cut output to so it recognizes that I'm done?

Is there a better way for me to automate the final steps of converting the cut output to an mp4 with meta data suitable for my ipod touch than what I'm doing? All my files are HD, so they are huge until they are downsized in my final conversion process. TTG with my modified H.264 profile gets an hour down to about .5G. handbrake with it's better optimized settings is about 1/2 that size, and the 16:9 output seems to fully fill the touch's screen.

You know what would be really nice here? If I could do the final down-rez in video-redo and save it as mp4 right there. I wish they supported that, with profiles built-in for the popular players, like the ipod touch, etc, as with handbrake.

Thanks,
David


----------



## dlfl

Icarus said:


> Hi,
> 
> I'm just getting started with tvap, using video-redo to do the cuts, and save a project file, then manual review/save.
> .............
> I'm also wondering what tvap is waiting for now with all those files in the "waiting for cuts" state. How do I get rid of that? Cleaning up the directories? What does it intend to do?........
> Is there a better way for me to automate the final steps of converting the cut output to an mp4 with meta data suitable for my ipod touch than what I'm doing?.......


Sorry the TVAPreadme.txt isn't very clear on this: The files in the AWAITING CUTS status are waiting for you to load the .vprj file in VideoReDo, and review/modify the cuts.

1. Select the file that is AWAITING CUTS in TVAP.
2. Stop TVAP processing (click Stop Processing button).
3. Click the Run VideoReDo button. This will load the project file into VRD so you can do your review and modify the cuts if necessary.
4. Save the project file from VRD (which will be offered on the file menu, including the project name) and quit VRD. Note: You must save the project file even if you don't modify the cuts. This updates the timestamp on the file so TVAP knows you have reviewed it.
5. Start Processing in TVAP (Click the Start Processing Button). TVAP will now command VRD to save the file to your Ad Scan destination folder with the cuts defined in the project file. If you have a TVAPPostProcess.cmd file in that folder it will then run that script file on the video, perhaps doing a HandBrake encoding.

You can do multiple files in steps 3 and 4. You don't have to just do one at a time.

TVAP just creates pyTivo metadata files in the final destination folder. These are text files named .mpg.txt and HandBrake cannot use them. I don't know how you would get this metadata into the .mp4 files, although there may be a way to do it. I don't think HandBrake itself can do it.

If you check Delete Tivos and Delete QSF in the settings, you should not have to delete any intermediate files.

If you want to accept the automatic commercial cuts done by Ad Detective or ComSkip, just check Auto Cut after Ad Scans in the settings. Then you will never see the AWAITING CUTS status.

There is no reason to use TiVo output type for your purposes, as far as I understand it.

Hope this helps.


----------



## Icarus

aha, just save the project file. I was saving the entire output when I told tvap to run videoredo. ok thanks for that. that makes sense now that you explained it.

so, it doesn't make sense that I lost the metadata before the way I did it? Basically I was doing it manually, I guess, and not letting tvap do the entire thing. I guess I will try it again.

In order to used handbrake, I need one of it's supported file types output. The selections in tvap that seem to make sense to me are tivo and mpg, but of course handbrake doesn't take tivo input. So I should be using MPEG2 as the output in tvap, right? And if I do it right, it should keep the metadata all the way through the process, right?

Thanks for all this and the help.

-David


----------



## dlfl

Icarus said:


> aha, just save the project file. I was saving the entire output when I told tvap to run videoredo. ok thanks for that. that makes sense now that you explained it.
> 
> so, it doesn't make sense that I lost the metadata before the way I did it? Basically I was doing it manually, I guess, and not letting tvap do the entire thing. I guess I will try it again.
> 
> In order to used handbrake, I need one of it's supported file types output. The selections in tvap that seem to make sense to me are tivo and mpg, but of course handbrake doesn't take tivo input. So I should be using MPEG2 as the output in tvap, right? And if I do it right, it should keep the metadata all the way through the process, right?
> 
> Thanks for all this and the help.
> 
> -David


Glad things are starting to make sense!

Yes, mpeg2 is the output type you want for input to HandBrake.

Yes, TVAP will keep the pyTivo metadata file all the way through -- it will be in your Ad Scan destination folder along with the final version of the .mpg output file.

Here is a link where you can download an example TVAPPostProcess.cmd file for HandBrake encoding. It may be a little out of date and you will have to tune the HandBrake options to suit your purpose. Don't hesitate to ask for help.


----------



## Icarus

Thanks, I will take a look at the file.

I'm still confused, because I'm not understanding what I need to do to keep all the metadata (program information) right in the encoded file. It's included in the .tivo file, and when I've done the process by hand without using tvap or videoredo, the metadata ends up included in the mp4 file and itunes can read it and classifies the show properly with the show title, episode name and synopsis. It doesn't come from a separate file, at least as I understand it.

I'm not using pytivo, but if I were, I'm sure those files might be useful. I want to make sure the metadata stays right in the encoded file and isn't somehow stripped from it when I process it.

-David


----------



## Icarus

Let me try doing it the "right way" and see if I get the results I want. I will report back.

Thanks again.

-David


----------



## Icarus

ok, so in this thread, around posts #23 - #27, it says that vrd maintains tivo meta data, but if I use vrd to save as mpg, it's all lost, I guess. In that case, all you get is the filename.

http://www.tivocommunity.com/tivo-vb/showthread.php?t=330218

Somehow using ttg+ to convert the tivo to h.264, it isn't lost, I think. Looks like I have to do that. What a pain. Or I live without the metadata for now, and get all these uncategorized videos on my ipod touch.

ok, I really want vrd to output h.264 with profiles for the output resolution. That would really handle everything I need, assuming it can manage to insert the meta data properly in the h.264 file, like ttg+ conversion to h.264 does. Then once they do that, you can integrate those choices into tvap. 

In that case, I think the steps in tvap might be something like:

1. vrd qsf output to .tivo
2. vrd ad-detect, create project file.
3. wait for manual project file update
4. vrd apply cuts from project file and output to h.264 (mp4) with resolution profile.
5. clean up.

An optimization would be to do the h.264 and down-res conversion in step 1, because the ad-detect and rest of the processes would be much faster with the much smaller files.

-David


----------



## Icarus

meta data in an mp4 file. File was run through tvap, keeping the file in .tivo format. Then copied the cut .tivo file back to the tivo dir, and used ttg+ to convert to h.264 (modified profile for ipod touch.) The meta data is there in the h.264 file (mp4) as shown in the quicktime player:


----------



## dlfl

11 June 2009 Ver. 0.74
- Fix: For some large files, when using ComSkip without autocuts (manual review mode) autocut would be performed, i.e., skipping the "AWAITING CUTS" manual review.

This was caused by an arcane .vprj timestamp issue. The fix requires that at least 30 seconds elapse between when TVAP creates the project file and when you save that file from VideoReDo after reviewing cuts. Seems unlikely
anyone would beat that time but if you do, TVAP simply still thinks the video is awaiting cuts. (Obvious workaround, don't be so lightning fast in doing your manual cuts.)

This version also did a very minor polish on the TVAPReadMe.txt file.


----------



## dlfl

Icarus,

Take a look at this post in the kmttg thread.

Looks to me like there is a windows executable for Atomic Parsley that can read the pyTivo metadata file and put the metadata into a .mp4 file (?). At least that is what the post says kmttg is doing.

If this is true, it should be easy to do this in a TVAPpostProcess.cmd file. It may be that Atomic Parsley can't directly read the pyTivo file and kmttg is reading it and feeding the data into AP. Requires some investigation -- but seems interesting!


----------



## dlfl

dlfl said:


> ........Looks to me like there is a windows executable for Atomic Parsley that can read the pyTivo metadata file and put the metadata into a .mp4 file (?). At least that is what the post says kmttg is doing.
> 
> If this is true, it should be easy to do this in a TVAPpostProcess.cmd file. It may be that Atomic Parsley can't directly read the pyTivo file and kmttg is reading it and feeding the data into AP. Requires some investigation -- but seems interesting!


Downloaded the windows version of AP and did some quick experiments. This looks quite doable. I used AP to add a Description tag to a 600MB .mp4 movie file that I encoded with HandBrake. It has to increase file size to hold the tag so it has to write a temp file. Took about 30 seconds with all file operations on a USB hard drive. The Description tag showed up in QuickTime Player.

AP will not read the pyTivo metadata file directly so that will have to be handled. My current thought is to write a little command line program that reads the pyTivo file and runs AP with the correct arguments. Then this program would be called from the TVAPpostProcess.cmd file.

A question is: which meta tags are to be set by this process?

AP says it can set all these iTunes style tags:
--artist (string) Set the artist tag
--title (string) Set the title tag
--album (string) Set the album tag
--genre (string) Genre tag (see --longhelp for more info)
--tracknum (num)[/tot] Track number (or track number/total tracks)
--disk (num)[/tot] Disk number (or disk number/total disks)
--comment (string) Set the comment tag
--year (num|UTC) Year tag (see --longhelp for "Release Date")
--lyrics (string) Set lyrics (not subject to 256 byte limit)
--composer (string) Set the composer tag
--copyright (string) Set the copyright tag
--grouping (string) Set the grouping tag
--artwork (/path) Set a piece of artwork (jpeg or png only)
--bpm (number) Set the tempo/bpm
--albumArtist (string) Set the album artist tag
--compilation (boolean) Set the compilation flag (true or false)
--advisory (string*) Content advisory (*values: 'clean', 'explicit')
--stik (string*) Sets the iTunes "stik" atom (see --longhelp)
--description (string) Set the description tag
--TVNetwork (string) Set the TV Network name
--TVShowName (string) Set the TV Show name
--TVEpisode (string) Set the TV episode/production code
--TVSeasonNum (number) Set the TV Season number
--TVEpisodeNum (number) Set the TV Episode number
--podcastFlag (boolean) Set the podcast flag (true or false)
--category  (string) Sets the podcast category
--keyword (string) Sets the podcast keyword
--podcastURL (URL) Set the podcast feed URL
--podcastGUID (URL) Set the episode's URL tag
--purchaseDate (UTC) Set time of purchase
--encodingTool (string) Set the name of the encoder
--gapless (boolean) Set the gapless playback flag

A few of these have obvious one-to-one relationships to the pyTivo metaData and many of them have no pyTivo counterpart.

What are the desired tags, ranked in order of importance? If any desired tags are not available in the pyTivo metaData (e.g., grouping) they would have to handled as optional command line options for my program.


----------



## Icarus

I think you might be able to figure out some of them from this.

This one is the program info (itunes) from a file I downloaded from tivo, processed and converted with ttg+ to h.264










Contrast that to this episode of Fringe which I downloaded from itunes:










It would be nice to do the proper tivo episode id to season#, episode# translation. For 523, that translates to season 5, episode 23.

If there's a better program I can use to display all the metadata, I'll be happy to download it and run it and post the output. I haven't looked for one yet.

I'm not sure what the metadata looks like for downloaded movies.

I think these are all ID3 tags. There must be a spec somewhere.

-David


----------



## Icarus

I found an old movie I downloaded in 2008. tivo and ttg+ incorrectly categorize it as a tv show, and it shows up under tv shows in itunes. On the video pane, Episode is 1.

I think movies should just have name, artist, year, genre and description, but you will get whatever tivo put in its own metadata of course.

-David


----------



## Icarus

hey, you know I have 2 mpg files and their metadata files still. I will download atomic parsley and play with them and see what I come up with.

the mpg files are the qsf output from when I was doing it the other way. I haven't gotten around to converting them yet, so I will run handbrake on them now and then play with this thing.

-David


----------



## Icarus

Found a gui for atomic parsley here: http://www.textzombie.com/videotag/

ah well, never mind. videotag didn't work at all for me. for me it crashes when running its own bundled copy of AtomicParsley.exe (named VTAtomicParsley.exe in videotag's install dir.)

Update: Phil, the guy who wrote this got back to me and we debugged it. I either had a corrupt download or his bundled version of Atomic Parsley is corrupt. Either way, if you replace the file named VTAtomicParsley.exe with the current 0.9 version of AtomicParsley.exe (properly renamed to VTAtomicParsley.exe in the install dir for videotag) this tool works, and it's a very nice tool.

AtomicParsley.exe <filename> -t
dumps all the tags in <filename>
Run it in a command prompt. Easier if you copy AtomicParsley.exe to where the video file is.

Atomic Parsley:

http://sourceforge.net/project/showfiles.php?group_id=153768&package_id=170610&release_id=447801

-David


----------



## Icarus

I found another front end for it called iPodTvShow. It's a gui front end to atomic parsley. It doesn't let you set much, just enough to make itunes/ipod think it's a tv show. It doesn't even support filling in the description.

Looks like a lot of people needed a fix like this for "Lost" for some reason. If you have a mac, there's a gui called "lostify" that does it also. hahaha.

This is the bat file it creates to run Atomic Parsley after I set all the fields manually in the GUI:

AtomicParsley.exe "C:\Users\dmk\video\qsf\CSI NY - ''Pay Up''.mp4" --genre "TV Shows" --stik "TV Show" --TVNetwork "CBS" --TVShowName "CSI NY" --TVEpisode "525" --TVEpisodeNum 25 --TVSeason 5 --title "Pay Up"

hmmm, that stik thing is being set also?

Anyway, when I added it to itunes, it properly categorized it as a episode of the tv seriers, CSI NY.

itunes will also let you change all these fields, but it won't recategorize the show after you change the tags.

-David


----------



## Yoav

For an atomicparsley front-end, I've been fairly happy with MetaX on the mac, and it looks like there's a windows port:

http://www.danhinsley.com/MetaX.htm

This is a double-bonus since the metaX coder is updating atomicparsley (it has been abandoned by the original coder)


----------



## dlfl

dlfl said:


> ....... My current thought is to write a little command line program that reads the pyTivo file and runs AP with the correct arguments. Then this program would be called from the TVAPpostProcess.cmd file.
> 
> A question is: which meta tags are to be set by this process?
> .......


Problem solved the easy way: kmttg already does this and the code is visible in the Google Code pages. My program, initially at least, will just mimic the functionality already in kmttg (in C# rather than Java).

Hope to have this ready before Sat. morning, when I go out of town for a week and won't be able to reach my development machine.

I have my doubts about the reliability of an algorithm for getting season number from the TiVo episode number. I just checked an episode of House that has a TiVo episode number of 6815. The current kmttg algorithm would yield Season #68, Episode #15 (if I'm reading the Java code correctly). The epiisode number is correct but the season number can't be.


----------



## Icarus

I would just go with their algorithm for episode number. That's easy to override in itunes.

Thanks again,
-David


----------



## dlfl

dlfl said:


> ......... My current thought is to write a little command line program that reads the pyTivo file and runs AP with the correct arguments. Then this program would be called from the TVAPpostProcess.cmd file.
> .......


pyTiVoParsley is a command line program. It reads a pyTiVo metadata file and inserts metadata tags in a .mp4 or .m4v file using Atomic Parsley.

I've put a zip file (pyTiVoParsley.zip) on the TVAP download site (given in first post of this thread). The zip includes a readme file that should tell you all you need to know.

Let me know how it goes. Although intended for TVAP post-process scripts, to be used after transcoding to MPEG4, it obviously could be used to insert metaData in previously encoded videos too.


----------



## Icarus

seems to work for me. and no directory names needed if all files are in the same dir.

before (I must have used on of the other programs to set the metadata):

C:\Users\dmk\video\qsf>AtomicParsley.exe "CSI NY - ''Grounds for Deception''.mp4
" -t
Atom "ctoo" contains: HandBrake 0.9.3 2008112300
Atom "cgen" contains: TV Shows
Atom "stik" contains: TV Show
Atom "tvnn" contains: CBS
Atom "tvsh" contains: CSI NY
Atom "tven" contains: S5E24
Atom "tves" contains: 24
Atom "tvsn" contains: 5
Atom "cnam" contains: Grounds For Deception

After:

C:\Users\dmk\video\qsf>AtomicParsley.exe csiny-gfd.mp4 -t
Atom "ctoo" contains: HandBrake 0.9.3 2008112300
Atom "cgen" contains: TV Shows
Atom "stik" contains: TV Show
Atom "tvnn" contains: KGMBDT
Atom "tvsh" contains: CSI: NY
Atom "tven" contains: Grounds for Deception
Atom "tves" contains: 524
Atom "tvsn" contains: 5
Atom "cnam" contains: CSI: NY
Atom "cgrp" contains: Action Adventure
Atom "cday" contains: 2009-05-13T00:00:00Z
Atom "desc" contains: When Stella learns that New Yorkers are being murdered ove
r ancient Greek artifacts, she and Mac head to Greece and uncover a mystery.

I think cnam is being set wrong. cnam should be the episode name maybe?

-David


----------



## Icarus

I can't even figure out how to set cnam with AtomicParsley. --longhelp doesn't mention it.

FWIW, kmttg does the same thing.

-David


----------



## dlfl

20 June 2009 Ver. 0.75
- Added Transport Stream (TS, *.ts) output type selection.
- ComSkip Ad Detection can be used for either MPEG2 or TS output types.
- TVAPPostProcessBatch file can be used with MPEG2, DVR-MS or TS output types.
- Fix: Tab order for Use-ComSkip check box

ComSkip is also supposed to handle DVR-MS files but in my limited testing it has locked up -- so I have not enabled the ComSkip option for that file type.

I have verified that HandBrake handles TS inputs just fine, for anyone wishing to use TS output file type and also transcode to .mp4 in a TVAPpostProcess script.


----------



## Burger23

I am having trouble getting TVAP to work with Windows 7 RC1- all I want to do is to download a .tivo file, convert it to .dvr-ms and send the converted file to my Win7 Media Center. I have set up all 3 programs, TiVo Desktop, Video Re-Do, and TVAP to run in Vista SP2 compatibilty mode and Run as Administrator. I have gotten this to work in the past, so I know it can be done. But I have chnaged verions of all programs and I may have an odd version combination between the 3 programs. I am using TiVoDesktop ver. 2.7 , Video-Redo ver 2.5.7.602, and TVAP ver.72

TVAP either does nothing but start processing- or, when selecting RESET, and unchecking Block Processing, it starts- but immediately says it is completed.

Can anyone verify version numbers that work with Windows 7?


----------



## dlfl

Burger23 said:


> I am having trouble getting TVAP to work with Windows 7 RC1


TVAP runs VRD via VBScripts. I think the most likely problem is asscociated with these VBScripts running properly on Windows 7. Here are links to some posts/threads on the VideoReDo forum that may be of help:

http://www.videoredo.net/msgBoard/showpost.php?p=50455&postcount=4

http://www.videoredo.net/msgBoard/showthread.php?t=11282

I'm still running XP. TVAP runs OK on Vista and on 64bit Vista, but I won't be in a position to test it on 7 any time soon.


----------



## Burger23

dlfl said:


> TVAP runs VRD via VBScripts. I think the most likely problem is asscociated with these VBScripts running properly on Windows 7. Here are links to some posts/threads on the VideoReDo forum that may be of help:
> 
> http://www.videoredo.net/msgBoard/showpost.php?p=50455&postcount=4
> 
> http://www.videoredo.net/msgBoard/showthread.php?t=11282
> 
> I'm still running XP. TVAP runs OK on Vista and on 64bit Vista, but I won't be in a position to test it on 7 any time soon.


Thanks for your prompt reply. I tried cleaning the registry keys as recommended in one of the links above. I am now attempting this on 2 different Windows 7 machines- one 32-bit, one 64-bit. Same issue on both machines.



> 6/29/2009 9:09:20 PM Started QSF, input: 30-Minute Meals - ''Ding Dong Dinner'' (Recorded Jun 29, 2009, FOODHD)
> 6/29/2009 9:09:22 PM VideoReDo completed QSF, creating: \\Mediacenter7esc\e\recorded tv\30-Minute Meals - ''Ding Dong Dinner'' (Recorded Jun 29, 2009, FOODHD)_QSF.dvr-ms


I have also tried changing the output directory to a local, as opposed to network, drive. Same issue- It instantly reports the file as being converted- and there is obviously no hint of it in the output directory.

As I mentioned above, I have gotten this to work before. In fact, as late as June 25, 2009 I show a sucessfull tivo to dvr-ms converted file in my MediaCenter. This is very odd.

Any ideas about the "instant completion" mentioned above?


----------



## Burger23

OK - this is a bit embarrasing- but I knew it had to be a human error.

When I did my clean install of Windows 7, I did not re enter my registration key into Video ReDo. With that entered, everything works fine now...duh.


----------



## dlfl

See this post.

If you're interested in the mentioned TVAP mod, post.


----------



## dlfl

22 September 2009
- Fixed: Sequencing errors when using ComSkip ad detection with autocuts -- Sometimes failed to do postProcess script -- Sometimes did it twice.
- Note: Still installing version 80-023 of ComSkip. The changes in 024 and 025 do not appear to have any relevance to TVAP usage. However feel free to substitute whatever ComSkip executable and ini file you prefer to use.


----------



## Burger23

When running program under Windows 7 32-bit, I get the following error message: _windowsapplication1 has stopped working_- and TVAP crashes. I tried uninstalling and then reinstalling. Still have same issue. Not sure what to try now??


----------



## dlfl

Burger23 said:


> When running program under Windows 7 32-bit, I get the following error message: _windowsapplication1 has stopped working_- and TVAP crashes. I tried uninstalling and then reinstalling. Still have same issue. Not sure what to try now??


Is this happening immediately on starting TVAP, or when it tries to run a VRD process?

You posted on 6/30/09 about problems that were fixed by registering VideoReDo. I assume this can't be the same problem.

Has TVAP never run OK on the system in question, or did it just start doing this? If it was OK before, what has changed?

Do you have TiVo Desktop installed? If not, can you install it and enter your MAK, then try TVAP again?

If the crash comes when TVAP tries to run a VRD process, please search the VRD forums for anything new regarding running VRD on Windows 7 (beyond what I linked in this thread circa 6/30/09).


----------



## Burger23

dlfl said:


> Is this happening immediately on starting TVAP, or when it tries to run a VRD process?


 It happens immediately on starting TVAP



> You posted on 6/30/09 about problems that were fixed by registering VideoReDo. I assume this can't be the same problem.


 It is unrelated I believe



> Has TVAP never run OK on the system in question, or did it just start doing this? If it was OK before, what has changed?


 TVAP has been running great- it just started.



> Do you have TiVo Desktop installed? If not, can you install it and enter your MAK, then try TVAP again?


 TiVo Desktop is installed.

Since I assume that you have not seen this error before, it must be caused by something that I did. I use Windows Home Server to backup daily so I will just go back a couple weeks ago and restore when I know TVAP was loaded correctly.

Thanks for your response...


----------



## dlfl

*Burger23*,

Try emptying your TiVo transfer directory then running TVAP. Does it run?

Also, does VideoReDo run on this machine?


----------



## Burger23

dlfl said:


> *Burger23*,
> 
> Try emptying your TiVo transfer directory then running TVAP. Does it run?


That fixed it 
I run TVAP in my laptop. My TiVO transfer directory is on an external hard drive that plugs into the laptop. I just returned from a trip whre I took my laptop with me. I forgot to plug the external hard drive back in - that fixed in.

I sure enjoy, and use your program daily. Thanks so very much for effort.


----------



## dlfl

Burger23 said:


> That fixed it
> ..........I sure enjoy, and use your program daily. Thanks so very much for effort.


:up: Great! Now that I'm on TWC digital cable where most channels are copy protected, I guess others are using TVAP more than I do!


----------



## Burger23

dlfl said:


> Now that I'm on TWC digital cable where most channels are copy protected, I guess others are using TVAP more than I do!


 I am on Comcast- and I use TVAP exclusively on TiVO recorded extended cable channels like USA, TNT, BRAVO, etc- but no premium movie channels (HBO, etc). All clear QAM chnnals are recorded on my Windows Media Center. So I use TiVo primarily as back up during the regular TV season (with exceptions of Mad Men and Monk)- but heavily during the summer when Damages, Closer, and other favorite shows are available only on cable. It is my understanding that these channels will continue to have no copy protection as long as you pay for the package.


----------



## janry

Thanks for this great utility, dlfl.

I have kttmg, TVAP & VideoReDo all running on a netbook with a 1.5TB external drive to automatically convert all my TiVo HD recordings so they can play on a WD TV Live. I plan to get a 2nd WD TV Live so we can watch our recordings on any of our 3 TVs.


----------



## dlfl

janry said:


> Thanks for this great utility, dlfl.
> 
> I have kttmg, TVAP & VideoReDo all running on a netbook with a 1.5TB external drive to automatically convert all my TiVo HD recordings so they can play on a WD TV Live. I plan to get a 2nd WD TV Live so we can watch our recordings on any of our 3 TVs.


Interesting! How do you divide your work flow between TVAP and kmttg? It's been looking like kmttg does everything TVAP does, plus more.


----------



## janry

dlfl said:


> Interesting! How do you divide your work flow between TVAP and kmttg? It's been looking like kmttg does everything TVAP does, plus more.


I use kmttg just to transfer the recordings from the TiVo. I found if I converted the files with kittmg, I had no audio on the WD TV Live unless I process with comcut, which I didn't want to do since it is not perfect. For whatever reason, when I auto-process the TiVo recordings throgh VRD, I get the audio on WD TV Live.


----------



## moyekj

janry said:


> I use kmttg just to transfer the recordings from the TiVo. I found if I converted the files with kittmg, I had no audio on the WD TV Live unless I process with comcut, which I didn't want to do since it is not perfect. For whatever reason, when I auto-process the TiVo recordings throgh VRD, I get the audio on WD TV Live.


 If you run through VRD QS Fix task in kmttg I don't see any reason why it would not work.


----------



## dlfl

IIRC *janry* has an issue with audio that switches between stereo and 5.1 in his files and this confuses the WD device so it plays no audio at all. You can make the VRD output audio be converted to stereo-only with an option setting, which will at least let the WD device play it, although giving up 5.1. I'm guessing he is doing this and for whatever reason finds it easier to do using TVAP than kmttg. The VRD output audio option has to be set manually in the VRD GUI -- TVAP can't set it. Some VRD options (e.g., Ad Detective tuning parameters) can be set in the GUI and then they "stick" and are used in the COM processes. I don't know if this audio option is like this, although I would not expect it to be. If it is "sticky" I would think it would stick for kmttg VRD operations as well. I'm really guessing here!


----------



## moyekj

dlfl said:


> IIRC *janry* has an issue with audio that switches between stereo and 5.1 in his files and this confuses the WD device so it plays no audio at all. You can make the VRD output audio be converted to stereo-only with an option setting, which will at least let the WD device play it, although giving up 5.1. I'm guessing he is doing this and for whatever reason finds it easier to do using TVAP than kmttg. The VRD output audio option has to be set manually in the VRD GUI -- TVAP can't set it. Some VRD options (e.g., Ad Detective tuning parameters) can be set in the GUI and then they "stick" and are used in the COM processes. I don't know if this audio option is like this, although I would not expect it to be. If it is "sticky" I would think it would stick for kmttg VRD operations as well. I'm really guessing here!


Oh OK, thanks for the explanation. Certain settings like audio boost don't seem to stick unfortunately. What's worse is if I adjust the audio to a level I want and then save the project to .Vprj and then run COM job to cut the audio boost is ignored, so if you want audio boost via VRD you have to use the GUI mode. I think you mentioned this is going to improve in future versions of VRD so look forwards to that.


----------



## janry

dlfl said:


> IIRC *janry* has an issue with audio that switches between stereo and 5.1 in his files and this confuses the WD device so it plays no audio at all. You can make the VRD output audio be converted to stereo-only with an option setting, which will at least let the WD device play it, although giving up 5.1. I'm guessing he is doing this and for whatever reason finds it easier to do using TVAP than kmttg. The VRD output audio option has to be set manually in the VRD GUI -- TVAP can't set it. Some VRD options (e.g., Ad Detective tuning parameters) can be set in the GUI and then they "stick" and are used in the COM processes. I don't know if this audio option is like this, although I would not expect it to be. If it is "sticky" I would think it would stick for kmttg VRD operations as well. I'm really guessing here!


No, I'm not switching to stereo only. For whatever reason, ktmmg converted files confuse the WD but VRD converted files do not. My converted VRD files play back fine in 5.1 on the WD TV Live.


----------



## dlfl

janry said:


> No, I'm not switching to stereo only. For whatever reason, ktmmg converted files confuse the WD but VRD converted files do not. My converted VRD files play back fine in 5.1 on the WD TV Live.


Hmmm.... Sounds like it's a difference between TiVoDecode and VRD in the TiVo-->Mpeg2 stripping process. (?).


----------



## Burger23

I am getting an error message after the QSF processing: Ad-Scan cancelled- Input file not found. Screenshot attached.










Ideas?

Thanks so much


----------



## dlfl

Burger23 said:


> I am getting an error message after the QSF processing: Ad-Scan cancelled- Input file not found. Screenshot attached.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Ideas?
> 
> Thanks so much


A quick initial thought: I see you're using comskip for ad detection and outputting dvr-ms files. Have you successfully been using comskip with this file type prior to this? I tried comskip a couple of times on dvr-ms files and it crashed, although I may have configured it wrong.

Also can you check to see if the QSF output file it says is missing is actually there, and the name matches what TVAP is looking for?


----------



## Burger23

Thanks for your prompt reply-

First, I included in the screenshot a Windows Explorer IE of the location: S:\QSF- the Closer ..._QST.dvr-ms file is indeed there.

Second, I have used Comskip to successfully edit dvr-ms files while using DVRMSToolbox on .wtv converted files. The error seems to be that VRD can not find the file in S:\QSF- wonder if it needs any specials permissions?

I tried it with the Comskip box UNCHECKED- but I got the same error


----------



## Burger23

I should add that I can manually convert .tivo, cut ads, and Save As a dvr-ms just fine. It is only when using the TivoVideoReDo software that I have this issue.


----------



## dlfl

If your QSF destination drive is a USB drive or a network drive, can you try again with it set to a drive partition on an internal hard drive? Also try setting the output type to mpeg2. Keep the adscan set to VideoReDo Ad Detective for now. Let me know if either change makes a difference.


----------



## Burger23

Your guess that Drive S was a USB drive was correct. I changed drive to drive E, a partitioned internal drive. I then started the process again, once with Comskip UNCHECKED- and once with Comskip checked ON. Unforntuately I got the same error.

I then tried another show- same error.


----------



## dlfl

Burger23 said:


> Your guess that Drive S was a USB drive was correct. I changed drive to drive E, a partitioned internal drive. I then started the process again, once with Comskip UNCHECKED- and once with Comskip checked ON. Unforntuately I got the same error.
> 
> I then tried another show- same error.


Have you tried it with output type set to Mpeg2 ?


----------



## Burger23

Sorry I forgot to try saving show as a mpg. I did that this morning and that indeed DID WORK CORRECTLY. But, of course, a mpg file is not visible in Windows Media Center. I believe I mentioned earlier that the process completes successfully if done manually in VRD.

Thanks for your assistance in troubleshooting


----------



## dlfl

Burger23 said:


> Sorry I forgot to try saving show as a mpg. I did that this morning and that indeed DID WORK CORRECTLY. But, of course, a mpg file is not visible in Windows Media Center. I believe I mentioned earlier that the process completes successfully if done manually in VRD.
> 
> Thanks for your assistance in troubleshooting


I understand you need dvr-ms output -- this was just a diagnostic exercise, and it tells me there probably is a bug in TVAP. I will look into it.


----------



## dlfl

Burger23 said:


> Sorry I forgot to try saving show as a mpg. I did that this morning and that indeed DID WORK CORRECTLY. But, of course, a mpg file is not visible in Windows Media Center. I believe I mentioned earlier that the process completes successfully if done manually in VRD.
> 
> Thanks for your assistance in troubleshooting


Could you try your process with a short input video, please (e.g., 1 min., just edit a larger TiVo to a short one)? Keep VRD as the AdScan agent for now. I just did this and had no problems, so I'm wondering if your problem is somehow related to the file size (video length).

Edit: I've now processed a 2 GB file successfully.


----------



## meowth

dlfl said:


> See this post.
> 
> If you're interested in the mentioned TVAP mod, post.


I routinely have tivo files that need the qsf with the filters for videoredo to process the files. I had tried using TVAP about a year ago hoping to automate the editing process for my media server but couldn't get it to work using the standard qsf. I just recently found a link to this thread talking about mods to the qsf script allowing it to do the filters. However, I can't figure out what needs to be changed and where in the script as I know nothing about scripting.

I know that I have about 5 different cable networks that I routinely need to do the filters with. Can the filters be set to select what resolution to use based on the channel name listed in the file name? (ex: FOODHD, DSCHD, SCIHD, HSTRYHD) I don't know what the syntax would need to be for the different resolutions. The main resolutions used for the various channels I have to use the filters on are 704x480, 1280x720, 1920x1080.


----------



## dlfl

meowth said:


> I routinely have tivo files that need the qsf with the filters for videoredo to process the files. I had tried using TVAP about a year ago hoping to automate the editing process for my media server but couldn't get it to work using the standard qsf. I just recently found a link to this thread talking about mods to the qsf script allowing it to do the filters. However, I can't figure out what needs to be changed and where in the script as I know nothing about scripting.
> 
> I know that I have about 5 different cable networks that I routinely need to do the filters with. Can the filters be set to select what resolution to use based on the channel name listed in the file name? (ex: FOODHD, DSCHD, SCIHD, HSTRYHD) I don't know what the syntax would need to be for the different resolutions. The main resolutions used for the various channels I have to use the filters on are 704x480, 1280x720, 1920x1080.


No problem.

--Make a copy of QSF.vbs in your TVAP install directory and save it in case.
--Edit QSF.vbs by right clicking and selecting "Edit". Or load it in any text editor of your choice.
-- Find these two lines:


Code:


percentComplete = 0.0
if NOT VideoReDo.FileSaveAsEx (Args(1), Args(2)) = 0 then

-- Insert these lines between the above two lines:


Code:


if instr(Args(0), "the foobar show") > 0 then
   VideoReDo.SetFilterDimensions 704, 480
elseif instr(Args(0), "foobar with the stars") > 0 then
   VideoReDo.SetFilterDimensions 352, 480
elseif instr(Args(0), "foobar tonight") > 0 then
   VideoReDo.SetFilterDimensions 704, 480
end if

(You can copy and paste right from this post.)
-- spacing and indentation are not critical, just make it look good to you.
-- Edit the lines you inserted to customize them as follows:
1. Replace the strings in quotes by your channel strings, e.g., "FOODHD", note: this is case sensitive and spaces, if any, DO count between quotes.
2. Substitute your corresponding dimension numbers.
3. If you need more comparisons, just repeat the elseif structure as needed.
Save the file and run TVAP.

If you have trouble post or pm me an exact table of matching strings and corresponding dimensions and I will send you the correct file.


----------



## meowth

dlfl said:


> Code:
> 
> 
> if instr(Args(0), "the foobar show") > 0 then
> VideoReDo.SetFilterDimensions 704, 480
> elseif instr(Args(0), "foobar with the stars") > 0 then
> VideoReDo.SetFilterDimensions 352, 480
> elseif instr(Args(0), "foobar tonight") > 0 then
> VideoReDo.SetFilterDimensions 704, 480
> .[/QUOTE]
> 
> if I read this right I would substitute:
> 1920, 1080
> 1280, 720
> 704, 480
> 
> for the 3 resolutions right?


----------



## dlfl

meowth said:


> if I read this right I would substitute:
> 1920, 1080
> 1280, 720
> 704, 480
> 
> for the 3 resolutions right?


For each *if *or *elseif* clause you have to use the dimensions that correspond to whatever match string (channel name) you put between quotes in that clause. You don't give enough information in your posts for me to do this for you. (You mention 5 cable networks, give 4 channel-name examples, then only mention 3 resolution pairs. No way for me to deduce how they match up.)


----------



## meowth

dlfl said:


> For each *if *or *elseif* clause you have to use the dimensions that correspond to whatever match string (channel name) you put between quotes in that clause. You don't give enough information in your posts for me to do this for you. (You mention 5 cable networks, give 4 channel-name examples, then only mention 3 resolution pairs. No way for me to deduce how they match up.)


Sorry. That's what I get for posting tired. This is what I put in the qsf script for the channels I routinely find needing qsf. When I ran TDAP after that it now says it completed creating the qsf file then tries to run adscan but fails with file not found errors. It is not actually creating any qsf files as they normally take several minutes to create when run manually but says they complete through TVAP within 2 seconds. I don't know what I'm doing wrong.

percentComplete = 0.0
if instr(Args(0), "FOODHD") > 0 then
VideoReDo.SetFilterDimensions 1920, 1080
elseif instr(Args(0), "DSCHD") > 0 then
VideoReDo.SetFilterDimensions 1920, 1080
elseif instr(Args(0), "SPIKEP") > 0 then
VideoReDo.SetFilterDimensions 528, 480
if instr(Args(0), "SCIHD") > 0 then
VideoReDo.SetFilterDimensions 1920, 1080
elseif instr(Args(0), "HSTRYHD") > 0 then
VideoReDo.SetFilterDimensions 1280, 720
elseif instr(Args(0), "GOLFHD") > 0 then
VideoReDo.SetFilterDimensions 1920, 1080
if instr(Args(0), "TRUTVP") > 0 then
VideoReDo.SetFilterDimensions 704, 480
elseif instr(Args(0), "HGTVD") > 0 then
VideoReDo.SetFilterDimensions 1920, 1080
end if
if NOT VideoReDo.FileSaveAsEx (Args(1), Args(2)) = 0 then


----------



## dlfl

meowth said:


> Sorry. That's what I get for posting tired. This is what I put in the qsf script for the channels I routinely find needing qsf. When I ran TDAP after that it now says it completed creating the qsf file then tries to run adscan but fails with file not found errors. It is not actually creating any qsf files as they normally take several minutes to create when run manually but says they complete through TVAP within 2 seconds. I don't know what I'm doing wrong.
> 
> percentComplete = 0.0
> if instr(Args(0), "FOODHD") > 0 then
> VideoReDo.SetFilterDimensions 1920, 1080
> elseif instr(Args(0), "DSCHD") > 0 then
> VideoReDo.SetFilterDimensions 1920, 1080
> elseif instr(Args(0), "SPIKEP") > 0 then
> VideoReDo.SetFilterDimensions 528, 480
> if instr(Args(0), "SCIHD") > 0 then
> VideoReDo.SetFilterDimensions 1920, 1080
> elseif instr(Args(0), "HSTRYHD") > 0 then
> VideoReDo.SetFilterDimensions 1280, 720
> elseif instr(Args(0), "GOLFHD") > 0 then
> VideoReDo.SetFilterDimensions 1920, 1080
> if instr(Args(0), "TRUTVP") > 0 then
> VideoReDo.SetFilterDimensions 704, 480
> elseif instr(Args(0), "HGTVD") > 0 then
> VideoReDo.SetFilterDimensions 1920, 1080
> end if
> if NOT VideoReDo.FileSaveAsEx (Args(1), Args(2)) = 0 then


I see some syntax errors where "if" was used where "elseif" should be. Here is a corrected version:


Code:


if instr(Args(0), "FOODHD") > 0 then
    VideoReDo.SetFilterDimensions 1920, 1080
elseif instr(Args(0), "DSCHD") > 0 then
    VideoReDo.SetFilterDimensions 1920, 1080
elseif instr(Args(0), "SPIKEP") > 0 then
    VideoReDo.SetFilterDimensions 528, 480
elseif instr(Args(0), "SCIHD") > 0 then
    VideoReDo.SetFilterDimensions 1920, 1080
elseif instr(Args(0), "HSTRYHD") > 0 then
    VideoReDo.SetFilterDimensions 1280, 720
elseif instr(Args(0), "GOLFHD") > 0 then
    VideoReDo.SetFilterDimensions 1920, 1080
elseif instr(Args(0), "TRUTVP") > 0 then
    VideoReDo.SetFilterDimensions 704, 480
elseif instr(Args(0), "HGTVD") > 0 then
    VideoReDo.SetFilterDimensions 1920, 1080
end if

Is SPIKEP really supposed to be 528x480 ? (It's possible, just seems odd.)


----------



## meowth

dlfl said:


> I see some syntax errors where "if" was used where "elseif" should be.
> 
> Is SPIKEP really supposed to be 528x480 ? (It's possible, just seems odd.)


Thanks. That fixed it. Seems to be working well now. And yes that is the resolution of the tivo files that were recorded off spike network. I took the dimensions from each tivo file according to what was listed in videoredo's filter box on the quickstream fix. Some of the files would have 2 resolutions to choose from but the ones from spike only had the one choice.

Anyway thanks again. This is an awesome little program that is going to make things so much easier. Be really nice to get up in the morning to find the videos already ad scanned and ready for manual cutting.


----------



## dlfl

TVAP is ready to capitalize on the new TV Suite 4 !

TV Suite Ver. 4 and output profiles:

TVAP at startup will automatically determine from the registry if you have TVS4 installed.
If you don't have TVS4, the TVAP GUI features associated with TVS4 profiles will be disabled
but the program will run as before with earlier versions of VRD.

As always, if you have multiple versions of VRD installed, TVAP will run the COM functions
from the last version you ran in GUI mode. Thus if you want to use TVS4 features
(i.e., output profiles), be sure TVS4 was the one last run in GUI mode.

To use an output profile:
a. select "Profile" in the OutputType pull-down box.
b. Enter the profile name and the desired output file extension in the appropriate boxes
to the right.
The profile name MUST MATCH EXACTLY (including spaces and capitalization) the name of a
valid profile name (either built-in or created by you in the GUI version). Choose a file
extension appropriate for your profile. This extension will be used for the output file
whether it makes sense or not. (You can change it later in Windows Explorer if you goof.)

Hint: Profile definitions are maintained by TVS4 in file "outputProfiles.xml", which is
located in "C:\Documents and Settings\Administrator\My Documents\VideoReDo" on my XP machine.
A sure-fire way to get correct exact profile names is to bring this file up in a text
editor (usually right-click, select "edit" will do it) and select and copy the name from
the <name> element of the desired profile. (BE CAREFUL NOT to MODIFY this file!)

Eventually profile and extension setting will more automated, but this is pending VideoReDo
creating a new COM function to support that (and pending my writing the code to use it).

Note that if you use a two-step process (QSF then AdScan/Comskip) the intermediate file (QSF'ed one)
will always be a mpeg2 (.mpg) when you are in profile output mode. Also, if you just want to get
a transcoded output file, configure QSF only, with an appropriate profile.

If you have problems, revert to Version 0.76 and let me know the details.

Here's the **download link** for your convenience.


----------



## tannebil

I'm using 0.80 on Win7 HP 64-bit and VRD 4.20.2.594 to transcode into H.264.

How does TVAP decide that a Tivo transfer is complete? I'm having an unreleated problem with TTG where transfers interrupt every five minutes and resume 5 minutes later. TVAP started processing the Tivo file after first interruption even though TTG did not show the transfer as complete. Ignoring the interruption problem, is this going to be an issue whenever a transfer doesn't complete in a single session, e.g. the TIVO reboots, there's a network connection problem, the PC reboots, etc...?


----------



## dlfl

tannebil said:


> I'm using 0.80 on Win7 HP 64-bit and VRD 4.20.2.594 to transcode into H.264.
> 
> How does TVAP decide that a Tivo transfer is complete? I'm having an unreleated problem with TTG where transfers interrupt every five minutes and resume 5 minutes later. TVAP started processing the Tivo file after first interruption even though TTG did not show the transfer as complete. Ignoring the interruption problem, is this going to be an issue whenever a transfer doesn't complete in a single session, e.g. the TIVO reboots, there's a network connection problem, the PC reboots, etc...?


Yes this is probably going to be a problem. TVAP monitors the file size and when it sees it hasn't increased for a certain time period (much less than 5 minutes) it assumes the transfer is done. I don't know any other way to determine when a transfer is completed.

You could try **TiVoPlaylist** instead of TiVo Desktop for the transfers. Presumably one way or another you will get past this TTG problem, which certainly isn't normal behavior. Then TVAP will work correctly.

I might be able to mod TVAP so it waits 10 minutes to decide a transfer is complete but I doubt that would be desirable for most users, and I think the real solution is to fix your TTG problems. Are you already getting help on that in another thread?

Edit: I see you have another thread on the TTG problem and have tried TiVoPlaylist.


----------



## dlfl

For TVS4 users, there is now an Output Profile pull-down selector that selects from the existing profiles. The profile selection also fills in a default output file extension (e.g. .mp4) appropriate for the selected profile, but you can edit the extension (e.g., if you need .m4v instead of .mp4).

TVAP reads the the profile information using new com functions just provided by VRD in TVS4 build 595 (Thanks to *Dan203* and the other VRD developers). Thus you need to upgrade to that build before using TVAP 0.81. Operation with VRD Plus and VRD TVSuite 3 should be fine -- the profile functionality will be disabled for those VRD programs.

In view of the rapid changes with little testing, I've left two previous versions of TVAP on the download site:

0.76 is the pre-TVS4 version. Will not work correctly with TVS4.
0.80 is the first TVS4-compatible version with manually entered profile names


----------



## dlfl

- Improved output file extension fill-ins when selecting output profiles.
- Now writes pyTiVo metadata file in output folder along with all profile-type output video files.


----------



## dlfl

3 February 2010 Ver. 0.83
Fixed -- TVAPpostProcess did not run in some cases using output profiles ("_QSF" file naming issue)
Fixed -- TVAPcleanUp batch passed file name arg sometimes was wrong (another "_QSF" issue)
Added CL arg: "-metabtv" which causes an XML-formatted metadata file for use with Beyond TV
to be generated.
Improved tooltips and Activity message to indicate that QSF's for profile outputs will transcode per
the selected profile.
Improved parsing of call sign meta item from TiVo file name to handle different formatting used
by TiVoPlaylist.


----------



## tinytool

Awesome program, Great job!!!


----------



## dlfl

Minor fixes:

17 February 2010 Ver. 0.84
Fixed -- Profile selection disabled when no video file in transfer folder.
Fixed -- Obscure bug: If TVAP couldn't find TiVo transfer folder in registry and user shut down before setting it manually, would be unable to restart TVAP.


----------



## dlfl

19 Feb 2010 Ver. 0.85

Major Change -- Program no longer writes files to runtime folder (in program files) but to %ALLUSERSPROFILE%\TVAP. (To see what this is on your pc, open a command window and type "echo %ALLUSERSPROFILE%\TVAP". It varies depending on what version of Windows you have.) Files affected are TivoFileManager.xml, TiVoVRDAutoProcessLog.txt, stopper.txt, and arglog.txt.
If upgrading to this version and you want to retain the file status database from a previous version of TVAP you need to copy the TiVoFileManager.xml file to the new data directory. Recommended procedure: (1) Start TVAP and get the message about needing to set folders etc., then (2) shut it down. This will create the data folder. Then (3) delete the new xml file just created in the data folder and copy the previous xml file (from the TVAP install folder in Program Files) to that folder and (4) restart TVAP. This change was made to allow TVAP to run in Vista and Win 7 without requiring "run as administrator" elevation (e.g., the UAC prompt).

Changed -- Until now TVAP would disable DVR-MS output if not running as administrator. Testing on Windows 7 and XP indicates this is no longer necessary. Thus DVR-MS output is now always enabled. This has not been tested on Vista so could be a problem. If so, a workaround is to set program and/or shortcut properties to force running as administrator.

Changed - ComSkip commercial detection is now enabled for DVR-MS files. It still doesnt work for me but it clearly is intended to work with DVR-MS files, so I leave it up to the user to try it out. 

Another minor change: TVAP-ReadMe is now a PDF file.


----------



## dlfl

Sorry for all the changes -- mostly related to Windows 7. I suspect the number of people who fully understand Win7 accounts and permissions is not much greater than the number who fully understand the U.S. Tax Code! I think I've got a good solution now so you don't need UAC elevation, and different logons (user accounts) can use TVAP without interference or other problems.

*Major Change * TVAP data files have been moved to user-logon-specific folders defined by %APPDATA%\TVAP.

(Type echo %APPDATA%\TVAP at a command prompt to see where this is for your logon.)

The common location (%ALLUSERSPROFILE%\TVAP) was not working out on Windows 7  too many file and folder permissions problems when switching between user logons as well as virtual folders being created all over the place. Now, if you run TVAP with a different logon for the first time, you are starting over. Also, you should NOT try to share the same TVAP folders (AdScan, QSF, etc) for different user logons. Note that both VideoReDo and TivoDesktop follow this same principle. Each different logon will have to be individually configured. Note that in Windows 7 if you use your administrative powers to copy data files (e.g., TiVoFileManager.xml) between data folders for different logons, you need to check the file permissions of the destination file and ensure it has full control for the logon that will use that data folder.

For Windows 7 the data folder (%APPDATA%\TVAP) is:
C:\Users\<User account name>\AppData\Roaming\TVAP. This folder will not exist until TVAP is run the first time on a user logon.

*Changed*  Added code to enable TVAP to determine the VideoReDo installation folder and which VRD program is installed for users who do not have administrator privileges.

*Fixed*  Run VideoReDo button failed with error message for VRD TVSuite 4 Build 596 or later because VRD changed the name of the executable file.

*Fixed * If TVAP is unable to read the Profiles when running TVS4, a descriptive error message is displayed suggesting running VRD once as administrator (rather than just crashing)  this is a COM function issue.


----------



## Burger23

A picture is worth a 100 words! 
9:12:46 Input started
9:12:50 QSF complete

Obviously this is not possible that fast- D:\TEMP QSF\ does not have anything in it










Any ideas?
Thanks


----------



## dlfl

*Burger23*,

First can you provide some details about your setup:

Operating System
Version of VideoReDo (Based on your screen shot it would NOT be TVSuite 4.)
What type of drives are the folders you're using? Obviously the AdScan folder is a network drive.

Has anything recently changed about your setup other than installing TVAP 0.85 ?

Two things stand out from your screen shot:
1. You are transferring a lot of files. This should not be a problem. What is the transfer agent? TiVoDesktop? TiVoPlaylist? Or by chance are you copying these in from another folder?

2. This one is very suspicious: Within a second or two of starting a VRD COM function (such as QSF) there is always a log message giving the version of VRD being invoked -- and this is not in your log display. This strongly suggests a problem of TVAP not being able to access the COM objects. This is a known issue with Windows 7 at least and the usual fix is to run VRD one time with "Run as administrator" set. (In Win7, Right click the VRD shortcut and select "Run as administrator". Not sure about Vista as I never had it. In XP, right click shortcut, select "Run as..." and uncheck the "protect.." checkbox.). If you are actually running TV Suite 4, this COM problem is *definitely* the issue, since that explains why the Profile pull-down selector did not populate.

Try opening the file in question manually in VRD and doing a QSF with the same input and output folders - just to verify there is no problem with the file or your VRD installation.

I strongly recommend installing TVAP 0.86 before further testing.


----------



## Burger23

Thanks for your prompt reply.
OK- I am running Windows 7 64-bit with TiVo Desktop 2.8 with Video-Re-Do Plus. I also tried TVAP on a Windows 7 32-bit machine. And I have tried TVAP versions .76, .85, and .86.

I have tried with several different shows- I have moved shows to different computers. All shows I tried played fine as .tivo with Windows Media Player.

I have been using TVAP for a couple years with great results. This all started with a clean install on my primary computer (Windows 64 bit). As mentioned above, I also switched to my laptop (Windows 7 32-bit) after copying the show to a local laptop directory.

In all cases TVAP reports that QSF processing has completed in less than 1 second.

Any other suggestions for troubleshooting- this is very odd


----------



## Burger23

I forgot to mention that I always open TVAP using Run as Administrator


----------



## dlfl

Have you run *VRD* as administrator at least one time after installing a new version of it? That's a fix for what I think is your problem, which is the VRD COM object VideoReDoSilent is not registered where it should be in the Windows Registry.

My primary development computer now is a Win 7 64 bit and I also have two Win XP Pro computers. However, I'm no longer running VRD Plus on any of them, which could be a complication in debugging this case.

For testing I have a non-admin logon account on my Win 7 machine and I can run TVAP successfully from that account without using Run as admininistrator and no UAC prompts.


----------



## Burger23

That's exactly what the problem was! Thankls you.

Since I never actively use VRD, I never had cause to Run as Administrator.

Now I have anoher issue with commercial editing- At the end of QSF processing, or perhaps at the very begginning of the Comskip processing, I get the error message as shown below. The processing continues for another 30 seconds- then says it is complete- obviously not enough time has gone by. And no file is created in \\SERVER\Movies. Also, do I have my settings correct? I just want TVAP to handle processing of .tivo to .dvr-ms with QSF, then use Comskip to cut out commercials, and finally to place the edited dvr-ms to \\SERVER\Movies.

We're getting there


----------



## dlfl

You're using a really old version of VRD Plus. Why not download the latest version? It looks like it just doesn't want to load the .TiVo file -- the error message is coming from VRD, not TVAP.

Can you load that file manually into VRD and QSF it to DVR-MS ? I mean without running VRD as administrator?

Even Dan203 doesn't remember the details now, but there was a time (probably the version you're using) when you had to have Admin privileges on Vista to process DVR-MS files. I think that would translate to requiring run-as-admin in Win7. You could try running TVAP with run-as-admin but even then I'm not sure it launches the VRD COM functions with run-as-admin in Win7. I don't know if it could be coded to do that but it isn't necessary with any recent version of VRD.


----------



## Burger23

Wow- you were right. I was using a really old version- 2007! It is the version listed on their main web page. I went into betas and dowmloaded a very current version.

A show is procesed fine from tivo to dvr-ms with QSF and placed into D:\TEMP QSF folder. Comskip starts- but it completes in under a minute-this is not possible. Furthermore the log reports that the completed file is written to \\SERVER\Movies- this is not happening- there are no new files in the folder.


----------



## dlfl

I've never used DVR-MS much. However I've been testing tonight with DVR-MS outputs selected and I find that the first two .TiVo files I tested with QSF followed by ComSkip cause ComSkip to hang up. Doing the same thing but using VRD AdScan works OK. I'm using the default comskip.ini file and don't know much about tuning ComSkip -- maybe there's some parameter change that would make it work(?).

I've verified that these ComSkip hangs have nothing to do with TVAP by running ComSkip stand-alone on the same QSF'ed .dvr-ms files. The same hangups occur. On these two files, ComSkip runs a good long while then during one of its processes it gets up to 64% or 93% then just hangs. I have to close the ComSkip command window and no .vprj file is produced. 

Also, if you QSF to .mpg then apply ComSkip these same files do OK. There seems to be something about VRD's DVR-MS output that causes a problem with ComSkip. I'm running TVSuite 4, Build 596.


----------



## Burger23

Thanks for the prompt reply. I also have successfully previously used just Adscan to cut commercials. But I wanted to try out Comskip. And I also occassionally got Comskip to sucesfully complete and successfully place the completed adcut show in the proper directory- but only 1 show. Then Comskip hangs.

I use dvr-ms because my whole HT (music, videos, blu-ray, pictures,TV, etc) is built around Windows Media Center. WMC currently uses the .wtv to format its TV shows- previous versions used dvr-ms externsions. DVRMST is a wonderful program that among other things, uses either ShowAnalyzer or Comskip to automatically edit out commercials. But the commercial removal program can only process dvr-ms files.

I use TiVo because 1)I had it before I got my media center hooked up; and 2)the TiVo has my cablecard which I need for cable shows. The the announced 2nd or 3rd quarter release of cablecard ready tuners by by HD Homerun and Ceton which coincides with my 3-year renewal of TiVo subscription, I will switch to the new HD Homerun box and eliminate the TiVo, and its monthly/annual fees.

But in the meantime I will return to Adscan (not Comskip) now that I know that I am not the only one having issues. Thanks again for you help.


----------



## dlfl

Burger23 said:


> Thanks for the prompt reply. I also have successfully previously used just Adscan to cut commercials. But I wanted to try out Comskip. And I also occassionally got Comskip to sucesfully complete and successfully place the completed adcut show in the proper directory- but only 1 show. Then Comskip hangs.
> 
> I use dvr-ms because my whole HT (music, videos, blu-ray, pictures,TV, etc) is built around Windows Media Center. WMC currently uses the .wtv to format its TV shows- previous versions used dvr-ms externsions. DVRMST is a wonderful program that among other things, uses either ShowAnalyzer or Comskip to automatically edit out commercials. But the commercial removal program can only process dvr-ms files.
> 
> I use TiVo because 1)I had it before I got my media center hooked up; and 2)the TiVo has my cablecard which I need for cable shows. The the announced 2nd or 3rd quarter release of cablecard ready tuners by by HD Homerun and Ceton which coincides with my 3-year renewal of TiVo subscription, I will switch to the new HD Homerun box and eliminate the TiVo, and its monthly/annual fees.
> 
> But in the meantime I will return to Adscan (not Comskip) now that I know that I am not the only one having issues. Thanks again for you help.


With version 0.87 you can now use ComSkip with your DVRMS outputs, with no problem -- see the next post!

Edit: You do have to use the two-step process flow (QSF followed by AdScan-with-ComSkip). The QSF'ed file will be .mpg in 0.87 which gives the goodness to ComSkip.


----------



## dlfl

*Changelog 2 Mar 2010 Ver. 0.87*
*Major Change * Process flow and folder uses have been changed substantially. There is a single output folder where all final outputs of any process flow are saved. There is a temp(QSF) folder that is used only for temporary QSF'ed files (when the process flow is QSF followed by AdScan). All folders must be distinct now  no two folders can be the same. See the Process Flow and Folders section [of TVAP-Readme.pdf] above for details. When the process is QSF followed by AdScan, the (temporary) QSF file is saved in the Temp(QSF) folder and will be deleted when processing is done, provided Delete QSF is checked.
*Major Change * When the process flow is QSF followed by AdScan, the (temporary) QSF'ed file is saved in .mpg format. This has the advantage increasing ComSkip usability  if the QSF'ed file was DVRMS format, ComSkip frequently failed. Also, no temporary or final output files have _QSF added to their names.
*Change*  User Post-process files are run (if checked) for all output types now.
*Fixed * For DVRMS outputs, the metadata was not being inserted in the output file for some process flows.
*Fixed * The user postprocess and clean-up batch files were being called twice for some process flows.

DISCUSSION OF CHANGES:
For upgrading TVAP users, your current XML data file will be fine but what you used to call the *QSF Destination folder *will now be the* Temp (QSF) folder*, and what you used to call the *Ad Scan Destination folder *will be the (final)* Output Folder*.

However you may have to make some changes, for example:
1. If you had two folders that were the same, they will have to be set to different locations. And all folders must be set except the TiVo Destination.
2. If you use a process flow where all you do is QSF, the output file will now be saved to the Output Folder (the one that used to be called the Ad Scan folder). And of course the location of your post-process script will have to change accordingly.
3. Post-Process and Clean-up scripts may have to change because TVAP now produces NO output files with "_QSF" in their names! (That's a good thing, right?)

*Notes to Windows 7 users*:
1. Whenever you install a new version of VideoReDo , it is strongly recommended you run it once as administrator (Right-click shortcut and select Run as administartor) before starting TVAP.

2. After TVAP inserts metadata into a final DVRMS output file, the file may be unavailable to other programs for up to 5 minutes. If you are doing postprocessing or cleanup involving the output file your batch file should take this into account, e.g.,, with a wait statement. I have no idea what's going on here and it only seems to happen on Win 7. I spent some time on it but didn't see what causes it -- so we have to live with it for now, at least.


----------



## Burger23

drv-ms is checked- but looks like a mpg is being created


----------



## dlfl

You have Do QSF and Do Adscan both checked, correct?

The QSF will produce a .mpg file in the Temp (QSF) folder. Then the AdScan output will produce a DVRMS in the Output folder.


----------



## dlfl

dlfl said:


> You have Do QSF and Do Adscan both checked, correct?
> 
> The QSF will produce a .mpg file in the Temp (QSF) folder. Then the AdScan output will produce a DVRMS in the Output folder.


I decided to make my laptop XP machine a test bed for VRD Plus (for now), so I uninstalled all VRD versions then installed the latest Beta Build 596 of VRD Plus. I discovered the "Run VideoReDo" button would not launch VRD and found the reason was that somewhere along the line VRD changed the executable's file name from "videoReDo.exe" to "VRDPlus3.exe".

I modified TVAP to handle either executable name and with the modified version the QSF+ComSkip-AdScan process without autocuts ran just fine.
Will put the modified TVAP up for download ASAP.


----------



## dlfl

2 Mar 2010 Ver. 0.88
Fixed  Run VideoReDo button did not work with *VRD Plus *Beta Build 596 because the VRD Plus executable file name had been changed from VideoReDo.exe to VRDPlus3.exe.

Unless you're using late VRD Plus betas, you probably don't need this fix.


----------



## philhu

Hi

How about two things:

You have post processing. Can you add preprocessing?

The reason I ask is I use mfs_ftp to download from the Tivo. It is much faster but creates .ty or .ty+ files, not .tivo

I want to run a preprocess to use s3tots to cvt these to .mpg files, which would then be used to go thru VRD4 to make MP4 files.

Or better, preprocessing *AND* ty/ty+ support. All you would need to do is run s3tots as a first step outputting a mpg for the rest of the processing.


----------



## dlfl

philhu said:


> Hi
> 
> How about two things:
> 
> You have post processing. Can you add preprocessing?
> 
> The reason I ask is I use mfs_ftp to download from the Tivo. It is much faster but creates .ty or .ty+ files, not .tivo
> 
> I want to run a preprocess to use s3tots to cvt these to .mpg files, which would then be used to go thru VRD4 to make MP4 files.
> 
> Or better, preprocessing *AND* ty/ty+ support. All you would need to do is run s3tots as a first step outputting a mpg for the rest of the processing.


Have you looked at **DirMon** for this?


----------



## dlfl

10 Mar 2010 Ver. 0.89
*Fixed * BTV metadata dates were incorrect.
*Fixed * Unnecessary updates to input video file list during file transfers caused scrolling that interfered with operator use of the list.

I've left Ver. 0.88 on the download site in case.......


----------



## dlfl

*10 March 2010 Ver. 0.90
Added * Default configuration option to insert metadata in .mp4 and .m4v output files, using AtomicParsley. Checkbox is enabled only if running TVSuite 4. AtomicParsley.exe is installed with TVAP. It is run before any postprocess or cleanup batch files.

Thanks are due the Source Forge AtomicParsley project for this capability.

Due to two TVAP updates in one day, the previous two versions of the program have been left on the download site, just in case.....


----------



## msmart

Hey dl, speaking of AtomicParsley.... now that I'm using it, I've noticed that the episodeNumber for the show Psych is consistently wrong. I'm sure it's TiVo's fault, but what I'm noticing that it's always short one episode.

Example, the 3/3 episode is the 15th episode of season 4 but the metadata file shows it as 4014. It should be 4015. What I have to do is edit the metadata file before the post process batch runs to make it 415. 

Has anyone else noticed that the episode number is off by one?

Also, because there is a leading zero in the episode, Atomic Parsley makes it season 40 but I know there probably isn't anything you can do about this.


----------



## dlfl

msmart said:


> Hey dl, speaking of AtomicParsley.... now that I'm using it, I've noticed that the episodeNumber for the show Psych is consistently wrong. I'm sure it's TiVo's fault, but what I'm noticing that it's always short one episode.
> 
> Example, the 3/3 episode is the 15th episode of season 4 but the metadata file shows it as 4014. It should be 4015. What I have to do is edit the metadata file before the post process batch runs to make it 415.
> 
> Has anyone else noticed that the episode number is off by one?
> 
> Also, because there is a leading zero in the episode, Atomic Parsley makes it season 40 but I know there probably isn't anything you can do about this.


Yeah, don't think there's much that can be done about these issues, unless you wanted to adopt a rule that season numbers can never be greater than some maximum. I'm not sure what a safe number would be, however. I wonder if 9 would be worth using, recognizing there are definitely series that are past 9 seasons -- but are there any that TVAP users care about ? (The only ones that come to mind are soap operas, Wheel of Fortune and Jeopardy. I think one or two popular series may have gone more than 9 seasons, but it's getting pretty rare.)

I think you're discussing pyTiVoParsely rather than TVAP, but the conversions are identical.


----------



## garrubal

Is there any way to automate or semi-automate doing this the following?

- Transfer shows from Tivo to PC using Tivo Desktop Plus (I think the feature is alredy built in

- Remove commercials using VideoReDo automatically (it looks like this program TVAP does that).

- Return the edited program back from PC to Tivo using Tivo Desktop Plus automatically. 

Is there a way to do this? Looking at Tivo desktop plus, I think there is an option to place a file in a folder to automatically move back to the Tivo.


----------



## dlfl

garrubal said:


> - Transfer shows from Tivo to PC using Tivo Desktop Plus (I think the feature is alredy built in


You don't need the Plus version for this. Also I think free program TiVoPlaylist offers more flexibility.



garrubal said:


> - Remove commercials using VideoReDo automatically (it looks like this program TVAP does that).


TVAP runs VideoReDo or ComSkip to do this but usually neither method is perfect. TVAP has a mode where it runs the detection program then puts processing of that particular video on hold until you manually review and adjust the cuts in VideoReDo.



garrubal said:


> - Return the edited program back from PC to Tivo using Tivo Desktop Plus automatically.


Again the plus version isn't needed. Either TivoDeskTop or pyTivo can be used to let you "pull" programs from the TiVo user interface. pyTiVo also lets you "push" videos back.

You may also want to checkout kmttg which can auto-transfer from the TiVo to your PC, and automate commerical removal, editing and processing, similar to TVAP. kmttg will also "auto push" videos back to the TiVo, working in conjunction with pyTiVo.

With either TVAP+VideoReDo or kmttg you can re-encode your videos to MPEG-4 (2X or 3X smaller for same video quality) and they can be pushed back with pyTiVo or streamed back with StreamBaby.

As you may be guessing by now there are a lot of good options and I haven't even mentioned some of the ifs, ands or buts concerning metadata.

Since I'm a TVAP user, my approach would be TiVoPlaylist, TVAP (and VideoReDo), and pyTiVo. I also encode to MPEG-4 and stream back using StreamBaby.

You might want to consider starting a thread here giving the most precise definition possible of your requirements and your PC and TiVo equipment info. Then users with other preferred approaches could give their suggestions. (I'd prefer to keep this thread on topic, i.e., TVAP.)

If you decide to use TVAP I and other TVAP users will be happy to help you in this thread.


----------



## dlfl

7 April 2010 Ver. 0.91
Added: Automatic application of dimension filters during QSF based on configuration file *VRDDimensionFilters.txt* located in the user's TVAP data folder (%APPDATA%\TVAP). Each line in this text file must contain three items, formatted as follows:
<match string>* :: *<filter width>* :: *<filter height>
Examples:
Tonight Show* :: *1920 *::* 1080
WDTNDT* :: *1280 *::* 720

If the video name contains the match string, the corresponding dimensions will be applied.

Syntax rules:

Matches are NOT case sensitive.
The double-colon delimiters :: MUST be used to separate the three items.
Quotes are not needed, and should not be used, on the match string (unless they are part of the string).
Spaces before or after each item are ignored. (The spaces on each side of the double-colon delimiters in the examples are just for a neat look.)
If a line is improperly formatted it is ignored. The TVAP log gives messages indicating whether a filter was used during QSF of a file, and the dimensions used.
The first match found will be used. Thus if you have two match strings like WDTNDT and WDTNDT2, place the line with the longer match string higher in the file list.
If the dimensions file doesn't exist filtering is not done but operation is otherwise normal.

The dimensions file is read at the start of each QSF operation -- Thus you can modify it and changes will be in effect without restarting TVAP.

Note: If the file being processed has NO scenes with the filter dimensions you specify, VideoReDo will pop up a message box, which you must click. This obviously halts automatic processing until you click it.


----------



## dlfl

*31 May 2010 Ver. 0.92*
*Added:* Saves current configuration and file processing status if ended due to system shutdown or restart, and adds log entry: Program ended because of system shutdown or restart.

This should prevent having to manually stop processing on restart for XP and should prevent repeating past VRD processing for Win7 systems after restart.


----------



## bigfella

Can any one help me.
I have a couple of programs that are remaining in the top list, saying they are transferring.
They are not in the original TIVO folder and I can not get rid of them.
I have tried deleting the log files for TVAP but this didn't work

Any help would be appreciated. 
Thanks Matt


----------



## dlfl

bigfella said:


> Can any one help me.
> I have a couple of programs that are remaining in the top list, saying they are transferring.
> They are not in the original TIVO folder and I can not get rid of them.
> I have tried deleting the log files for TVAP but this didn't work
> 
> Any help would be appreciated.
> Thanks Matt


There are two ways to fix this, both of which involve the TVAP XML data file, which is named TiVoFileManager.xml and is located in the TVAP data folder: %APPDATA%\TVAP (Type echo %APPDATA%\TVAP at a command prompt to see where this is for your logon.) Either method requires you shutdown TVAP.

1. Delete the XML file. This will mean you have to reconfigure TVAP just as in an initial installation, and will lose file status of all video files.

2. Edit out the sections in the XML file corresponding to the problem videos. Each video file has a section that starts with <TivoFileData> and ends with </TivoFileData>. The file name is the first element in the section.

I'm curious how this happened. If it continues to happen, try to figure out what action may have caused it and let me know.


----------



## bigfella

dlfl said:


> I'm curious how this happened. If it continues to happen, try to figure out what action may have caused it and let me know.


I think I may have deleted the files while they were encoding but I'm not sure.
I will let you know if it happens again.


----------



## dlfl

I will soon be discontinuing upgrades to TVAP because VAP ("VideoReDo-autoprocessor") does everything TVAP does. VAP is very similar to TVAP but processes all the input file types that VideoReDo supports, including WTV if you have TVS4. The VAP thread is on the VideoReDo forums here:

http://www.videoredo.net/msgBoard/showthread.php?t=16340

I encourage TVAP users to switch over to VAP soon. Let me know if VAP doesn't do something you could do with TVAP.


----------



## dlfl

VAP (not TVAP) Ver. 0.48 automatically reads video dimensions from input files and applies them to filter VRD QSF's. This upgrade will not be incorporated in TVAP (Please switch to VAP).

For details see the VAP thread:

http://www.videoredo.net/msgBoard/showthread.php?t=16340


----------



## msmart

I switched from TVAP to VAP and am loving it. The latest version 0.50 has multiple instance capability. Config 1 is for processing newly downloaded TiVo files, config 2 to process previously edited shows that are in mpeg format converting them to mp4.

For anyone who is currently running TVAP, switching to VAP is transparent. I recommend it.


----------

