VideoHelp Forum
+ Reply to Thread
Results 1 to 13 of 13
Thread
  1. Hey guys, I was hoping to get some help on an issue I have. I have a TS file I recorded a while back at 1080i with 5.1 Dolby audio (I double checked this in a couple different programs). I ran it through an Avisynth script

    video="input.ts"
    DirectShowSource(video, fps=29.97, convertfps=true)
    Load_Stdcall_plugin("I:\yadif17\yadif.dll")
    Yadif(Mode=1)
    SelectEven()
    TDecimate()

    which gives me 23.976 fps video and matching audio. The only problem is that my audio is stereo when output to my editing software. Is there any way to push my 5.1 audio through Avisynth instead of stereo?
    Quote Quote  
  2. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    DirectShowSource() is dependent on your directshow configuration . You probably have a stereo downmix somewhere configured. Fix your decoder (e.g if it's lav or ffdshow, make sure the audio configuration isn't set to stereo)

    If you add

    Info()

    To the script, preview in vdub or avspmod, does it report stereo ? If it's 6ch , then however you got from avs script to your editing software is the problem, make sure you don't have stereo downmix there



    Alternatively you can load the audio separately, or with different source filter

    Code:
    video="input.ts"
    Load_Stdcall_plugin("I:\yadif17\yadif.dll")
    DirectShowSource(video, fps=29.97, convertfps=true, audio=false)
    Yadif(Mode=1)
    SelectEven()
    TDecimate()
    vid=last
    
    aud=FFAudioSource(video)
    
    AudioDub(vid,aud)
    This requires ffms2 (external plugin , not native with avisynth install)
    https://code.google.com/p/ffmpegsource/
    Quote Quote  
  3. Why don't you just keep the original 5.1 (AC3?) audio. Mux it into your final file.
    Quote Quote  
  4. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Also, for that script you can use Yadif(mode=0, order=1) and remove SelectEven() . Chances are it should be order=1, because almost all HD content is TFF

    And are you sure this source should be deinterlaced, not field matched ?



    Originally Posted by jagabo View Post
    Why don't you just keep the original 5.1 (AC3?) audio. Mux it into your final file.
    That's a better idea
    Quote Quote  
  5. Why don't you just keep the original 5.1 (AC3?) audio. Mux it into your final file.
    I tried that, and when I mux back together I get audio sync issues. When it goes through Avisynth, the audio is in sync, but stereo.

    I tried the ffms2 plugin, and I get an error in FFMPEG and VirtualDub saying

    Audio format change detected. This is currently unsupported. Channels: 2 --> 6; sample rate 48000; sample format unknown --> unknown
    (I: TS Files\input.avs, line 8

    video="Battle Los Angeles.ts"
    DirectShowSource(video, fps=29.97, convertfps=true)
    Load_Stdcall_plugin("I:\yadif17\yadif.dll")
    Yadif(Mode=1)
    SelectEven()
    TDecimate()

    aud=FFAudioSource("Battle Los Angeles.ts")

    AudioDub(video,aud)
    Quote Quote  
  6. I don't think VirtualDub can handle six channel audio.

    <edit>
    Looks like I was wrong. I just tested it and it worked.
    </edit>
    Last edited by jagabo; 19th Apr 2014 at 18:47.
    Quote Quote  
  7. I'll tinker some, and see what I can come up with.
    Quote Quote  
  8. By the way, in what way was the audio sync wrong when you muxed the original AC3 audio with the new video? If it was just shifted earlier or later you can fix that in the muxer by adding a delay (negative delay = advance).
    Quote Quote  
  9. OK, I guess I solved one problem. I decided to start from scratch and re-create my avs file. I typed it in exactly like my first one and saved it. When I opened it and tried to convert, it worked perfectly...??? I guess I typed something a little wrong in the first one.
    Quote Quote  
  10. By the way, in what way was the audio sync wrong when you muxed the original AC3 audio with the new video? If it was just shifted earlier or later you can fix that in the muxer by adding a delay (negative delay = advance).
    The audio was slightly ahead of the video. It didn't get progressively worse, just off a bit. How, and where, should I add a delay?
    Quote Quote  
  11. Originally Posted by Mr_Flintstone View Post
    The audio was slightly ahead of the video. It didn't get progressively worse, just off a bit. How, and where, should I add a delay?
    What container is your final product? A lot of muxers have an audio delay option. I usually use MMG (part of MkvToolnix) to make MKV files. You can use VirtualDub to mux AVI files. MMG example:

    Name:  mmg.png
Views: 176
Size:  58.7 KB
    Last edited by jagabo; 19th Apr 2014 at 20:44.
    Quote Quote  
  12. What container is your final product? A lot of muxers have an audio delay option. I usually use MMG (part of MkvToolnix) to make MKV files. You can use VirtualDub to mux AVI files. MMG example:
    Sorry, I guess I should have said what I intended to do. I had been converting to DVD MPEG2 with FFMPEG, demuxing and burning DVDs with GUI4DVDAUTHOR. I've since found that HCENC gives better results producing M2V files. I was hoping to use that and the original AC3 audio (that was giving me the audio sync issue) and burn a DVD.
    Quote Quote  
  13. ffmpeg can add an audio delay when encoding or muxing:
    http://howto-pages.org/ffmpeg/#delay
    Quote Quote