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. dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    The file pyTivo.conf.dist now distributed in the zip downloads is the example pyTivo.conf file. Be sure to read the notes at the bottom of the WiKi page you referenced carefully.

    A couple of problems I see in pytivo.conf.dist:

    1. The per-tivo section example ("[_tivo_00000DEADBEEF]") should be commented out. If you use such a section the 00000DEADBEEF must be replaced by your TiVo's TSN.

    2. A few lines below that, this line:

    #ffmpeg_prams=-i %(in_file)s -vcodec ..............

    Is incorrect (although it is commented out so would not cause a problem). The "-i %(in_file)s" part should not be there.

    Unless you are doing HDTV you can probably just leave both ffmpeg_prams lines commented out, which will revert to default ffmpeg settings -- although the first such line appears to be OK.
     
  2. wmayhem

    wmayhem New Member

    7
    0
    Oct 22, 2007
    Will give it a try. Thanks!
     
  3. wmayhem

    wmayhem New Member

    7
    0
    Oct 22, 2007
    Can find the version number with your method. But, what is the proper way of updating pytivo? I used the latest version that had a windows installer.

    When I upgrade to a newer version of pytivo, do I need to uninstall the service and then reinstall the new one?

    Do I overwrite the whole PyTivo folder (with the exception of the conf file)?

    Can anyone recommend which version post 182 is stable?

    Thanks.
     
  4. dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    Not sure what your goal is at this point.
    Go to new version of pyTivo or just get newer version of ffmpeg ?

    I don't use the windows installer versions and don't run pyTivo as a service, so can't anwer questions related to those, except: if you are running it as a service and want to install a later version, I'm sure you need to uninstall your current version and you probably need to stop the service beforehand.

    I keep multiple versions in separate folders in c:\program files, e.g.,
    c:\program files\pyTivo187 etc. You just create that folder, get the .zip distribution and unzip all the contents into that folder. Then create/modify pyTivo.conf and run by clicking pyTivo.py (or a shortcut to it). But this is not the service version. Versions 187 and 200 were good for me and so far no problems with 208.
     
  5. BillB

    BillB New Member

    23
    0
    May 19, 2002
    Many thanks.

    I have just one more question. I have 2 Tivo Series 2 and HDTV hooked to both. Are there any other things I should change in the pytivo.conf.dist file?
     
  6. dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    I have no direct experience with multiple TiVo's or with HDTV but I think you need to define a per-tivo section for each TiVo and set aspect169=true in each section.

    OP with HDTV and HD tivos definitely increase the video and audio bitrates. Whether you need this with S2 tivo's is something to experiment with. I believe there is a setting in the tivo itself for the 16:9 video but you probably already have set that.
     
  7. gilbreen

    gilbreen Member

    69
    0
    Sep 5, 2007
    Can anyone recommend some ffmpeg settings recommendations to put in my pyTivo.conf file for TivoHDs connected to an HDTV? The original mpeg files are 720x480 @29.97fps.

    Here is my current config file:

    Code:
    [Server]
    port=9032
    
    
    #Full path to ffmpeg including filename
    #For windows: ffmpeg=c:\Program Files\pyTivo\plugins\video\ffmpeg_mp2.exe
    #For linux:   ffmpeg=/usr/bin/ffmpeg
    #ffmpeg=/usr/bin/ffmpeg
    ffmpeg=C:\Program Files\pyTivo\plugins\video\ffmpeg_mp2.exe
    
    
    #This will make a large debug.txt file in you base directory.  It only debugs
    #transcode.py right now.
    #debug=false
    
    # Audio bit-rate, default 192K
    #audio_br=192K
    
    # Video bit-rate, default 4096K
    #video_br=12Mi
    
    #Beacon broadcast address(es)
    #Typically use 255.255.255.255 but on some multihomed machines you may
    #need to specify the subnet broadcast address(es) of your Tivo boxes
    #beacon=255.255.255.255
    
    #Output Pixel Width: if you have an HDTV you might want to try 720 or 704
    #Valid: 720, 704, 544, 480, 352
    #width=1440
    #height=720
    
    ##Per tivo options
    # section named _tivo_TSN with the tsn in all caps
    #[_tivo_2400000DEADBEEF]
    
    #If you want to use 16:9 or 4:3 on this tivo
    #aspect169=true
    
    #Bedroom
    [_tivo_65200018033xxxx]
    aspect169=true
    
    #Basement
    [_tivo_65200018033xxxx]
    aspect169=true
    
    #Living Room
    [_tivo_65200018033xxxx]
    aspect169=false
    
    #Family Room
    [_tivo_6490001806Fxxxx]
    aspect169=false
    
    #Type can be either 'video' or 'music'
    #Path is the full path to your files (No trailing slash needed)
    #For windows: path=c:\videos
    #For linux:   path=/media
    
    ##You can have more than one share
    #[MyTelevision]
    #type=video
    #path=d:\television
    
    [Magic School Bus]
    type=video
    path=P:\Magic School Bus
    
    [XPC Movies]
    type=video
    path=P:\XPC Movies
    
    [XPC Shows]
    type=video
    path=P:\XPC Shows
     
  8. wgw

    wgw New Member

    217
    0
    May 16, 2007
    Here is what I have in pyTivo.conf but it will not work in your older version of pyTivo. You would need a newer version that supports ffmpeg templates such as 6ddab, cf131 or newer.

    audio_br=384K
    video_br=14Mi
    ffmpeg_prams=-vcodec mpeg2video -qscale 1.2 -maxrate %(max_video_br)s -bufsize %(buff_size)s %(aspect_ratio)s -comment pyTivo.py -acodec ac3 -ab %(audio_br)s -ar 48000 -f vob -

    Just increase or decrease the qscale setting depending on the quality you want, the speed of your processor, and how long you are willing to wait for the encode. I would recommend a setting somewhere between 0.8 and 1.8. A lower setting is higher quality but longer encoding time. 1.8 is probably similar to the quality of the default settings used by pyTivo.

    video_br setting is not actually used by ffmpeg with this string because it has been replaced by qscale. But the setting is still required because pyTivo uses it to allocate enough space on the Tivo. I actually use a setting of 12Mi, but 14Mi might be required if you push the qscale setting really low and have a high bitrate source.

    I also removed the framerate setting because the Tivo has successfully played every framerate I have thrown at it. I figured why change it if you don't have to.

    AC3 audio has also been added so as not to lose 5.1 surround during the encoding.
     
  9. gilbreen

    gilbreen Member

    69
    0
    Sep 5, 2007
    Excellent! Thanks. It is possible to have different settings per Tivo with the newer versions of pyTivo? I have one S2 DT connected to an SD TV.

    Also, you mention the processor speed will determine what qscale setting one should use. I have a P4 3.2GHz running WinXP. Any recommendations?
     
  10. scrappydog65

    scrappydog65 Long Time TiVo User

    29
    0
    Dec 29, 2003
    Pennington, NJ
    I've noticed that the video plug-in also displays JPG files in the NPL, though I had expected it to list only video files (MPG, AVI, TiVo, ASF, MOV, QT, etc.). Is there a way to filter out the JPG's?

    I looked at the code in Video.py. In the function (?) for video_file_filter(), it seems like maybe there is a way to check the extension of the file in the FOR loop, but I'm not familiar with Python syntax (though I have lots of other development experience). The indentation and lack of a start/end structure are definitely confusing.

    Thanks,

    Mike
     
  11. etsolow

    etsolow Don't Try

    1,554
    0
    Feb 8, 2001
    Wisconsin
    I tried these ffmpeg parameters and my stereo indicates that it is indeed receiving a 5.1 signal, but on non-5.1 material it still is, and the channels sound funny... like the dialog is coming from the front L/R instead of the center. Any way to make ffmpeg only use AC3 on 5.1 material?
     
  12. wgw

    wgw New Member

    217
    0
    May 16, 2007
    Stereo source material would only use front L/R. But you can try "-acodec copy" to keep the original codec. Someone reported up above that this fixed a problem they had with an unusual type of source material. I have not tried it myself because ac3 has worked well so far.

    EDIT: I just tried "-acodec copy" on a divx and got no sound at all. I was afraid of that. I'll stick with ac3.
     
  13. wmayhem

    wmayhem New Member

    7
    0
    Oct 22, 2007
    I guess that I'll try a reinstall of both pyTivo and ffmpeg and assume that the latest release of pyTivo includes the latest ffmpgeg. I really appreciate your install tips. Thanks.
     
  14. wmcbrine

    wmcbrine Ziphead

    10,367
    22
    Aug 2, 2003
    Hey, so it does! They don't work, though. It would be nice if pyTivo had an "images" plugin to go along with music and video... hmmm...

    The problem is that ffmpeg recognizes still images as something it can handle. I guess you could do something like this:

    Code:
    def video_info(inFile):
        bad_extents = ['.jpg', '.png', '.gif', '.txt', '.xml']  # ignore .txt and .xml too
        if os.path.splitext(inFile)[1].lower() in bad_extents:
            return None, None, None, None, None
        .
        .
        .
    
    P.S. Learn Python, you'll love it. No more fiddling around with nonsense. I wrote the above in the time it took me to type it, and I thought, "Wait, it can't be that simple, can it?". But it can.
     
  15. dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    See this post for the details.

    About 80% of the items possible with pyTivo ver. 143ca.... are supported automatically and seamlessly.

    Thanks, Armooo!
     
  16. jcthorne

    jcthorne Active Member

    2,721
    3
    Jan 28, 2002
    Houston
    Using any combination of these metadata tags like IsEpisode : True and filling in the seriesTitle and seriesId....has ANYONE seen tivo place files into a group?
     
  17. dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    Yes. I think the seriesID is the key. But maybe it's a logic combination with other items and maybe I just got lucky (?).

    I've seen isEpisode set to true in .tivo file metadata (via TivoDecode) for movies, so I have to wonder if that is a critical factor. There is another tag, "isEpisodic" that is set to false for movies and true for series. That would be a more likely candidate for a controlling factor, it seems.
     
  18. wgw

    wgw New Member

    217
    0
    May 16, 2007
    Yes, grouping works. A valid seriesId is all that's required. See here for the command to obtain a seriesid.

    I you are using pyTivo 143ca, the series id would be entered in the txt file like this. Note the capital "I".

    seriesId : SH897934
     
  19. dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    Hmmm.... I think it's more complicated than that. I just did some experiments and didn't get grouping even though the seriesID was correct. There must be another metadata tag(s) that can defeat or enable grouping in some logic combination. Looking at the 143ca template I see that isEpisodic is being set with the value of isEpisode, i.e., it's already being sent as "true" -- and thus that can't be the problem.

    'tis a puzzlement!

    Edit: Whoa! Maybe NOT a puzzlement but rather a bug in TVAP parsing the TiVoDecode "chunk" containing the .tivo metadata. Stand by!
     
  20. wgw

    wgw New Member

    217
    0
    May 16, 2007
    The following is the seriesid for show titled "Various". Would someone mind trying this to see if it will group shows on their Tivo. I'm just wondering if the series ID has to come from a previous recording on your own account, or if anyone can use any valid series id.

    seriesId : SH380827

    If this works for anyone, you might want to use this series id to group all your movies or miscellaneous recordings in the same folder. seriesId : SH897934 is for show called "HitList" which I am currently using to group movies. You might try that one too.
     

Share This Page