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

New program for 1 step TTG downloads, decryption, encoding - kmttg

Discussion in 'TiVo Home Media Features & TiVoToGo' started by moyekj, Mar 15, 2008.

  1. Jun 15, 2009 #881 of 10413
    moyekj

    moyekj Well-Known Member

    11,151
    35
    Jan 23, 2006
    Mission...
    The problem is most likely the space in "Family Room". In the push.py script try setting the tivo name to "Family%20Room" instead to see if that works.
     
  2. Jun 15, 2009 #882 of 10413
    camnito

    camnito New Member

    20
    0
    Apr 1, 2009
    moyekj,

    I was wondering if there is a way to pause/resume a download/decrypt/QSF/Ad Detect/Ad Cut/Encode/Custom (push.py) thread in the middle of the Ad Detect/Ad Cut phase to manually verify the commercial cuts in VRD and modify the VPrj file. I've found that VRD and Comskip are pretty error-prone, and it would be great if I could verify the cut scenes before the ad cut execution step.

    I have tried to breakup the steps into two separate jobs, one for download/decrypt/QSF/Ad Detect and then a new job through the "FILES" for Ad Cut/Encode/Custom job, but obviously that's not as slick as a Pause/Resume function.

    Thanks for the great work, and sorry about getting too greedy...

    Regards,

    Cam
     
  3. Jun 15, 2009 #883 of 10413
    camnito

    camnito New Member

    20
    0
    Apr 1, 2009
    moyekj,

    Thanks for the quick reply. I tried your suggestion and got the following error in KMTTG:

    Traceback (most recent call last):
    File "c:\meTiVo\kmttgj\push.py", line 28, in <module>
    sys.stderr.write("ERROR : " + e)
    TypeError: cannot concatenate 'str' and 'HTTPError' objects
     
  4. Jun 15, 2009 #884 of 10413
    moyekj

    moyekj Well-Known Member

    11,151
    35
    Jan 23, 2006
    Mission...
    OK, try this instead in push.py script:
    tivo = urllib2.quote("Living Room")
     
  5. Jun 15, 2009 #885 of 10413
    camnito

    camnito New Member

    20
    0
    Apr 1, 2009
    Actually, I figured out what I was doing wrong: my container is not "kmttg", it is "My Videos" per the default pyTiVo configuration.

    I like your urllib2.quote function better than manually adding the %20 though, so I changed the url in the push.py script to:

    url = "http://localhost:9032/TiVoConnect?Command=Push&Container=" + urllib2.quote(container) + "&File=/" + file + "&tsn=" + urllib2.quote(tivo)

    Thanks so much for your help. You may want to modify the push.py Wiki to explain the "container" setting for other folks.

    Regards,

    Cam
     
  6. Jun 15, 2009 #886 of 10413
    moyekj

    moyekj Well-Known Member

    11,151
    35
    Jan 23, 2006
    Mission...
    I updated the push.py script and the Wiki documentation to further emphasize the point that the container name in the script and in your pyTivo setup have to match.
     
  7. Jun 16, 2009 #887 of 10413
    moyekj

    moyekj Well-Known Member

    11,151
    35
    Jan 23, 2006
    Mission...
    One possibility is to have an option where following Ad Detect kmttg opens up VRD in GUI mode using the .VPrj file with the detected cuts. Then you can modify the cuts as needed and as soon as you are done and close the GUI kmttg will continue. I'm not 100&#37; sure that can be implemented but is that the kind of thing you are looking for?
     
  8. Jun 16, 2009 #888 of 10413
    Icarus

    Icarus New Member

    360
    0
    Jun 15, 2002
    Upcountry...
    That's sort of what TVAP does.

    I'm ok with the 2-step process, I like the batch processing model, but maybe I did something wrong, but when you run the custom script as part of the 2nd half of the batch (ad-cut, encode, custom), the metaFile argument is wrong.

    It ends up substituted as *.m4v.txt in the encodefile directory instead of *.mpg.txt in the mpg directory, which is where it was left from the first part of the batch processing.

    I'm hoping that using [mpegFile].txt will work around that.

    -David
     
  9. Jun 16, 2009 #889 of 10413
    moyekj

    moyekj Well-Known Member

    11,151
    35
    Jan 23, 2006
    Mission...
    I assume you are breaking things up into 2 steps. In step 1 you have metadata turned on but not encode, thus metaFile is set to .mpg.txt. In step 2 you then have encode and custom enabled so the assumption will be by default that metaFile will be the (encoded file extension).txt. i.e. The assumptions are all built around running everything as 1 step.
    In any case yes I think [mpegFile].txt should work for that scenario.
     
  10. Jun 16, 2009 #890 of 10413
    moyekj

    moyekj Well-Known Member

    11,151
    35
    Jan 23, 2006
    Mission...
    Well looks like AudioNutz had the right setting all along with -async 50 option for ffmpeg. I still don't have a Windows version that generates proper AAC audio with this option set to anything but 1. However, I tried encoding both my short and long trouble testcases on Linux today with a fairly new ffmpeg I built from source and now both testcases ended up perfectly in sync when using the -async 50 option, and the sound is not distorted in any way.

    So I think it's just a question of building a new windows version from source which I will attempt later today.
    (NOTE: Neither the pyTivo or streambaby ffmpeg Windows binaries generate proper AAC audio either last I tried so it could well be some issue with windows builds)
     
  11. Jun 16, 2009 #891 of 10413
    AudioNutz

    AudioNutz New Member

    318
    0
    Nov 9, 2008
    I wish I could take credit... :D Since I used VH before switching to kmttg, I simply continued to use the same arguments that their GUI used.

    Out of curiousity, do you know what the -async 50 means?
     
  12. Jun 16, 2009 #892 of 10413
    bkdtv

    bkdtv New Member

    7,902
    0
    Jan 9, 2003
    DC Metro Area
    Good news about Linux, at least.

    I still can't believe there isn't more discussion about this problem with ffmpeg on Windows. I guess there just aren't many cross platform programs with built-in encoding?
     
  13. Jun 16, 2009 #893 of 10413
    moyekj

    moyekj Well-Known Member

    11,151
    35
    Jan 23, 2006
    Mission...
    I think it just means to allow ffmpeg to vary the audio rate up to a maximum of 50 Hz to stay in sync with video. (Otherwise a fixed rate audio is used in which case it could be that A/V sync can get worse and worse during playback as sync drifts further apart). -async 1 is a special case that would only allow fixing sync right at the start so would only work for cases when there is a constant A/V shift all the way through (or would be enough to fix short clips but not longer clips where the drift eventually becomes noticeable).
     
  14. Jun 16, 2009 #894 of 10413
    moyekj

    moyekj Well-Known Member

    11,151
    35
    Jan 23, 2006
    Mission...
    Building faac library from source on windows is turning out to be problematic - I'm not too surprised that aac encoding seems to be broken in various ffmpeg windows binaries I have tried lately as depending on how the source is "fixed" to compile on windows it may cause issues...
     
  15. Jun 16, 2009 #895 of 10413
    bkdtv

    bkdtv New Member

    7,902
    0
    Jan 9, 2003
    DC Metro Area
    If there is no solution for the aac encoding in ffmpeg under Windows, could you encode audio with another program and remux A/V as a last step?

    You could use ac3to (wiki) in conjunction with the free Nero AAC codec (direct download link). MeGUI uses eac3to and Nero AAC with excellent results.
     
  16. Jun 16, 2009 #896 of 10413
    moyekj

    moyekj Well-Known Member

    11,151
    35
    Jan 23, 2006
    Mission...
    I got faac-1.26 library to compile on windows now (faac-1.28 had too many nagging issues making it difficult to compile). Still several libraries to go before I can attempt ffmpeg build itself...
     
  17. Jun 16, 2009 #897 of 10413
    AudioNutz

    AudioNutz New Member

    318
    0
    Nov 9, 2008
    I don't suppose you boys would consider getting a Mac, and calling it done?
     
  18. Jun 16, 2009 #898 of 10413
    moyekj

    moyekj Well-Known Member

    11,151
    35
    Jan 23, 2006
    Mission...
    It turns out it was a pseudo false alarm. With the particular linux version of ffmpeg, ff_psp profile works great for both my testscases. However I tried 3 other profiles (with AAC & AC3 audio) and those ended up out of sync even for the short 5 minute testcase.

    So while the particular ffmpeg binary does make some difference it doesn't look like -async 50 is a cure all anyway... I'm pretty sure on the Mac the issues would be there too. The problem is the source mpeg2. You may be lucky that you are not getting bad sources to begin with which is why you never had a problem, and in some cases -async 50 may be helping you as well. For me it looks like SD sources from FX are problematic while HD sources from the big 4 networks are fine...

    P.S. The ultimate fix to these problems is VideoRedo which I do have and is only available for Windows - I'm looking for a solution for those that don't have it, but I think I've spent too much time on that already without getting anywhere...
     
  19. Jun 16, 2009 #899 of 10413
    AudioNutz

    AudioNutz New Member

    318
    0
    Nov 9, 2008
    Is there a particular show that I has this sync issue regularly? I'll give it a shot.
     
  20. Jun 16, 2009 #900 of 10413
    moyekj

    moyekj Well-Known Member

    11,151
    35
    Jan 23, 2006
    Mission...
    "Rescue Me" on FX SD and "The O'Reilly Factor" on FNC SD for me. But it's likely very provider specific. I have a short 5 min clip of 116MB that has A/V sync issues for certain ffmpeg encoding profiles that perhaps I can upload somewhere. (Google code only allows <100MB uploads so can't put it there).

    In all cases running them through VRD QS Fix has fixed them and resulting encodes were fine. Note that I've only been recently finding/generating problem testcases as I always have VRD QS fix enabled for my purposes so do not have these issues.
     

Share This Page