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

pyTivo - Transcoding server

Discussion in 'TiVo Home Media Features & TiVoToGo' started by armooo, Nov 25, 2006.

  1. Nov 18, 2007 #981 of 5755
    Sicklybutsexy

    Sicklybutsexy New Member

    179
    0
    May 5, 2007

    I thought it did that already...
     
  2. Nov 18, 2007 #982 of 5755
    dealwatcher2003

    dealwatcher2003 New Member

    3
    0
    Nov 10, 2007
    Should the TIvo Desktop server be running or paused?Now it says it is being transferred but no progress, when I try to play that recording it says please wait a moment to complete more of the transfer before you being to play,but that doesn't complete at all....
     
  3. Nov 18, 2007 #983 of 5755
    dlfl

    dlfl Cranky old novice

    7,052
    26
    Jul 6, 2006
    Dayton OH
    I've been playing with a "compromise" approach that uses just your description tag by packing more metadata in it. I use tivoDecode-based software (just google it) to read these fields from the .TiVo file:

    description
    episodeTitle
    episodeNumber
    movieYear
    genre

    Then it formats all this stuff into one big description .txt file for your pyTivo mod to use. An obvious potential issue is this single field could get too large.

    I take advantage of the fact that (so far) I've never seen a file that had both episodeTitle/episodeNumber AND movieYear (i.e., it's either a movie or a series episode - but not both.) I also strip the "Copyright ...." substring from the end of the description metadata. (This could be an issue, I know.)

    A couple of examples of the compact formatting I use:
    1. For a movie (Gilda):

    Romance: (1946) Blah blah blah (description)

    2. For a series episode with an episode number:

    Action/Adventure: <episode title> (#305) Blah blah blah (description)

    Some series episodes don't have the number, in which case the (#305) would just be absent.

    This scheme seems to work OK based on very limited testing so far (but it all appears in the description portion in TiVo NPL).

    It would be straightforward to write the metadata items into a text file with one line per item. Additional items such as channel, etc. are possible. Could pyTivo be modified to read this file, parse out the separate fields and send them as separate tags similar to what you do now with the description?
    (Your current scheme inserts the entire file into one tag -- obviously not going to work for multiple tags unless one wants to carry around a separate text file for each tag.)

    Anyway .... fun stuff!
     
  4. Nov 18, 2007 #984 of 5755
    jmtassel

    jmtassel New Member

    2
    0
    Nov 17, 2007
    thanks for the response! after making the change, I now experience a different symptom which is slowing down for several minutes going out of sync and then going very fast catching the audio back up to the video. Any thoughts on how to resolve this behavior?
     
  5. Nov 18, 2007 #985 of 5755
    greg_burns

    greg_burns Now in HD

    6,384
    0
    May 21, 2004
    Slower...
    You need to open TCP ports 9032 & 9033 on your PC's firewall.

    Edit: Man, now I am answering questions before they are even asked. :D
     
  6. Nov 18, 2007 #986 of 5755
    wmcbrine

    wmcbrine Ziphead

    10,401
    40
    Aug 2, 2003
    It could... but I think the simple and fast way to handle this is to stick to XML. So, here's my latest patch. It checks first for an XML file ("mymovie.xml" for "mymovie.wmv"), then checks for a text file as before, then falls back to the original behavior. Note that if you create an XML file for a movie, you must define a "<Title>" tag, because the original title mechanism isn't used in that case. This is the only tag that's required. I did this to allow non-filesystem-legal characters in titles.

    pytivo-xml-diff.txt is a diff against my last version. Use this if you already patched it with that.

    pytivo-xml-cumm.txt is a cummulative diff, covering my last patch and this one. Use this if you didn't already use the previous patch.

    pytivo-xml-files.zip has my versions of video.py and container.tmpl (this time with pathnames relative to the pyTivo directory, so it's a little more sensible). Unzip this in the pyTivo directory if you don't want to mess with patching.

    Note that tags are case-sensitive, and you must use the case as found in the XML version of the Tivo's Now Playing list; i.e., "Description" and "EpisodeTitle", not "description" or "episodeTitle" (the latter are the forms found within a .TiVo file).

    As I hinted above, there seem to be two completely different sets of XML tags used to describe Tivo recordings. One is the set that you can see by looking at the XML version of the Now Playing list from the Tivo's internal web server; this is also, AFAICT, the set that works for TTCB. The other set is the one that's used within .TiVo files. They don't appear to have any tags in common -- the in-.TiVo files have some tags with similar names, but they use different capitalization. I've tried using these tags (and in variant cases), and none of them seem to work.

    Now, I called it the in-.TiVo XML, but you can also look at it from the Tivo's internal web server. Go to the XML NowPlaying page, and find a tag called "TivoVideoDetails". This contains another tag, "Url". Put that URL in, and you can see the in-.TiVo XML.
     

    Attached Files:

  7. Nov 18, 2007 #987 of 5755
    Deadpan Science

    Deadpan Science New Member

    22
    0
    Jan 21, 2007
    I recently had to reformat my hd, and for some reason pytivo won't work for me anymore. I want to check my networking conditions too. Are there any particular ports that need to be forwarded to the tivo in order to use pytivo?

    EDIT: ^^ thanks that fixed it!
     
  8. Nov 18, 2007 #988 of 5755
    TreborPugly

    TreborPugly Unreal!

    4,542
    0
    May 2, 2002
    Eastern TN
    This is an awesome development! I'd love to be able to have a bunch of home videos that my Tivo will put in the same "folder", sitting on the Tivo all the time. If I invent a SeriesId and use it for all of them, will that happen?

    Also, is the Kidzone toggle something that can be edited? (Right now, anything you load via pyTivo can't be added to the Kidzone) I'm wondering if a work-around would be to use a SeriesID or SourceChannel for some show or channel that is in your Kidzone.
     
  9. Nov 18, 2007 #989 of 5755
    armooo

    armooo pyTivo Developer

    81
    0
    Feb 1, 2003
    I have added meta data to version 6ddab.

    Currently it is reading from filename.txt and is expecting one attribute per line.

    Sample
    Code:
    description : I am l33t w00t
    episode_title : Bob's Fun Place
    source_channel : 78
    source_station : Bob's
    series_id : 123
    
    It should be simple to extend Video.__metadata to support retrieving data from other sources.
     
  10. Nov 18, 2007 #990 of 5755
    wgw

    wgw New Member

    217
    0
    May 16, 2007
    Thanks armoo.

    I must be doing something wrong. Has anyone gotten this version to display the descriptions.
     
  11. Nov 18, 2007 #991 of 5755
    armooo

    armooo pyTivo Developer

    81
    0
    Feb 1, 2003
    If your video is video.avi your description file should be video.avi.txt
     
  12. Nov 18, 2007 #992 of 5755
    jcthorne

    jcthorne Active Member

    2,767
    13
    Jan 28, 2002
    Houston
    Nope, for a Tivo HD it has no idea. Every file I threw at it was TivoHD acceptable and plays jsut fine, pyTivo wants to change its resolution or frame rate or audio track. Most of my files are 720p, 23.97 fps and ac3 audio, tivo plays them fine. Just reading through the code, pytivo wants the files a specific resolution and exactly 29.97 fps, far more strict than the TivoHD and changing video from 24fps to 30 just wastes disk space and makes the video look worse. Unless the video was 30fps to begin with but most film is 24.

    Then again, I've only been using pyTivo for about 2 days. Thats why I asked for help. The instructions, as applies to a TivoHD seem very incomplete or just outdated. Its a great piece of programming and I want to learn to use it, likely beyond what the author intended.

    For now I ended up making a change to the transcode.py file for it to accept all mpeg2 files, not strictly correct, but I will just have to place only compatible files there. At least until I get a better handle on setting the config file to recognize files the TivoHD can play.
     
  13. Nov 18, 2007 #993 of 5755
    armooo

    armooo pyTivo Developer

    81
    0
    Feb 1, 2003
    commit cf1319956bf7411ce216cc5ab34e65b98755a9d1
    Author: Jason Michalski <armooo@armooo.net>
    Date: Sun Nov 18 20:16:11 2007 -0600

    Added auto subshares

    Create a share for all subfolders

    Add "auto_subshares = True" to a share and all subfolders recursively will be made in to shares.
     
  14. Nov 18, 2007 #994 of 5755
    dlfl

    dlfl Cranky old novice

    7,052
    26
    Jul 6, 2006
    Dayton OH
    Nice! Both this and the .xml scheme of wmcbrine work for me.

    To me the sticky issue is determining how to get some items into a form the TiVo will use. For example, I added the <EpisodeNumber> tag to the template and to Video.__metadata but the NPL info data would not show it although it does show it for some series episodes as recorded. Who knows what logic the Tivo uses -- e.g., maybe you have to have the <IsEpisode> tag present and set before it will display the episode number or something similar (?).

    So far I don't see a way to send Genre or MovieYear either.
    (The workaround is to pack them into the description as I described earlier.) All items I've mentioned (ep #, movieYear and genre) are easily read from TTG .TiVo files using TiVoDecode software.
     
  15. Nov 18, 2007 #995 of 5755
    armooo

    armooo pyTivo Developer

    81
    0
    Feb 1, 2003
    If I recall correctly there is a way to include a url attached to the video item, and that url should be in the xml format that is used for MRV. But I don't have a windows machine or tivo desktop to check it out now. But it should includes a lot more information than basic data that is included now.
     
  16. Nov 18, 2007 #996 of 5755
    greg_burns

    greg_burns Now in HD

    6,384
    0
    May 21, 2004
    Slower...
    Sorry if I am not even close, but is this what you are referring to?
    Code:
    http://tivo:<MAK>@<Computer_IP>:8080/TiVoConnect/TivoNowPlaying/I<filename>.TiVo?Format=text&#37;2Fxml
    
    http://www.tivocommunity.com/tivo-vb/showthread.php?t=333675

    Can't seem to get this to work anymore. I am getting the infamous "The parameter is incorrect."

    What happens when this thread hits 1000? :p
     
  17. Nov 18, 2007 #997 of 5755
    capt_chunk

    capt_chunk New Member

    1
    0
    Nov 13, 2007
    I was able to modify the ffmpeg command line in my transcode.py file to keep the audio channels from swapping all over the place after being transcoded.

    cmd = [FFMPEG, '-threads', '2', '-i', inFile, '-vcodec', 'mpeg2video', '-r', '29.97'] + select_aspect(inFile, tsn) + ['-comment', 'pyTivo.py', '-acodec', 'copy', '-ab', AUDIO_BR,'-ar', '48000', '-f', 'vob', '-b_strategy', '1', '-bf', '2', '-coder', 'vlc', '-mbd', 'rd', '-qmin', '1', '-maxrate', '17M', '-bufsize', '1024k', '-b', VIDEO_BR, '-' ]

    The option "-acodec copy" basically tells ffmpec to use the same codec to encode as to decode.

    pyTivo Version: 201

    Here are some helpful pages about ffmpeg:
    http://howto-pages.org/ffmpeg/
    http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html
     
  18. Nov 18, 2007 #998 of 5755
    armooo

    armooo pyTivo Developer

    81
    0
    Feb 1, 2003
    This is what I was talking about. I just looked at Galleon 2.3.0 and It looks like it adds TiVoVideoDetails to the Item Nodes

    Code:
    <TiVoVideoDetails>
        <ContentType>text/xml</ContentType>
        <AcceptsParams>No</AcceptsParams>
        <Url>/TiVoConnect/TivoNowPlaying/GalleonExtra%2FVideos%2Fparkrun1920_12mbps.mpg?Format=text%2Fxml</Url>
    </TiVoVideoDetails>
    
    And this returns a TvBusMarshalledStruct

    We should be able to use a URL like /TiVoConnect?Command=TVBusQuery&Container=MyMovies&File=parkrun1920_12mbps.mpg then all we will need to to is add a TVBusQuery method on to the Video class, but I don't know if I will have time to work it. But the file was showing up as TV-PG, so the TiVo was using it.
     

    Attached Files:

  19. Nov 19, 2007 #999 of 5755
    armooo

    armooo pyTivo Developer

    81
    0
    Feb 1, 2003
    Currently pyTivo is going by the setting that were on tivo's site for mpegs that are supported on S2 tivos. I made a quick patch to allow all mpegs on S3, but I am sure there is something that is not supported and they would not be transcoded with this patch.
     

    Attached Files:

  20. dlfl

    dlfl Cranky old novice

    7,052
    26
    Jul 6, 2006
    Dayton OH
    Hmmmmm... I confess I've gotten pretty lost regarding this "attached URL" business starting with armoo's post #997. The scenario of primary interest to me is this:
    1. Starting with a transfered .tivo file on my PC I create an edited and/or re-encoded file in another format (mpeg2 or perhaps an mpeg4 type, e.g., xvid/avi)
    2. I store that on the PC or attached USB drive. pyTivo will be used to stream it back to the TiVo on demand. The .TiVo file is now deleted both from the PC and from the TiVo box.

    Is the "attached URL" approach able to provide metadata in this situation, i.e., where the original .tivo file no longer exists when pyTivo serves the file? (My impression is the attached URL must query the DesktopServer to get the metadata from the .tivo file -- correct?). Keeping all the .tivo files around for this purpose would not be worth the disk space.

    Or is there some other way this works, perhaps using the URL to get the metadata and write it to an xml file that is then included when the video is served (like the recent mod)? This would require the desktop server to be running at the time the xml file was created, right? (A small price if it provides a rich set of metadata.)

    Please unconfuse me!
     

Share This Page