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

    Soapm Active Member

    1,564
    0
    May 9, 2007
    So close,...
    This show appears squished on the TV. The aspect ration is waaaay off. The people are tall and skinny and I have black bars on both sides. Any sugestion to make this play right?

    Code:
    INFO:pyTivo:192.168.0.195 [26/Feb/2013 01:47:55] "GET /Lenny/XXXXX/Season%202/XXXXX%20-%20s02e04%20-%20Nobody%20in%20a%20Nothing%20Place.mkv?Format=video%2Fx-tivo-mpeg HTTP/1.1" 206 -
    INFO:pyTivo.video.video:[26/Feb/2013 01:47:55] Start sending "/video/XXXXX/Season 2/XXXXX - s02e04 - Nobody in a Nothing Place.mkv" to FamRoom
    ffmpeg version N-50171-gb16bf91 Copyright (c) 2000-2013 the FFmpeg developers
      built on Feb 21 2013 21:55:21 with gcc 4.4.5 (Debian 4.4.5-8)
      configuration: --enable-gpl --enable-nonfree --enable-version3 --enable-memalign-hack --enable-avfilter --enable-pthreads --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libaacplus --enable-libbluray --enable-libxvid --enable-libfaac --enable-libfdk-aac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx
      libavutil      52. 17.102 / 52. 17.102
      libavcodec     54. 92.100 / 54. 92.100
      libavformat    54. 63.100 / 54. 63.100
      libavdevice    54.  3.103 / 54.  3.103
      libavfilter     3. 39.100 /  3. 39.100
      libswscale      2.  2.100 /  2.  2.100
      libswresample   0. 17.102 /  0. 17.102
      libpostproc    52.  2.100 / 52.  2.100
    [matroska,webm @ 0x95b4600] Unknown entry 0x80
    Input #0, matroska,webm, from '/video/XXXXX/Season 2/XXXXX - s02e04 - Nobody in a Nothing Place.mkv':
      Duration: 00:45:25.53, start: 0.000000, bitrate: 618 kb/s
        Stream #0:0(eng): Video: h264 (Main), yuv420p, 352x478 [SAR 20:11 DAR 320:239], 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc (default)
        Stream #0:1: Audio: aac, 48000 Hz, stereo, fltp (default)
    Please use -b:a or -b:v, -b is ambiguous
    Output #0, vob, to 'pipe:':
      Metadata:
        encoder         : Lavf54.63.100
        Stream #0:0(eng): Video: mpeg2video, yuv420p, 352x480 [SAR 20:11 DAR 4:3], q=2-31, 8192 kb/s, 90k tbn, 29.97 tbc (default)
        Stream #0:1: Audio: ac3, 48000 Hz, stereo, fltp, 448 kb/s (default)
    Stream mapping:
      Stream #0:0 -> #0:0 (h264 -> mpeg2video)
      Stream #0:1 -> #0:1 (aac -> ac3)
    Press [q] to stop, [?] for help
    frame=   51 fps=0.0 q=2.0 size=     256kB time=00:00:01.80 bitrate=1160.1kbits/s dup=2 drop=0    
    frame=  104 fps=103 q=2.0 size=     574kB time=00:00:03.56 bitrate=1318.0kbits/s dup=2 drop=0    
    INFO:pyTivo:192.168.0.195 [26/Feb/2013 01:47:57] "GET /TiVoConnect?Command=QueryContainer&Container=%2F HTTP/1.0" 200 -
    frame=  105 fps= 47 q=2.0 size=     578kB time=00:00:03.59 bitrate=1315.4kbits/s dup=2 drop=0    
    frame=  154 fps= 49 q=2.0 size=    1108kB time=00:00:05.19 bitrate=1745.6kbits/s dup=2 drop=0    
    frame=  209 fps= 58 q=2.0 size=    1522kB time=00:00:07.05 bitrate=1767.1kbits/s dup=2 drop=0
     
  2. Soapm

    Soapm Active Member

    1,564
    0
    May 9, 2007
    So close,...
  3. wmcbrine

    wmcbrine Ziphead

    10,363
    22
    Aug 2, 2003
    Try "Full" mode via the Zoom button?

    It's a weird resolution, but the FFmpeg output says that it was marked as a 4:3 video, and that this was conveyed in the copy. If it was actually meant to be 16:9, but was flagged 4:3, that's not too unusual.
     
  4. Soapm

    Soapm Active Member

    1,564
    0
    May 9, 2007
    So close,...
    It wasn't changing anything...

    The par = 1.0 appears acceptable except I notice it's cropping the top and bottom of 4:3 SD shows. I would prefer to have the video uncropped with left and right black bars on 4:3 shows like this but this seems like a fair comprise and certainly livable. Optres = True was giving me left and right black bars until I got to this show so who knows, I may put that back and see if this alternative remedy will work for just this show.

     
  5. jcthorne

    jcthorne Active Member

    2,719
    2
    Jan 28, 2002
    Houston
    The particular file in question is improperly encoded. Note the resolution shown in the ffmpeg information is 352x478 indicating the video is taller than it is wide. The resolution is encoded backwards. Should have been 478x352. Its unlikely the video will ever look reasonable if re-encoded to a correct 4:3 resolution.
     
  6. wmcbrine

    wmcbrine Ziphead

    10,363
    22
    Aug 2, 2003
    No -- 352 is one of the standard widths for NTSC, and 480 is one of the standard heights (I'm assuming there were just two lines cropped). Like I say, it's weird -- usually you'd see 352x240 (VCD) or 704x480 (or some other width). But these dimensions weren't flipped. In fact, I think 352x480 might even be a resolution that the TiVo generates, in a low-quality mode.

    Obviously it's not using square pixels, but neither are any of the above. (640x480 is 4:3 with square pixels.)
     
  7. wmcbrine

    wmcbrine Ziphead

    10,363
    22
    Aug 2, 2003
    That's not "par = 1.0", that's "Zoom" mode on the TiVo. Switch it to "Panel" mode (again, via the "Zoom" button, aka "Aspect").

    "par = 1.0" doesn't even do anything, normally. I actually took out the "par" option in my latest versions, since in the extremely rare cases where it's useful, it's only so on a per-video basis.

    You don't say what kind of TiVo you have?
     
  8. Soapm

    Soapm Active Member

    1,564
    0
    May 9, 2007
    So close,...
    I have two, a TivoHD and a premier.

    Wow, now this is really weird to me but you're absolutely right, I removed the par = 1.0 and it still fills the screen. However, pushing the window button rotates me through panel, zoom and full but it doesn't change the appearance on the screen like it normally does but I left it in panel per your advice.

    Why I say it's weird is that everything is back to the way it initially was yet it seems to be acceptable at this point. There is still noticeable cropping at the top and bottom but the picture fills my 16:9 CRT and the people aren't distorted ie.. tall and skinny or short and fat so I guess it kind of fixed itself along the way.

    This is the TV I have http://www.amazon.com/JVC-AV-30W475-IArt-30-Widescreen/dp/B0002V242E and I continually have troubles with aspect ratio's. Is there an optimal setting I should be using? This is my config file. If possible I would like to have 4:3 shows appear square in the middle of the screen with black bars on the left and right. This way I know the aspect ratio is correct and that's I'm not losing the top and bottom due to cropping.

    Code:
    [_tivo_SD]
    video_pct = 0
    audio_fr = 48000
    tivo_mak = XXXXXXXXXX
    video_fps = 29.97
    tivo_password = XXXXXXX
    video_br = 4096K
    optres = true
    height = 480
    ffmpeg_pram = -threads 2
    width = 544
    max_audio_br = 448k
    tivo_username = XXXXXXXXX
    bufsize = 1024K
    audio_br = 384K
    
    [Server]
    tivo_password = XXXXXXXXXXX
    tivo_mak = XXXXXXXXXXX
    ffmpeg = /usr/local/bin/ffmpeg
    ffmpeg_pram = -threads 2
    tivodecode = /usr/local/bin/tivodecode
    tivo_mind = mind.tivo.com:8181
    zeroconf = True
    tdcat = /usr/local/bin/tdcat
    beacon = 192.168.0.255
    togo_path = /video/zfromtivo
    tivo_username = XXXXXXXXXXX
    port = 9032
    
    [_tivo_HD]
    video_pct = 0
    ffmpeg_pram = -threads 2
    tivo_mak = XXXXXXXXXXX
    audio_fr = 48000
    video_br = 16384K
    optres = True
    height = 480
    width = 720
    max_audio_br = 448k
    max_video_br = 17408K
    tivo_password = XXXXXXXXXXXX
    tivo_username = XXXXXXXXXXXX
    bufsize = 4096k
    audio_br = 448k
    
    [Lenny]
    force_alpha = True
    type = video
    path = /video
    
     
  9. wmcbrine

    wmcbrine Ziphead

    10,363
    22
    Aug 2, 2003
    These options are all the default values, so there's no need to set them. Also, the whole _tivo_SD section does nothing if you don't have an SD TiVo.

    There's no need to set these redundantly. Just set them under "Server".

    This downrezzes all your HD videos to DVD resolution. Is that really what you want?

    May I suggest:

    Code:
    [Server]
    tivo_password = XXXXXXXXXXX
    tivo_mak = XXXXXXXXXXX
    ffmpeg = /usr/local/bin/ffmpeg
    ffmpeg_pram = -threads 2
    tivodecode = /usr/local/bin/tivodecode
    tdcat = /usr/local/bin/tdcat
    beacon = 192.168.0.255
    togo_path = /video/zfromtivo
    tivo_username = XXXXXXXXXXX
    
    [Lenny]
    force_alpha = True
    type = video
    path = /video
    Additionally, you don't need to specify the locations of the binaries if they're in the PATH, unless there are other versions earlier in the PATH that you don't want. And you shouldn't have to specify the beacon address in most cases, either.
     
  10. Soapm

    Soapm Active Member

    1,564
    0
    May 9, 2007
    So close,...
    Good thing I got one parameter right, ffmpeg_pram = -threads 2... ROFL...


    Yes, I "downrezzes" since I have all CRT's in the house and would go down further if I better understood the settings. I figure this speeds up the transfer.
     
  11. wmcbrine

    wmcbrine Ziphead

    10,363
    22
    Aug 2, 2003
    Ah. You might've mentioned that earlier... I assume these are 4:3 sets, like most CRTs? And, you have "TV Aspect Ratio" set to 4:3? That would explain why the Aspect button doesn't work on your SD video.
     
  12. Soapm

    Soapm Active Member

    1,564
    0
    May 9, 2007
    So close,...

    That's what confuses me, this is the set http://www.amazon.com/JVC-AV-30W475-IArt-30-Widescreen/dp/B0002V242E

    http://resources.jvc.com/Resources/00/00/94/YA246ien.pdf page 46

    It says it's 16x9 but because it's a CRT I think it's taking the 4:3 and stretching it. I don't believe 16x9 was broadcast back in the CRT days but I could easily be wrong. So my confusion is figuring out what it wants to be fed???

    Does it want 4:3 and let it stretch it until the aspect ratio looks awful (it really does) or can I feed it 16x9 which should look better but for some reason gets the crap cropped out of it.

    I would appreciate one of you experts taking a look at the specs on page 46 and recommend both Tivo and pyTivo settings. I am stumped trying to get a consistent decent looking picture.
     
  13. wkearney99

    wkearney99 Bill Kearney

    1,919
    3
    Dec 5, 2003
    Bethesda,...
    Ditch the TV and get a new one. The reviews on Amazon hint at what that set can't really do, which is anything beyond 480 video. Even a cheap Vizio or a Westinghouse would do a FAR better job. The money you'd save on powering that beast for a year would probably pay for a new LCD TV.
     
  14. Soapm

    Soapm Active Member

    1,564
    0
    May 9, 2007
    So close,...
    Thanks for the advice but I was just laid off the old job... Offshoring... I doubt if I'll be buying anything soon and this one I got free though I can see why they were tossing it out. My 36" GE just died so I was hoping this one would get me by until I get back on my feet.
     
  15. wmcbrine

    wmcbrine Ziphead

    10,363
    22
    Aug 2, 2003
    Interesting device. Um... you may have to switch the TV's aspect instead of the TiVo's. "Cinema" is the only mode I see that crops anything (although there's probably always some overscan). You'd only want to use that for letterboxed 4:3 material (like the "Zoom" mode on the TiVo). "Regular" and "Full" should be useful more often. (Personally I would never use "Panorama".)

    ISTR some issues with 16:9 in 480i on the TiVo, but I'll have to get back to you on that.
     
  16. Mar 2, 2013 #4136 of 5682
    BB3

    BB3 New Member

    10
    0
    Nov 28, 2006
    NW Florida
    Well, I try very hard not to bother those of you that provide these marvelous tools for free but I've reached the hair pulling stage and I haven't that much left. I've been using pytivo for several years exclusively to transfer video from my PC to my Tivo(s). Never had any major problem and the minor ones ere easily resolved reading the forums etc. Sadly, it became necessary to format and reinstall XP on my ancient laptop I use as a media server. That went surprisingly well but now pytivo will not work. Or at least transfers to the Tivos won't work. Oddly, pulling files from the Tivo to the computer does work(and I'd never even tried to do that before). I've uninstalled and carefully reinstalled using the latest wmcbrine files(several times), lastest ffmpeg and latest tivodecode. I can connect to the web configuration at localhost:9032 . I can pull files from the Tivos. I can see MyVideos(and the files therein) on the Tivo Now Playing screen but when I try to transfer a file to the Tivo nothing happens but a blank blue screen. I have the sense this is some sort of configuration error but I'm darned if I can figure it out.

    The debug log shows this:

    2013-03-02 01:02:01,490 INFO pyTivo: 192.168.1.131 [02/Mar/2013 01:02:01] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg HTTP/1.1" 200 -
    2013-03-02 01:02:01,536 INFO pyTivo: 192.168.1.131 [02/Mar/2013 01:02:01] "GET /TiVoConnect?Command=QueryContainer&Container=My%20Videos&SortOrder=!CaptureDate&ItemCount=8&Filter=x-tivo-container%2Ftivo-videos,x-tivo-container%2Ffolder,video%2Fx-tivo-mpeg,video%2F* HTTP/1.1" 200 -
    2013-03-02 01:02:03,645 INFO pyTivo: 192.168.1.131 [02/Mar/2013 01:02:03] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg HTTP/1.1" 200 -
    2013-03-02 01:02:03,645 INFO pyTivo: 192.168.1.131 [02/Mar/2013 01:02:03] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg HTTP/1.1" 200 -
    2013-03-02 01:02:03,707 INFO pyTivo: 192.168.1.131 [02/Mar/2013 01:02:03] "GET /TiVoConnect?Command=QueryContainer&Container=My%20Videos%2FTV&SortOrder=!CaptureDate&ItemCount=8&AnchorItem=%2FMy%2520Videos%2FTV%2FPrimeval.New.World.S01E09.HDTV.x264-2HD.mp4&AnchorOffset=-5&Filter=x-tivo-container%2Ftivo-videos,x-tivo-container%2Ffolder,video%2Fx-tivo-mpeg,video%2F* HTTP/1.1" 200 -
    2013-03-02 01:02:04,380 INFO pyTivo: 192.168.1.131 [02/Mar/2013 01:02:04] "GET /TiVoConnect?Command=QueryContainer&Container=My%20Videos%2FTV&SortOrder=!CaptureDate&ItemCount=8&Filter=x-tivo-container%2Ftivo-videos,x-tivo-container%2Ffolder,video%2Fx-tivo-mpeg,video%2F* HTTP/1.1" 200 -
    2013-03-02 01:02:07,270 INFO pyTivo: 192.168.1.131 [02/Mar/2013 01:02:07] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg HTTP/1.1" 200 -
    2013-03-02 01:02:07,365 ERROR pyTivo: Exception during request from ('192.168.1.131', 2464)
    Traceback (most recent call last):
    File "C:\Python26\lib\SocketServer.py", line 560, in process_request_thread
    self.finish_request(request, client_address)
    File "C:\Python26\lib\SocketServer.py", line 322, in finish_request
    self.RequestHandlerClass(request, client_address, self)
    File "C:\pyTivo\httpserver.py", line 85, in __init__
    client_address, server)
    File "C:\Python26\lib\SocketServer.py", line 617, in __init__
    self.handle()
    File "C:\Python26\lib\BaseHTTPServer.py", line 329, in handle
    self.handle_one_request()
    File "C:\Python26\lib\BaseHTTPServer.py", line 323, in handle_one_request
    method()
    File "C:\pyTivo\httpserver.py", line 118, in do_GET
    self.handle_query(query, tsn)
    File "C:\pyTivo\httpserver.py", line 171, in handle_query
    if self.do_command(query, command, basepath, tsn):
    File "C:\pyTivo\httpserver.py", line 150, in do_command
    method(self, query)
    File "C:\pyTivo\plugins\video\video.py", line 441, in QueryContainer
    video['valid'] = transcode.supported_format(f.name)
    File "C:\pyTivo\plugins\video\transcode.py", line 1041, in supported_format
    if video_info(inFile)['Supported']:
    File "C:\pyTivo\plugins\video\transcode.py", line 807, in video_info
    limit = config.getFFmpegWait()
    File "C:\pyTivo\config.py", line 245, in getFFmpegWait
    return max(int(float(config.get('Server', 'ffmpeg_wait'))), 1)
    ValueError: empty string for float()

    And this is my pytivo.conf file:

    [loggers]
    keys = root
    path =
    precache =
    type =


    [_tivo_SD]
    video_pct =
    audio_fr =
    copy_ts =
    bufsize =
    audio_ch =
    ffmpeg_pram =
    video_br =
    optres =
    audio_lang =
    ffmpeg_tmpl =
    width =
    max_audio_br =
    max_video_br =
    audio_codec =
    video_fps =
    height =
    audio_br =

    [handler_console]
    formatter = basicform
    args = (sys.stdout,)
    path =
    precache =
    type =
    class = StreamHandler

    [My Videos]
    precache =
    type = video
    path = E:\XXXXXXX


    [handlers]
    keys = console,rotfile
    path =
    precache =
    type =

    [Server]
    tivo_password = XXXXXX
    par =
    tivo_mak = XXXXXXXXXX
    ffmpeg = C:\pyTivo\bin\ffmpeg.exe
    temp = C:\Documents and Settings\All Users\Documents\pyTivo
    ffmpeg_pram =
    ffmpeg_wait =
    ffmpeg_tmpl =
    beacon = 192.168.1.255
    togo_path = E:\XXXXXXX
    debug =
    tivo_username = XXX@XXXXX.com
    guid =
    port = 9032

    [formatter_basicform]
    format = %(asctime)s %(levelname)-5s %(name)s: %(message)s
    path =
    precache =
    type =

    [handler_rotfile]
    formatter = basicform
    args = ('C:\Documents and Settings\All Users\Documents\pyTivo\debug.log', 'a', 10485760, 5)
    path =
    precache =
    type =
    class = handlers.RotatingFileHandler

    [_tivo_HD]
    video_pct =
    audio_fr =
    copy_ts =
    bufsize =
    audio_ch =
    video_fps =
    ffmpeg_pram =
    video_br =
    optres =
    height =
    ffmpeg_tmpl =
    width =
    audio_codec =
    max_audio_br =
    audio_br =
    audio_lang =
    max_video_br =

    [logger_root]
    handlers = console,rotfile
    level = DEBUG
    path =
    precache =
    type =

    [formatters]
    keys = basicform
    path =
    precache =
    type =

    I typically run pytivo as a service but switched to console to get the debug logs. doesn't seem to do anything different though.

    Please help. My sanity is in jeopardy. Thanks again for the excellent tool and any assistance you can provide.

    BB3
     
  17. Mar 2, 2013 #4137 of 5682
    lpwcomp

    lpwcomp Active Member

    8,075
    2
    May 6, 2002
    John's...
    Remove most of that uh, stuff, from your config file and make it look like this:
    Code:
    [Server]
    tivo_password = XXXXXX
    tivo_mak = XXXXXXXXXX
    togo_path = E:\XXXXXXX
    tivo_username = [email]XXX@XXXXX.com[/email]
    
    [My Videos]
    type = video
    path = E:\XXXXXXX
    With the proper values for the fields, of course. Do you really have a folder on your E drive named XXXXXXX?
     
  18. Mar 2, 2013 #4138 of 5682
    wmcbrine

    wmcbrine Ziphead

    10,363
    22
    Aug 2, 2003
    Well, he might also want to leave in the log stuff. But yeah, all the "option = <blank>" lines are unnecessary, and in the case of the "ffmpeg_wait = <blank>" line, it's what's causing the error. I may need to make the parsing more robust there, because pyTivo can handle blanks in some other cases. But there's no reason to have those lines in there.

    So:

    Code:
    [loggers]
    keys = root
    
    [handler_console]
    formatter = basicform
    args = (sys.stdout,)
    class = StreamHandler
    
    [My Videos]
    type = video
    path = E:\XXXXXXX
    
    [handlers]
    keys = console,rotfile
    
    [Server]
    tivo_password = XXXXXX
    tivo_mak = XXXXXXXXXX
    temp = C:\Documents and Settings\All Users\Documents\pyTivo
    beacon = 192.168.1.255
    togo_path = E:\XXXXXXX
    tivo_username = XXX@XXXXX.com
    
    [formatter_basicform]
    format = %(asctime)s %(levelname)-5s %(name)s: %(message)s
    
    [handler_rotfile]
    formatter = basicform
    args = ('C:\Documents and Settings\All Users\Documents\pyTivo\debug.log', 'a', 10485760, 5)
    class = handlers.RotatingFileHandler
    
    [logger_root]
    handlers = console,rotfile
    level = DEBUG
    
    [formatters]
    keys = basicform
    I also took out "port" and "ffmpeg" because they were set to the default values. You probably don't need "beacon", either, but that depends on your network(s).
     
  19. Mar 3, 2013 #4139 of 5682
    BB3

    BB3 New Member

    10
    0
    Nov 28, 2006
    NW Florida
    Gentlemen, your genius is reaffirmed. Works like a charm. Thank you so much.
     
  20. Mar 3, 2013 #4140 of 5682
    dianebrat

    dianebrat I refuse to accept your reality TCF Club

    10,114
    73
    Jul 6, 2002
    boston'ish
    I know it's been said before, but I'll say it again, THANK YOU!
    I just went through a rebuild, and after pulling all my shows down I finally took the plunge into pytivo to start pushing them back, so far, no issues, easy instructions, even for someone like me with only basic python knowledge, the tips have been great.
     

Share This Page