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

New program for 1 step TTG downloads, decryption, encoding - kmttg

Discussion in 'TiVo Home Media Features & TiVoToGo' started by moyekj, Mar 15, 2008.

  1. May 24, 2009 #681 of 10413
    wmcbrine

    wmcbrine Ziphead

    10,369
    22
    Aug 2, 2003
  2. May 24, 2009 #682 of 10413
    cherry ghost

    cherry ghost Active Member

    5,281
    6
    Sep 13, 2005
    Chicago
    That did it, thanks for the quick fix.
     
  3. May 24, 2009 #683 of 10413
    moyekj

    moyekj Well-Known Member

    11,150
    33
    Jan 23, 2006
    Mission...
  4. May 25, 2009 #684 of 10413
    wmcbrine

    wmcbrine Ziphead

    10,369
    22
    Aug 2, 2003
    Probably because there isn't really much reason to include it at all, from pyTivo's perspective, since it always checks the duration anyway with ffmpeg. Though I suppose it could be useful now, if you're running pyTivo without ffmpeg.

    Anyway, there is no spec. The code is the spec. The code wants milliseconds, or nothing. "Nothing" is a perfectly good choice here.

    Milliseconds are also what the TiVo uses -- they're what you'll see in the "Duration" field at https://tivoip/TiVoConnect?Command=QueryContainer&Container=/NowPlaying

    The ISO format is also used in pyTivo, but it's derived from the milliseconds value in metadata_full():

    Code:
    metadata['iso_duration'] = ('P%sDT%sH%sM%sS' % 
                                (duration_delta.days, hours, min, sec))
    
    There is no code to do the reverse translation.
     
  5. May 25, 2009 #685 of 10413
    wmcbrine

    wmcbrine Ziphead

    10,369
    22
    Aug 2, 2003
    Actually, as I look at it now, even specifying milliseconds in the metadata text won't work, since it would be read as a string and never converted to an int, which is what it's expected to be. Basically, "duration" is an internal field that was never intended to be set in the metadata file at all.

    If you want to record the duration (in ISO format) for some other purpose, you could use "iso_duration" instead of "duration" -- also an internal field, but in this case it would be overridden by pyTivo; the value in the metadata file would be ignored.

    If you really wanted pyTivo to use a duration value from metadata, you could set "Override_millisecs". But I don't recommend that.
     
  6. May 25, 2009 #686 of 10413
    moyekj

    moyekj Well-Known Member

    11,150
    33
    Jan 23, 2006
    Mission...
    OK thanks. Sounds to me like the right choice is to not include duration at all. I'll make that change for next release.
     
  7. May 25, 2009 #687 of 10413
    moyekj

    moyekj Well-Known Member

    11,150
    33
    Jan 23, 2006
    Mission...
    I don't know if it's easy enough for you to put some kind of check to ignore the duration field if it comes from metadata file (as a string)? Myself and others using kmttg already have countless files with the duration string there in ISO format that would probably break with newer pyTivo installations is why I ask. This didn't used to be a problem with older versions of pyTivo.
     
  8. May 25, 2009 #688 of 10413
    bkdtv

    bkdtv New Member

    7,902
    0
    Jan 9, 2003
    DC Metro Area
    For a future release, you might look into an auto-update function, or at least an update notifier, so users always have (or know about) the latest version, without checking this thread or the main site every few days.

    At some point, you should also seriously consider a "Donate" menu for Paypal.
     
  9. May 25, 2009 #689 of 10413
    wmcbrine

    wmcbrine Ziphead

    10,369
    22
    Aug 2, 2003
    Yeah, will be committed soon... (Edit: posted now.)

    I disagree. While it's surprising that it hasn't been reported before, there are no recent changes to pyTivo that would elicit it. Rather, it may simply be the first time that someone tried to push a file with kmttg-generated metadata, and bothered to report the failure. A pull would work, because it would use the data from the TVBus request, which consisted of ISO-format times generated from the ffmpeg-read duration before the metadata text file was read. (This can still be overridden by Override_millisecs, though -- the file is read twice, with different parts being parsed at different times.)
     
  10. May 25, 2009 #690 of 10413
    moyekj

    moyekj Well-Known Member

    11,150
    33
    Jan 23, 2006
    Mission...
    Great, thanks.

    Makes sense, I was only thinking "pulls" which is what I used in the past.
     
  11. May 27, 2009 #691 of 10413
    cburbs

    cburbs New Member

    158
    0
    Jan 29, 2009
    So after the show is re encoded what options are there for sending it back to the tivo box?
     
  12. May 27, 2009 #692 of 10413
    moyekj

    moyekj Well-Known Member

    11,150
    33
    Jan 23, 2006
    Mission...
    There are quite a few options, a couple of which are:
    1. pyTivo allows you to copy almost any video file to your Series 2 or Series 3 Tivos. In normal "pull" mode only mpeg2 is natively supported so incompatible files are transcoded on the fly to mpeg2 if necessary (H.264 is also transcoded in this mode). pyTivo also has an option to "push" files to your Tivos - i.e. send a physical copy (or a transcoded copy) to your Tivos. In push mode natively compatible files such as mpeg2 & H.264 are not transcoded if pushing to Series 3 Tivos.

    2. Streambaby allows you to stream almost any video file back to your Series 3 Tivos. For certain formats (mpeg2 & H.264) you can stream them to your Tivo with no transcoding. For formats that Tivo can't decode Streambaby will transcode to mpeg2 on the fly to send them back. Streambaby also has option to "push" files to your Tivos - capability was copied/translated from the pyTivo implementation.
     
  13. May 27, 2009 #693 of 10413
    AudioNutz

    AudioNutz New Member

    318
    0
    Nov 9, 2008
    Kevin gave you the answers for PeeeCeee. If you are using a Macintosh, the options are:

    Leopard OS (Mac OS X 10.5.x)
    1. PyTiVoX
    2. pyTiVo
    3. TiVo Desktop

    Tiger OS (Mac OS X 10.4.x)
    1. pyTiVo
    2. TiVo Desktop
     
  14. May 27, 2009 #694 of 10413
    eman31

    eman31 New Member

    14
    0
    Apr 17, 2009
    I just started using this program a few weeks ago, and really like it. If I change over to the Java version do I need to start from scratch or will it use settings from the last one?

    Another quick question, not sure if anyone can answer but I have been trying to figure it out myself with no luck. Right now when I am downloading shows I have it set to pull the metdata, decrypt, quickfix with Videoredo and then run comskip for the vrd project data. After everything runs I end up with a file for a project log for comskip, a text file with a bunch of numbers, the metadata text file and the project file for vrd. Is there anyway to get just the metadata and vrd project files without the rest?
     
  15. May 27, 2009 #695 of 10413
    cburbs

    cburbs New Member

    158
    0
    Jan 29, 2009
    Sorry should have stated a few things - PC no mac and that I was aware of streambaby and pyTivo.


    So is there any way of setting something up that once the file is encoded pytivo can send it back once dropped into a certain folder?

    I will do some digging on this but I just started looking at this and I played with PyTivo a month ago. I also use streambaby alot for streaming movies to my tivo.
     
  16. May 27, 2009 #696 of 10413
    moyekj

    moyekj Well-Known Member

    11,150
    33
    Jan 23, 2006
    Mission...
    The new Java version is much easier to install so starting from scratch is not painful. However the config.ini file is backwards compatible, so you can just copy the config.ini file from the Perl installation over to the Java installation directory (put it in same folder as kmttg.jar file) if you like to preserve all your settings.

    Not without some extra work. In the new Java version there is an option to run a "custom" task (always the last task to run) which you could setup to execute a batch script that removes files you don't want.
    In next release I am adding an option to use VRD AdScan instead of comskip for commercial detection, and its only output is a .VPrj file, so perhaps that will suit you better.
     
  17. May 27, 2009 #697 of 10413
    moyekj

    moyekj Well-Known Member

    11,150
    33
    Jan 23, 2006
    Mission...
    pyTivo doesn't have an "autowatch" mode to do that. However the way pyTivo works is you just have to send an HTTP request to pyTivo to initiate a push, so it's conceivable to setup a "custom" task in kmttg that does that automatically. For example setup a "custom" task which executes a python script which sends the HTTP request to pyTivo server. For that example of course you would have to make sure that a pyTivo share is setup to look at the folder where kmttg encoded files end up. I'll see if I can setup a prototype script to do something like that. If there is enough interest I suppose I could setup a dedicated named task for doing it, but for prototype purposes using "custom" should be good enough.
     
  18. May 27, 2009 #698 of 10413
    eman31

    eman31 New Member

    14
    0
    Apr 17, 2009
    Saving my setting were my main concern so that is a relief.


    It's not that big of a deal, I just figured there was something simple that I was missing :D

    I have played around with the VRD commercial skip but find the comskip to be more accurate but may try it again when you ad it.

    Thanks for the quick reply!
     
  19. May 28, 2009 #699 of 10413
    moyekj

    moyekj Well-Known Member

    11,150
    33
    Jan 23, 2006
    Mission...
    OK as proof of concept I created a "custom" task for kmttg that initiates a pyTivo push. Note that I used python script in this example since you need python installed anyway if you are running pyTivo. But any scripting language that can make http calls would work.

    1. In kmttg config add the following for custom command (adjust as needed according to your python installation and location where you put the script:
    "c:\Python25\python.exe" "c:\home\kmttg_v0p6b\push.py" [encodeFile]

    2. Run kmttg as usual and enable "custom" task to be run. In my example I had "encode" and "custom" selected. Note the [encodeFile] argument which kmttg will replace with full path to the encoded video file when the custom task is run.

    Then for my example as soon as encoding completed the custom job is run and the file is pushed automatically to my Bedroom tivo by pyTivo.

    push.py script:
    Code:
    #!/usr/bin/python
    """
    push.py script
    Sample python script to be used with kmttg "custom" job to initiate a pyTivo push.
    KMTTG SETUP
      * kmttg custom job is defined as:
         "c:\Python25\python.exe" "c:\home\kmttg_v0p6b\push.py" [encodeFile]
      * In this example, kmttg videos to be pushed are ending up in path: c:\home\dvd  
    PYTIVO SETUP
      * pyTivo.conf has the following setup for video section. Note that the path matches the above:
    [kmttg]
    type=video
    path=c:\home\dvd
    """
    
    import os
    import sys
    import urllib2
    
    # *******Adjust these as needed ******
    tivo      = "Bedroom"
    container = "kmttg"
    
    if len(sys.argv) != 2:
       sys.stderr.write("ERROR: 1 file argument expected")
       sys.exit(1)
    file = os.path.basename(sys.argv[1])
    
    url = "http://localhost:9032/TiVoConnect?Command=Push&Container=" + container + "&File=/" + file + "&tsn=" + tivo
    try:
       print url
       result = urllib2.urlopen(url)
       sys.exit(0)
    except urllib2.HTTPError, e:
       sys.stderr.write("ERROR : " + e)
       sys.exit(e.code)
    
     
  20. May 28, 2009 #700 of 10413
    cburbs

    cburbs New Member

    158
    0
    Jan 29, 2009
    I will have to give this a try - Thanks alot for the input. :up:

    If I have other ?s should I post here or PM you?
     

Share This Page