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

    Iluvatar New Member

    377
    0
    Jul 22, 2006
    Please try the build from this other buiild.

    I have had this issue extensively before and I created a special build for myself to handle it. It is because in the old ffmpeg builds they use an aac decoder called libfaad but in the new ones they have a built in decoder for aac. However there was a bug that was created that could not handle certain aac streams. So i made this build that specifically uses libfaad again.

    However.....this bug does not exist in the very latest SVN builds so this workaround is not necessary on newer builds, but I dont have an already built compile of that online. Also this does not have any of rdian06's 5.1 mapping fixes. So until he releases his updated ffmpeg you will have to pick and choose which issue you want to live with.
     
  2. KevinSartori

    KevinSartori New Member

    11
    0
    Jul 1, 2004
    Connecticut,...
    Looking forward to this!
     
  3. jcthorne

    jcthorne Active Member

    2,720
    3
    Jan 28, 2002
    Houston
    Gavroche,

    I might suggest you remux your mp4s into a tivo compatible mp4 using ac3 audio instead of aac. The files will then simply copy to the tivohd without transcode by ffmpeg at all. Saves a great deal of space on the tivo as well.
     
  4. Gavroche

    Gavroche New Member

    398
    0
    May 26, 2007
    State of...
    Good thought, but not practical. Due to the size of my library, it would take far too long, even if I somehow automated the process. Almost everything I have is encoded this way, primarily due to the fact that before I started using PyTivo, I used the D-Link DSM-320 and DSM-520 as my media players for streaming video, and this was (at that time) the recommended format by D-Link, which caused me to invest in their "Recommended" product, Nero.

    The reason I started using PyTivo in the first place was because it could transcode almost any file on the fly without the files needing to be in a very specific format, like the D-Link players required.

    No, I think my solution is much easier... just use the old FFMPEG which actually works.

    Thanks for the suggestion though.
     
  5. Gavroche

    Gavroche New Member

    398
    0
    May 26, 2007
    State of...
    I can live without 5.1, though it would certainly be nice. 5.1 support was the issue that got me messing around with this in the first place (everything else was working fine.) One really DOES need the 5.1 if one's Tivo is going to be a true DVD-Player replacement. Because I like the interface on the Tivo so much more than any DVD player I own, I always rip my purchased DVD's to the Tivo to watch them. They never make it into my DVD players at all.

    Still, I'd rather be stuck with Pro Logic II and actually have everything work, than not :) (It still sounds pretty good, just not AS good.)

    I'll try your build that you posted and let you know!
     
  6. Rdian06

    Rdian06 New Member

    463
    0
    Apr 12, 2008
    I think Iluvatar is right. Nero Digital Encoder is one of the few encoders that will produce HE profile AAC (AAC with better compression, aka AAC+). As opposed to the more common LC profile AAC.

    Older ffmpeg used an external GPL library called libfaad to decode all AAC content. However, the ffmpeg developers don't really like external libraries and prefer to have ffmpeg native implementations that can reuse optimized routines from other encoders/decoders. So overtime you see external libraries being replaced with more efficient and better quality native code. This happened with DTS decoding (dca decoder replacing libdca) and Dolby Digital decoding/encoding (AC3 including EAC3 support replacing liba52).

    Now the problem with AAC is that the new native AAC decoder was made the default AAC decoder even though it only handles LC profile AAC whereas libfaad can handle both HE and LC profiles. And as Iluvatar discovered a while back, simply enabling libfaad doesn't override the default. You have to enable libfaad AND disable the AAC decoder to make libfaad the default again.

    I had hoped that enabling libfaad with the native decoder left enabled would route HE profile AAC to libfaad and LC profile AAC to the native decoder, but I suspect what you are seeing is proof that it doesn't work the nice way. I don't have any HE profile AAC samples to test with, but looks like I'll need to grab Nero Digital and produce one. Overall this means I might have to disable the native AAC decoder in my next ffmpeg build and have libfaad do all the work. I was hoping to ditch libfaad altogether like libfaac encoder. The libfaac encoder has been deemd non-free by the ffmepg developers so I can no longer include it in my distributed compiles. At least they're making progress on the native AAC encoder this summer. And I seem to recall someone is working on adding HE profile AAC to the native decoder.

    Gavroche, to verify this issue, please download mediainfo and examine your mp4 files. It should tell you whether your AAC 5.1 audio is LC or HE profile:

    http://mediainfo.sourceforge.net/en/Download
     
  7. Rdian06

    Rdian06 New Member

    463
    0
    Apr 12, 2008
    What really sucks is that I just finished the hack on the native AAC decoder last night to fix the 5.1 channel mapping issue when transcoding to AC3.

    Looks like I'll have to do the same to the libfaad shim now... argh!
     
  8. Rdian06

    Rdian06 New Member

    463
    0
    Apr 12, 2008
    Oh, can't you go into the To Do list and kill the transfer from there?
     
  9. Gavroche

    Gavroche New Member

    398
    0
    May 26, 2007
    State of...
    Actually no.

    You can go into the to-do list and tell Tivo to cancel it, which removes the entry from the to-do list, but it has no other effect. It doesn't cause ffmpeg to stop trying to decode it, and the blue light on my Tivo stays on.

    Anything you try to transfer after that, including known-to-be-working-with-this-version-of-ffmpeg files, go straight to the to-do list.

    It appears that PyTivo will not release the transfer until ffmpeg can correctly decode it.

    Furthermore, after you tell Tivo to cancel it and the entry is removed from the to-do list, when I replace ffmpeg with a working version for these types of files, it starts to transfer the same file that was removed from the to-do list. At this point you can then cancel the transfer.
     
  10. Gavroche

    Gavroche New Member

    398
    0
    May 26, 2007
    State of...
    I hate to be the bringer of bad news, but this tool reports the audio on my "problem" files as profile LC as follows:

    ID : 2
    Format : AAC
    Format/Info : Advanced Audio Codec
    Format version : Version 4
    Format profile : LC
    Format settings, SBR : No
    Codec ID : 40
    Duration : 2h 16mn
    Bit rate mode : Variable
    Bit rate : 320 Kbps
    Maximum bit rate : 341 Kbps
    Channel(s) : 6 channels
    Channel positions : Front: L C R, Rear: L R, LFE
    Sampling rate : 48.0 KHz
    Resolution : 16 bits
    Stream size : 311 MiB (18%)
    Title : English
    Language : English
    Encoded date : UTC 2009-05-05 10:01:23
    Tagged date : UTC 2009-05-05 17:38:45
     
  11. Gavroche

    Gavroche New Member

    398
    0
    May 26, 2007
    State of...
    Tried it, both on one of my mp4 6-channel files that cause the other versions of ffmpeg to barf, and on a long-duration avi file that caused other versions of ffmpeg to just crash with no error messages.

    Both worked fine.

    Thanks!

    (Now if we can just get 6-channel audio!)

    :)
     
  12. Iluvatar

    Iluvatar New Member

    377
    0
    Jul 22, 2006
    rdian06 -

    Ultimately the issue was not an LC vs HE issue. It was purely a bug in ffmpeg that involved an incorrect stream counter that was incrementing from a wrong start point.

    This was resolved as of SVN17856 so any modifications to the compile in regards to using libfaad are not required unless you have found otherwise. As long as you use a very late SVN, libfaad is absolutely not required to fix the bug Gavroche and I were having you can use the native aac decoder 100%. It does not decode HEv2 AAC as you pointed out but I have never ever come across an HEv2 sample (even though i thought that was what the bug represented before, obviously I was wrong).
     
  13. Rdian06

    Rdian06 New Member

    463
    0
    Apr 12, 2008
    That's actually good news. It means that you're seeing a bug in the native AAC decoder instead of the HE AAC issue that I was afraid of. And you said over at the pyTivo forum that Iluvatar's ffmpeg build with the native AAC decoder disabled works for you so I need to see what's changed in the AAC native bits since then. I seem to recall something being fixed along these lines related to time stamp issues, but I'll have to double check.
     
  14. Gavroche

    Gavroche New Member

    398
    0
    May 26, 2007
    State of...
    Yeah, I hate to double-post stuff on two different forums. I've been ping-ponging back and forth between here and there. I'm thinking that since we're all coming to some conclusions that we can help some of the other folks who have posted issues that seem extremely similar.

    I also just want to say that you guys ROCK! As I mentioned over on the other forum... I don't get this level of quality support from stuff that I PAY for!

    I am SO appreciative of all the help!
     
  15. Jun 6, 2009 #2315 of 5683
    Yoav

    Yoav New Member

    1,048
    0
    Jan 12, 2007
    Mostly for wmcbrine, but:
    Someone just reported the following bug in pyTivoX:
    Code:
    ERROR:pyTivo:Exception during request from ('10.10.10.23', 1039)
    Traceback (most recent call last):
     File
    "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/SocketServer.py",
    line 464, in process_request_thread
       self.finish_request(request, client_address)
     File
    "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/SocketServer.py",
    line 254, in finish_request
       self.RequestHandlerClass(request, client_address, self)
     File
    "/Users/yoav/src/pytivox/build/Release/pyTivoX.app/Contents/Resources/pyTivo-wmcbrine/httpserver.py",
    line 57, in __init__
       client_address, server)
     File
    "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/SocketServer.py",
    line 522, in __init__
       self.handle()
     File
    "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/BaseHTTPServer.py",
    line 316, in handle
       self.handle_one_request()
     File
    "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/BaseHTTPServer.py",
    line 310, in handle_one_request
       method()
     File
    "/Users/yoav/src/pytivox/build/Release/pyTivoX.app/Contents/Resources/pyTivo-wmcbrine/httpserver.py",
    line 83, in do_GET
       self.handle_query(query)
     File
    "/Users/yoav/src/pytivox/build/Release/pyTivoX.app/Contents/Resources/pyTivo-wmcbrine/httpserver.py",
    line 133, in handle_query
       method(self, query)
     File
    "/Users/yoav/src/pytivox/build/Release/pyTivoX.app/Contents/Resources/pyTivo-wmcbrine/plugins/video/video.py",
    line 213, in QueryContainer
     File
    "/Users/yoav/src/pytivox/build/Release/pyTivoX.app/Contents/Resources/pyTivo-wmcbrine/plugin.py",
    line 206, in get_files
       if self.recurse_cache.mtime(path) + 300 >= time.time():
    NameError: global name 'time' is not defined
    
    Seems to indicate that time.time() is undefined. Odd that it's only happening for him, but wondering if maybe an 'import time' or somesuch is required (not a python person, so dont know why this would happen).
     
  16. Jun 6, 2009 #2316 of 5683
    wmcbrine

    wmcbrine Ziphead

    10,364
    22
    Aug 2, 2003
    Eek. Yes, "import time" is missing... will fix ASAP.

    The reason no one else has reported it is that you have to be in a non-foldered view to evoke it. I guess few use that.

    Edit: Fix posted.
     
  17. Jun 8, 2009 #2317 of 5683
    bwall23

    bwall23 New Member

    73
    0
    Jun 8, 2009
    Hate to cross post here, but I just posted this on the AVS Forum and don't have enough posts here to post URL's
    h t t p : / / w w w . a v s f o r u m . c o m /avs-vb/showthread.php?p=16610010

    I'm trying to push the REC. 709 Calibration mp4 to my TiVo HD
    h t t p : / / w w w . a v s f o r u m . c o m /avs-vb/showthread.php?t=948496

    First of all, what's your definition of Streaming vs. Downloading (push/pull)? When you stream something, does it end up in your NPL so you can set it to "save until I delete"? If so, I don't see any difference between streaming and download (push/pull).

    I'm using the latest snapshot of mcbrine's pyTiVo and it obviously thinks it's not a TiVo compatible mp4 for some reason as it's converting it w/ffmpeg before pushing it. Either the TiVo HD (v11.0c) doesn't support the mp4 for some reason and pyTiVo knows it or the TiVo HD (v11.0c) does support it and pyTiVo doesn't know it.

    MediaInfo says this about the file
    Code:
    General
    Format                           : MPEG-4
    Format profile                   : JVT
    Codec ID                         : avc1
    File size                        : 73.5 MiB
    Duration                         : 15mn 0s
    Overall bit rate                 : 684 Kbps
    
    Video
    ID                               : 1
    Format                           : AVC
    Format/Info                      : Advanced Video Codec
    Format profile                   : High@L4.1
    Format settings, CABAC           : Yes
    Format settings, ReFrames        : 3 frames
    Codec ID                         : avc1
    Codec ID/Info                    : Advanced Video Coding
    Duration                         : 15mn 0s
    Bit rate mode                    : Variable
    Bit rate                         : 683 Kbps
    Nominal bit rate                 : 16.5 Mbps
    Maximum bit rate                 : 1 415 Kbps
    Width                            : 1 920 pixels
    Height                           : 1 080 pixels
    Display aspect ratio             : 16/9
    Frame rate mode                  : Constant
    Frame rate                       : 23.976 fps
    Resolution                       : 24 bits
    Colorimetry                      : 4:2:0
    Scan type                        : Progressive
    Maybe it's because it has no audio???

    I'm using FFmpeg version SVN-r15216-rdian06-0.96-win32-x86_32 built on Sep 25 2008 23:08:49, gcc: 4.2.4 [Sherpya]

    Relevant (I think) output from pyTiVo and ffmpeg when trying to push it.
    Code:
    DEBUG pyTivo.video.transcode: failed at aKbps
    DEBUG pyTivo.video.transcode: failed at aCodec
    DEBUG pyTivo.video.transcode: failed at aFreq
    DEBUG pyTivo.video.transcode: failed at mapAudio
    Basic_Settings.mp4 is not tivo compatible
    transcoding to tivo model 652 using ffmpeg command:
     ffmpeg.exe
      -i Basic_Settings.mp4
      -vcodec mpeg2video
      -b 16384k
      -maxrate 30000k
      -bufsize 4096k
      -ab 448k
     -ar 48000
      -acodec ac3
      -copyts
      -f vob
     
  18. Jun 8, 2009 #2318 of 5683
    bkdtv

    bkdtv New Member

    7,902
    0
    Jan 9, 2003
    DC Metro Area
    Assuming that you initiated the push transfer with pyTiVo using your web browser, then it is possible that program is seeing it as an incompatible video stream due to the lack of audio. I'll try to test that tonight.
     
  19. Jun 8, 2009 #2319 of 5683
    cherry ghost

    cherry ghost Active Member

    5,277
    5
    Sep 13, 2005
    Chicago
    When I try to push a file, I get


    Do I have to do something in the settings?
     
  20. Jun 9, 2009 #2320 of 5683
    bkdtv

    bkdtv New Member

    7,902
    0
    Jan 9, 2003
    DC Metro Area
    For this "push" functionality to work, you must enter your Tivo.com username and password. In recent versions of pyTiVo, you can do this through pyTiVo web configuration under Global Server Settings. If you have an older version of pyTiVo without the username and password fields in web configuration, you can modify pyTivo.conf as follows:
    Code:
    [Server]
    tivo_username = <tivo.com username>
    tivo_password = <tivo.com password>
    Note videos with non-standard aspect ratios (i.e. non 16:9) will not display correctly when pushed to the TiVo as is. The current TiVo software cannot add black bars to the top and bottom of MP4 videos.
     

Share This Page