Java port of TivoDecode

Discussion in 'Developers Corner' started by fflewddur, Sep 6, 2015.

  1. Sep 27, 2015 #81 of 154
    PaulS

    PaulS Active Member

    780
    38
    Sep 16, 2002
    Southern NH
    Sounds like they converted to MPEG4/h.264 (from the former standard bandwidth hungry MPEG2) for the bandwidth savings. This will be a common thing in the near future. I believe Comcast has indicated that they will be doing this conversion this year.

    I had some Aussies/NZ folks give me samples of this stuff, and tivodecode 0.4.4 seemed to handle it without issue.
     
  2. Sep 27, 2015 #82 of 154
    Allanon

    Allanon Active Member

    911
    153
    Nov 2, 2005
    I'm using tivodecode 0.3pre4, where can I get a Windows binary file of version 0.4.4? I don't have a compiler installed on my computer.
     
  3. Sep 27, 2015 #83 of 154
    moyekj

    moyekj Well-Known Member

    12,167
    816
    Jan 23, 2006
    Mission...
    Your problem is you are downloading in PS container. You need to switch to TS container downloads and then it should be fine using tivolibre to decrypt.
     
  4. Sep 27, 2015 #84 of 154
    Allanon

    Allanon Active Member

    911
    153
    Nov 2, 2005
    You were right, both tivodecode and tivo-libre decode the file when downloaded using TS container. Thanks!
     
  5. Sep 27, 2015 #85 of 154
    PaulS

    PaulS Active Member

    780
    38
    Sep 16, 2002
    Southern NH
    Wait... tivolibre should be able to detect and decode both TS and PS. Am I incorrect in that assumption ?
     
  6. Sep 27, 2015 #86 of 154
    moyekj

    moyekj Well-Known Member

    12,167
    816
    Jan 23, 2006
    Mission...
    tivolibre can decrypt either TS or PS containers. But recordings from H.264 channels from cable MUST be downloaded using TS container or you just get audio stream without video stream. That was Allanon's issue.
     
  7. Sep 27, 2015 #87 of 154
    PaulS

    PaulS Active Member

    780
    38
    Sep 16, 2002
    Southern NH
    Of course you're right. I'd totally forgotten that. :)
     
  8. Oct 25, 2015 #88 of 154
    gemann

    gemann New Member

    3
    0
    Aug 21, 2015
    I have an audio issue with decoding .TiVo files from certain TV channels only. It appears the audio is mixed down using only the back channels, the audio from the front and center channels is dropped. I downloaded the .TiVo file in the TS format and the PS format with the same results and decoded using the latest kmttg/tivolibre.

    I have uploaded a sample .TiVo file for debugging purposes, but I can't post a link here yet since my post count is too low. Please PM me for the link to the file and the associated MAK.

    I would really appreciate it if you could take a look at what is going on here!
     
  9. Oct 25, 2015 #89 of 154
    fflewddur

    fflewddur R&D

    169
    3
    Jul 20, 2015
    Seattle, WA
    Sure thing, PM sent.
     
  10. Oct 25, 2015 #90 of 154
    fflewddur

    fflewddur R&D

    169
    3
    Jul 20, 2015
    Seattle, WA
    I think the problem is with the file itself. I tested it with the TiVo-provided DLL, and it has the same audio issues. I also checked TivoLibre's output against the TiVo DLL, and they're bit-for-bit copies of one another. The file reports a single AC3 audio stream, exactly as it should, but it appears to be missing the front and center channels. Are those channels present when you play it on your TiVo? Does this happen with all recordings from certain channels, or do some recordings from those channels work as expected?
     
  11. Oct 25, 2015 #91 of 154
    gemann

    gemann New Member

    3
    0
    Aug 21, 2015
    Yes those recordings play back fine on the TiVo itself. It appears to happen with all the recordings from this particular channel (I record three different shows). Recordings from other channels appear to convert ok.

    So this happens on the TiVo end during the copy?
     
  12. Oct 25, 2015 #92 of 154
    fflewddur

    fflewddur R&D

    169
    3
    Jul 20, 2015
    Seattle, WA
    That's my guess at this point. The fact that TiVo Desktop decodes it exactly like TivoLibre suggests the problem isn't with the decoding process. It could be a problem with how the TiVo software encodes certain video formats, which your provider may only use on certain channels. I'm going to try recording the same channel as this clip to see if I can reproduce the problem with my own setup.
     
  13. Oct 28, 2015 #93 of 154
    He'sDeadJim

    He'sDeadJim New Member

    17
    0
    Apr 24, 2015
    I have a desktop and a laptop computer. Both have Win 7, kmttg v2.0u, and the current Java version. As far as I can tell kmttg has the same configuration on both.

    I'm getting odd behavior out of tivolibre. I've downloaded (in .ts) the same programs to both computers, but the laptop generates .mpg files while the desktop gives .ts files. Since I use VLC I can watch either just as easily, so this is just curiosity I guess.

    The only difference I've found is that when the download starts on the desktop the tivolibre line in the status window shows it will output an .mpg file. But after the download finishes and the decode begins the output switches to a .ts file.

    I've been married long enough to know everything is my fault, so any tips on this would be appreciated.

    Bob
     
  14. Oct 28, 2015 #94 of 154
    moyekj

    moyekj Well-Known Member

    12,167
    816
    Jan 23, 2006
    Mission...
    You probably have TS downloads set for kmttg on one computer and not set on the other. The setting is under:
    Configure--Program Options--Download TiVo files in Transport Stream format
     
  15. Oct 28, 2015 #95 of 154
    He'sDeadJim

    He'sDeadJim New Member

    17
    0
    Apr 24, 2015
    They are both set for .ts format, and have been for some time.
     
  16. Oct 30, 2015 #96 of 154
    mackworth

    mackworth cTiVo Developer

    97
    3
    Jul 31, 2006
    So, (he asked hesitantly, but hopefully) how can we get these fixes backported into tivodecode-ng?
     
  17. Oct 30, 2015 #97 of 154
    PaulS

    PaulS Active Member

    780
    38
    Sep 16, 2002
    Southern NH
    That wouldn't be the first question I'd ask. I'd be asking if the Java implementation had comparable performance to the C++ tivodecode-ng codebase.

    If the two implementations were comparable (or Java was more performant), then I really don't see the need for the backport. tivolibre removes a whole lot of platform specific (Windows, Linux, macOS) build and release headaches that Kevin and William have to deal with purely based on Java's portability.

    Just asking... why is tivodecode-ng important to your workflow ? How does Java + tivolibre fall short ?
     
  18. Oct 30, 2015 #98 of 154
    moyekj

    moyekj Well-Known Member

    12,167
    816
    Jan 23, 2006
    Mission...
    Compiled C/C++ code is almost always faster than any scripting or semi-scripting language, so ported to tivodecode-ng would no doubt be faster than Java. Having said that the difference is not that dramatic from my experience and tivolibre is plenty fast enough as is and avoids the hassle of trying to compile for different platforms. William might find a port to python more useful than a port to C/C++. I don't think either way porting would be very trivial since I believe Todd used some 3rd party packages as part of tivolibre which means potentially porting more than just Todd's code.
     
  19. Oct 30, 2015 #99 of 154
    wmcbrine

    wmcbrine Well-Known Mumbler

    11,704
    813
    Aug 2, 2003
    I'm considering Adderall.
     
  20. fflewddur

    fflewddur R&D

    169
    3
    Jul 20, 2015
    Seattle, WA
    A C++ port would certainly be possible, but I refactored enough of the code that I'm not sure backporting to the existing tivodecode-ng framework would be particularly easy. That said, the only 3rd-party requirements in TivoLibre are for command-line parsing and logging; nothing related to the video processing/decoding depends on anything that C++ can't easily do.

    The better question really is: why? The Java version is plenty fast enough to run in real-time. It uses about twice as much CPU time as the C++ version, but the total runtime is essentially identical because decoding large files is IO-bound, not CPU-bound. Even my SSD can't load a large video faster than my CPU can handle it. I've profiled it, and the only spot that would even benefit from further optimization is the Turing cypher implementation; nothing else in TivoLibre gets called enough to have a significant impact on the runtime. I've done what I can with that, but if there are any expert Java programmers reading, please, submit a PR on https://github.com/fflewddur/quick-turing and help us out :)
     

Share This Page