1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

TiVo-VideoReDo-AutoProcessor Program

Discussion in 'TiVo Home Media Features & TiVoToGo' started by dlfl, Jul 19, 2007.

  1. Aug 19, 2007 #61 of 418
    dlfl

    dlfl Cranky old novice

    6,995
    16
    Jul 6, 2006
    Near...
    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.
     
  2. Aug 19, 2007 #62 of 418
    FrooBrar

    FrooBrar tivodecode author

    42
    0
    Dec 4, 2006
    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.
     
  3. Aug 19, 2007 #63 of 418
    FrooBrar

    FrooBrar tivodecode author

    42
    0
    Dec 4, 2006
    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.
     
  4. Aug 19, 2007 #64 of 418
    dlfl

    dlfl Cranky old novice

    6,995
    16
    Jul 6, 2006
    Near...
    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
     
  5. Aug 19, 2007 #65 of 418
    FrooBrar

    FrooBrar tivodecode author

    42
    0
    Dec 4, 2006
    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.
     
  6. Aug 19, 2007 #66 of 418
    FrooBrar

    FrooBrar tivodecode author

    42
    0
    Dec 4, 2006
    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.
     

    Attached Files:

  7. Aug 19, 2007 #67 of 418
    dlfl

    dlfl Cranky old novice

    6,995
    16
    Jul 6, 2006
    Near...
    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:upload@videoredo.net/VRD Add-Ons/TiVo-VideoReDo-AutoProcessor/
     
  8. Aug 20, 2007 #68 of 418
    dlfl

    dlfl Cranky old novice

    6,995
    16
    Jul 6, 2006
    Near...
    Small bug fix: If you had enough files displayed to invoke the scroll bar the right click for metadata would select the wrong file.
     
  9. Aug 26, 2007 #69 of 418
    tbuskey

    tbuskey New Member

    3
    0
    Jun 27, 2003
    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!
     
  10. Aug 26, 2007 #70 of 418
    dlfl

    dlfl Cranky old novice

    6,995
    16
    Jul 6, 2006
    Near...
    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?
     
  11. Aug 31, 2007 #71 of 418
    tbuskey

    tbuskey New Member

    3
    0
    Jun 27, 2003
    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
     
  12. Aug 31, 2007 #72 of 418
    dlfl

    dlfl Cranky old novice

    6,995
    16
    Jul 6, 2006
    Near...
    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.
     
  13. Sep 1, 2007 #73 of 418
    FrooBrar

    FrooBrar tivodecode author

    42
    0
    Dec 4, 2006
    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?
     
  14. Sep 1, 2007 #74 of 418
    dlfl

    dlfl Cranky old novice

    6,995
    16
    Jul 6, 2006
    Near...
    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?
     
  15. Sep 1, 2007 #75 of 418
    FrooBrar

    FrooBrar tivodecode author

    42
    0
    Dec 4, 2006
    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).
     
  16. Sep 3, 2007 #76 of 418
    dlfl

    dlfl Cranky old novice

    6,995
    16
    Jul 6, 2006
    Near...
    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:upload@videoredo.net/VRD Add-Ons/TiVo-VideoReDo-AutoProcessor/
     
  17. Sep 5, 2007 #77 of 418
    FrooBrar

    FrooBrar tivodecode author

    42
    0
    Dec 4, 2006
    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?
     
  18. Sep 5, 2007 #78 of 418
    dlfl

    dlfl Cranky old novice

    6,995
    16
    Jul 6, 2006
    Near...
    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!).
     
  19. Sep 7, 2007 #79 of 418
    FrooBrar

    FrooBrar tivodecode author

    42
    0
    Dec 4, 2006
    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...

    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.

    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.
     
  20. Sep 7, 2007 #80 of 418
    Dan203

    Dan203 Super Moderator Staff Member TCF Club

    37,446
    165
    Apr 17, 2000
    Nevada
    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
     

Share This Page