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 11, 2009 #841 of 10609
    AudioNutz

    AudioNutz New Member

    318
    0
    Nov 9, 2008
    That actually fixes them on the Mac, the only trouble is if you actually use the cut mpg file like I do with pyTiVo to be fed back into your TiVo for watching at home.
     
  2. Jun 11, 2009 #842 of 10609
    moyekj

    moyekj Well-Known Member

    11,258
    74
    Jan 23, 2006
    Mission...
    Yes I think that filter makes the filtered mpeg file playback "choppy" on the TiVo from what I recall (probably because of timestamps at every I frame that dvd:tsaf introduces). Is that what you noticed?
    I didn't try playback of the resulting "fixed" mp4 on Tivo yet to see if it also exhibits choppy playback. Playback on PC seems to be OK.

    The intent here is to tie this to the encoding step if one doesn't have VideoRedo available. There would still be option to turn off the filter if you don't want it.
     
  3. Jun 11, 2009 #843 of 10609
    AudioNutz

    AudioNutz New Member

    318
    0
    Nov 9, 2008
    What I see is a little 1 second "pause" in the audio/video every once in a while in the _cut.mpg files. This is very clean in the encoded files. It's not at a regular interval, and it is not near a particular time (like by a commercial)

    Kate,
    If you own a VH license, then there is a command line version of their ffmpeg utility buried in your system. Look for it here: "Macintosh HD > Library > Application Support > Techspansion > vh131ffmpeg"

    You can direct KMTTG to look for FFMPEG in this binary file instead of in the KMTTG folder, or you can copy this binary file to your KMTTG folder and use it there. (If you remove it from this folder, then VH will probably no longer work, so you should copy it if you're going to use it in the KMTTG folder)

    The argument that I use with my VH license looks like this:
    Code:
    # Description (single line, keep short)
    <description>
    VisualHub engine, 320x240 vh131ffmpeg video
    
    # Encode command or script (single line)
    # Known keywords: FFMPEG, MENCODER, PERL, INPUT, OUTPUT, PWD
    <command>
    FFMPEG -y -i INPUT -threads auto -s 320x240 -aspect 320:240 -r 29.97 -vcodec h264 -g 150 -qmin 25 -b 560k -level 13 -loop 1 -sc_threshold 40 -partp4x4 1 -rc_eq blurCplx^(1-qComp) -refs 3 -qmax 51 -maxrate 700k -keyint_min 40 -async 50 -acodec libfaac -ar 48000 -ac 2 -ab 128k OUTPUT
    
    # Encoded output file extension
    <extension>
    mp4
    If you "Cancel" something while VH GUI is doing an encode, you can steal the argument from your console log. (This is how I arrived at this argument)
     
  4. Jun 11, 2009 #844 of 10609
    bkdtv

    bkdtv New Member

    7,902
    0
    Jan 9, 2003
    DC Metro Area
    That eliminated the A/V sync issues for me. It's fast, too.

    I would enable that ("Fix A/V Errors") by default for the encode step, when the user does not have VideoRedo.
     
  5. Jun 11, 2009 #845 of 10609
    moyekj

    moyekj Well-Known Member

    11,258
    74
    Jan 23, 2006
    Mission...
    Good to hear. So the plan is to rename "VRD QS Fix" to "Stream fix" and if VideoRedo is not configured then this option will automatically be enabled and turned on when "encode" is turned on. User can still turn it off if desired at that point. When "encode" is turned off the option will be disabled and turned off automatically. (i.e. it will be closely tied to encode job without VideoRedo configured).

    Then at run time if this is enabled and VideoRedo is not configured it will run the job with name "streamfix" (instead of VideoRedo "qsfix").

    I already have most of the above in place.

    The great thing about this solution is mencoder is readily and freely available on all platforms (and already bundled with windows & Mac installation), so this fits in nicely.

    I'm sure it's not nearly as robust as VideoRedo for fixing glitches, but it's certainly better than nothing at all.
     
  6. Jun 11, 2009 #846 of 10609
    bkdtv

    bkdtv New Member

    7,902
    0
    Jan 9, 2003
    DC Metro Area
    Looks like I spoke too soon again. :(

    I'm still seeing A/V sync issues towards the end of recordings. More specifically, A/V sync become out of sync 16-25 minutes in on my Daily Show recordings.

    Without mencoder, there are A/V sync issues throughout, so this is an improvement...
     
  7. Jun 11, 2009 #847 of 10609
    moyekj

    moyekj Well-Known Member

    11,258
    74
    Jan 23, 2006
    Mission...
    16-25 minutes!!?? Wow even 16-25 seconds would be outrageous. I get annoyed if it's even off my half a second or so. By any chance are you enabling comskip/comcut steps as well? (If so please try without those steps enabled).
     
  8. Jun 11, 2009 #848 of 10609
    bkdtv

    bkdtv New Member

    7,902
    0
    Jan 9, 2003
    DC Metro Area
    To clarify, the A/V loses sync by a 3-4 seconds at some point 16-25 minutes into the program. Once the A/V loses sync, it remains out of sync for the rest of the program.

    Edit: On the second episode of the Daily Show, A/V is out of sync by 15+ seconds by the end of the program.

    I did not use the comcut or comskip steps.
     
  9. Jun 11, 2009 #849 of 10609
    moyekj

    moyekj Well-Known Member

    11,258
    74
    Jan 23, 2006
    Mission...
    Sorry, I completely misread your post and now it's clear what you meant. My testcase was only 5 minutes long (which made it very easy/quick to try out different things to see what helped). I'll try some longer shows as well.
    Out of curiosity, were these handbrake or ffmpeg encodings or both? (I used mostly ff_psp in my testing).
     
  10. Jun 11, 2009 #850 of 10609
    bkdtv

    bkdtv New Member

    7,902
    0
    Jan 9, 2003
    DC Metro Area
    I'm using the ff_ipod_high_res setting.

    Surely there must be a way to eliminate most A/V sync issues without VideoRedo TVSuite. Tomorrow, I think I'll ask around on Doom9.org, Videohelp, and/or Afterdawn.
     
  11. Jun 11, 2009 #851 of 10609
    moyekj

    moyekj Well-Known Member

    11,258
    74
    Jan 23, 2006
    Mission...
    One more thing to check. Is the post-mencoder mpeg file also out of sync around the same points or is it the re-encoding that triggers the A/V sync issue?
     
  12. Jun 12, 2009 #852 of 10609
    bkdtv

    bkdtv New Member

    7,902
    0
    Jan 9, 2003
    DC Metro Area
    All files lost A/V sync on the same scene, although the timecodes are all different (ex: 19:39 for MP4 and 19:51 for the MPG).

    In all cases, the original, unmodified MPG played in sync from start to finish.
     
  13. Jun 12, 2009 #853 of 10609
    moyekj

    moyekj Well-Known Member

    11,258
    74
    Jan 23, 2006
    Mission...
    Just tried a 1 hour SD show and confirmed same problem. The post-mencoder file got way off sync after about 20 minutes through a 1 hour show. (Of course the mp4 file generated was way off too - though there is no point even trying the encode step if the source is already off).
     
  14. Jun 12, 2009 #854 of 10609
    moyekj

    moyekj Well-Known Member

    11,258
    74
    Jan 23, 2006
    Mission...
    bkdtv, another thing to try. Forget about mencoder filter completely. Instead take an existing ffmpeg profile and add -async 1 setting.
    That worked for my 5 minute testcase. I don't have the longer 1hr testcase to try until tonight to see if it works for that one as well...
     
  15. Jun 12, 2009 #855 of 10609
    AudioNutz

    AudioNutz New Member

    318
    0
    Nov 9, 2008
    Hmmm... I've been using -async 50 in my profiles since day 1. I wonder if that's why I haven't seen this issue in my encoded files?
     
  16. Jun 12, 2009 #856 of 10609
    bkdtv

    bkdtv New Member

    7,902
    0
    Jan 9, 2003
    DC Metro Area
    Thanks, I'll give that a try in a few hours.

     
  17. Jun 12, 2009 #857 of 10609
    moyekj

    moyekj Well-Known Member

    11,258
    74
    Jan 23, 2006
    Mission...
    AudioNutz that is interesting - I'm not sure that a setting of 50 makes any sense, but perhaps in your special version of ffmpeg the setting is not audio sampling rate.

    bkdtv, so I say try -async 1 first and if there are still issues then give it an actual audio sampling rate number such as 44100 or 48000. (I don't know if it needs to be the same as the sampling rate of the audio stream or not but sounds like that is not necessary as the rate is adjusted to try and keep sync as needed). Sure sounds like giving a sampling rate number is more robust than using 1...

    EDIT: The other issue is I don't think handbrake has anything equivalent (but that's a secondary issue at this point, and personally I try and use ffmpeg as much as possible anyway).
     
  18. Jun 12, 2009 #858 of 10609
    AudioNutz

    AudioNutz New Member

    318
    0
    Nov 9, 2008
    Correct. When I try the command ffmpeg -h I get:

    -async audio sync method
     
  19. Jun 12, 2009 #859 of 10609
    bkdtv

    bkdtv New Member

    7,902
    0
    Jan 9, 2003
    DC Metro Area
    I modified ff_ipod_high_res.enc as follows:

    Code:
    FFMPEG -y -i INPUT -threads CPU_CORES -vcodec libxvid -async 1 -maxrate 2000k -qmin 3 -qmax 5 -bufsize 5096k -g 300 -acodec libfaac -s 640x480 -ab 128 -b 1500k -f mp4 OUTPUT
    I encoded four videos (3 SD, 1 HD) and all were out of sync.

    I'll try at 48000 next.
     
  20. Jun 12, 2009 #860 of 10609
    AudioNutz

    AudioNutz New Member

    318
    0
    Nov 9, 2008
    That's really strange. If I want to do audio sampling rate, I use -ar 48000
     

Share This Page