VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Results 1 to 19 of 19
Thread
  1. Hello Everyone,

    I do apologize for the length. I just wanted to make sure I included everything that might be needed. I'm in the process of ripping my DVDs/Blu-rays to MKV and for the first time since starting I've started this project I've run into an audio sync issue that I'm completely baffled as to how to fix it. Some information: I have two versions of a particular movie ripped to two mkvs. The first mkv is from the DVD copy that contains a 5.1 AC-3 track. The 2nd MKV is from my blu-ray. Since I don't like the new english dub on the blu-ray. I wanted to add the AC-3 track to the blu-ray MKV. What makes this challenging is:

    A: The AC-3 audio frame rate is different from the video frame rate.

    B. The blu-ray's DTS-HD Master 2.0 track is slightly longer than the AC-3 track (AC-3 = 1:20:18.144 vs. 1:20:28.000 for the DTS-HD)

    C. The blu-ray version of the movie includes some opening logos that were missing from the DVD so the audio starts at the :13 second mark instead of at the very beginning. There is also some additional translation credits that play after the movie's end credits are finished, but fortunately no audio plays during them.

    I was able to extract the AC-3 track from my MKV using mkvcleaver. I then set the time stamp and default duration delay field for the audio to 13000 to account for the 13 seconds at the beginning of the blu-ray. The audio on the muxed mkv does start at the right time and is initially in sync. However, after about 8 minutes the AC-3 track begins to play slightly ahead of the video and continues to drift apart at a slow, but steady rate. The DTS track is perfectly synced with muxed MKV.

    I tried downloading eac3to gui and MeGUI, but I couldn't figure out what I needed to do to fix my issues. I've copied my Mediainfo information that I believe shows all the pertinent information:

    Video
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L4.1
    Format settings : CABAC / 4 Ref Frames
    Format settings, CABAC : Yes
    Format settings, RefFrames : 4 frames
    Codec ID : V_MPEG4/ISO/AVC
    Duration : 1 h 21 min (Note: actual video duration is 1:21:57)
    Bit rate mode : Variable
    Bit rate : 19.9 Mb/s
    Maximum bit rate : 35.0 Mb/s
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Constant
    Frame rate : 23.976 (24000/1001) FPS

    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 0.401
    Stream size : 11.4 GiB (73%)
    Language : English
    Default : No
    Forced : No

    Audio:
    Format : AC-3

    Format/Info : Audio Coding 3
    File size : 221 MiB
    Duration : 1 h 20 min
    Overall bit rate mode : Constant
    Overall bit rate : 384 kb/s

    Audio
    Format : AC-3
    Format/Info : Audio Coding 3
    Duration : 1 h 20 min
    Bit rate mode : Constant
    Bit rate : 384 kb/s
    Channel(s) : 6 channels
    Channel positions : Front: L C R, Side: L R, LFE
    Sampling rate : 48.0 kHz
    Frame rate : 31.250 FPS (1536 SPF)
    Bit depth : 16 bits
    Compression mode : Lossy
    Stream size : 221 MiB (100%)
    Service kind : Complete Main

    Audio
    Format : DTS
    Format/Info : Digital Theater Systems
    Format profile : MA / Core

    Codec ID : A_DTS
    Duration : 1 h 20 min
    Bit rate mode : Variable / Constant
    Bit rate : 2 131 kb/s / 1 509 kb/s
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 48.0 kHz
    Frame rate : 93.750 FPS (512 SPF)
    Bit depth : 24 bits
    Compression mode : Lossless / Lossy
    Stream size : 1.20 GiB (8%)
    Title : Stereo
    Language : English
    Default : No
    Forced : No

    Is it even possible to get the AC-3 to work correctly? If so, can someone explain the steps for fixing this issue (screenshots, if possible would be great since I have no experience fixing audio sync issues outside of using mkvtoolnix)? Any help would be greatly appreciated.
    Last edited by Revec; 7th Jun 2018 at 17:20. Reason: Editing to explain that the AC-3 track drifts ahead of the video at a slow, but steady rate.
    Quote Quote  
  2. You need to open both tracks in audio editor like audacity and actually see what is the real duration of audio tracks and to check why and where it starts to drift. You can't rely on Mediainfo to show you that.

    And don't compare audio frame rate that Mediainfo is showing you. AC-3 audio frame length is always 32 ms and it doesn't have anything to do with video frame rate.
    Quote Quote  
  3. AC-3 audio frame length is always 32 ms
    32ms for 48kHz
    ~34,83ms for 44.1kHz
    48ms for 32kHz
    yes, the format does not only support 48kHz.
    see: https://tools.ietf.org/html/rfc4184

    That said, that I agree audio serious syncing should be done while looking at the wave fronts inside an NLE, otherwise it's normally only hoping the all cuts and delays during master and processing were same,...

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  4. The track times are actually from Audacity. I downloaded it yesterday.

    I listened to both the DTS Master-HD track (which is perfectly synced) and the AC-3 track for my muxed mkv in audacity and used time shift to account for the 13 seconds of silence at the beginning of the AC-3 track. The first time I noticed that the AC-3 track was very slightly ahead of the DTS Master-HD track was at the 8:15 mark when the first line of dialog for the scene is spoken. I then went into VLC and confirmed that the AC-3 track very slight ahead of the video too. Continuing on, I discovered that the AC-3 track continues to drift further apart with it getting further ahead of the DTS-Master HD track at a slow but steady rate. (I'm going to edit my original post to correct this point). When the end credits music starts (which appears after a fade out with no sound making it easy to locate on the audacity graphs), the tracks are at the following times:

    1:16:39.105 (AC-3) 1 hour, 16 minutes, 39 seconds, 105 miliseconds
    1:16:41.280 (DTS) 1 hour, 16 minutes, 41 seconds, 280 milliseconds

    Now that I know for sure that the AC-3 track drifts off at a steady rate, how do I go about correcting this?
    Last edited by Revec; 7th Jun 2018 at 16:58. Reason: Correcting times
    Quote Quote  
  5. Try to assume 24/1 vs 24/1.001 fps factor difference.
    If you want to change sound, with eac3to:
    Code:
    eac3to "INPUT" "OUTPUT" -24.000 -changeTo23.976
    Or in mkvtoolnix GUI set video fps to 24 without changing the audio.

    Afterwards try to find the correct delay and remux again if necessary.


    Originally Posted by Revec View Post
    (AC-3 = 1:20.188 vs. 1:20.28 for the DTS-HD)
    Originally Posted by Revec View Post
    16:39.105 (AC-3)
    16:41.280 (DTS)
    I don't understand your times. Clearly mark hours, minutes, seconds, milliseconds.

    If I assume 16:39.105 is 16 minutes, 39 seconds, 105 milliseconds then 16:39.105 is 999.105 seconds and 16:41.280 is 1001.28 seconds. So not exactly 1000 vs 1001.

    In AviSynth with the factors as calculated instead of the 1000/1001 guess:
    Code:
    v=BlankClip.AssumeFPS(1001280, 1000)
    a=ffaudiosource("your_mkv_file.mkv")
    AudioDub(v, a)
    AssumeFPS(999105, 1000, true)
    ResampleAudio(48000)
    Then encode e.g.:
    Code:
    ffmpeg -i "script.avs" "output.ac3"
    Last edited by sneaker; 7th Jun 2018 at 16:30.
    Quote Quote  
  6. The audio track from the dvd is synced to the dvd video. The framerate for the dvd video is probably not the same as the framerate of the bluray video.
    For a PAL dvd the framerate is 25fps. The framerate for bluray is mostly 23,976 fps.
    The audio from the dvd is synced to the 25fps video and the audio from the bluray is synced to 23,976fps video. This means the audio from the dvd is not in sync with the bluray video.
    Convert the dvd audio from 25fps to 23,976 fps. You can use eac3to to convert the audio. Eac3to -slowdown (convert 25.000 and 24.000 content to 23.976 fps)
    Quote Quote  
  7. The difference between 25 fps and 23,976 fps is huuge, though. 4%. So for 10 minutes of 23.976 fps Blu-Ray video a 25 fps DVD would be 24 seconds ahead!
    Quote Quote  
  8. Originally Posted by Selur View Post
    AC-3 audio frame length is always 32 ms
    32ms for 48kHz
    ~34,83ms for 44.1kHz
    48ms for 32kHz
    yes, the format does not only support 48kHz.
    see: https://tools.ietf.org/html/rfc4184

    That said, that I agree audio serious syncing should be done while looking at the wave fronts inside an NLE, otherwise it's normally only hoping the all cuts and delays during master and processing were same,...

    Cu Selur
    He said his files are from blu-ray and dvd so in this case 48kHz, so you are right that I didn't phrase my reply 100 percent correctly but was your correction with link to ietf really necessary Selur? I know there are 44.1 and 32 kHz but they are not very common today.
    Quote Quote  
  9. Sorry sneaker.

    I can't believe it, the times are wrong in my posts. I thought I checked that when I pasted them from excel. I've gone back and corrected them, but to summarize:

    Audacity shows that the total runtime for the AC-3 track with my preferred version of the dub is 1:20:18.144 long (1 hour, 20 minutes, 18 seconds, 144 millisecond)
    Audacity shows that the total runtime for the sycned DTS-HD track with new dub is 1:20:28.000 long (1 hour 20 minutes, 28 seconds. 0 milliseconds)

    The AC-3 track begins to lose sync at 8:15 (8 minutes, 15 seconds)
    When the end credits music starts (which appears after a fade out with no sound making it easy to locate on the audacity graphs), the tracks are at the following times:

    1:16:39.105 (AC-3) (1 hour, 16 minutes, 39 seconds, 105 miliseconds)
    1:16:41.280 (DTS) (1 hour, 16 minutes, 41 seconds, 280 milliseconds)

    Hereschop: It appears that the video frame rate for the movie was adjusted to 23.976 when the company released it on DVD. If mediainfo is correct:

    Frame rate mode : Variable
    Frame rate : 23.976 (23976/1000) FPS
    Original frame rate : 29.970 (30000/1001) FPS

    How should I proceed?
    Last edited by Revec; 7th Jun 2018 at 17:40.
    Quote Quote  
  10. Originally Posted by Revec View Post
    Frame rate mode : Variable
    Frame rate : 23.976 (23976/1000) FPS
    Original frame rate : 29.970 (30000/1001) FPS

    How should I proceed?
    Try the 24.000 to 23.976 conversion as I explained (or change video fps to 24.0). (My AviSynth script was based on the wrong numbers.)


    Conversions between 23.976 and 29.970 don't affect audio and can be ignored in this context.
    Quote Quote  
  11. I'm feeling very stupid. How do I get eac3to gui to run the audio correction? I've never used it before. I first place my muxed mkv as the input file and while waiting for it load I entered Sneaker's command line exactly as written. The program still said had the Processing info message so I let it run.... for 3 hours. When nothing changed, I decided to click the run cl button and still nothing happens.

    I've included a screenshot showing what I entered in eac3to gui. Is there something else I need to do first? Should I be using the extracted AC-3 file instead of the muxed mkv?
    Image Attached Thumbnails Click image for larger version

Name:	eac3to gui screenshot.png
Views:	75
Size:	49.4 KB
ID:	45849  

    Last edited by Revec; 7th Jun 2018 at 23:15.
    Quote Quote  
  12. My example was for the command-line, not for entering into the GUI. The GUI will fill most of that automatically.

    Image
    [Attachment 45850 - Click to enlarge]

    1. Select the audio track
    2. Select desired output format
    3. Add
    4. Manually enter "-24.000 -changeTo23.976"
    5. RUN CL
    Quote Quote  
  13. I was able to run eac3to with my muxed mkv to change the audio. However, all it did was reverse the audio sync issue. The movie still starts in sync, but now the video gradually gets ahead of the AC-3 track at about the same rate. I also tried using mkvtoolnix to adjust the video to 24p and had similar results. Anything else I can try?
    Quote Quote  
  14. Find a sync point at the beginning and another one at the end. Then use the AviSynth script from post #5.

    Are you sure the movie cuts are the same? Load both in AviSynth and compare using e.g. StackVertical().
    Quote Quote  
  15. Okay turns out that even though there aren't any obvious new scenes, the blu-ray version of the movie is not the same cut as the DVD. I found a post on another website from someone who made a copy of the movie and according to what he/she posted the blu-ray version has scenes that run slightly longer than the DVD. Since the film is animated, I suspect that certain stationary shots were just held a little longer to make the new dub script work. Anyway To fix it, the person says he/she actually went and "recut the blu-ray video myself to match the Special Edition DVD audio." I'm not adverse to watching the DVD movie and then trimming out the extra video from the blu-ray mkv so that it matches the DVD, but I'm guessing that unless you have expertise in video editing, that's probably not easy to do. At this point, I think I'm going to have to make do with the redubbed version and just hold out hope that the movie gets released again with the original dub.

    I appreciate your help Sneaker.
    Quote Quote  
  16. All this over a dub track? Isn't the original and intended language Japanese? So watch it in Japanese with subtitles. Problem solved. All anime fans prefer the original language over crappy dubs. Unless you're younger than about 10.

    And you've wasted everyone's time here with your incorrect assumptions and bad information. Apologies don't make up for that.

    ...but I'm guessing that unless you have expertise in video editing, that's probably not easy to do.
    Many things are difficult if you've never done them before. In principle it's easy but will just take tons of time and require reencoding the video.
    Quote Quote  
  17. Oh please, spare me your childish attitude Manono.

    Yes I normally prefer the Japanese language over the dub. However, in this instance I prefer the original dub because it is the version I grew up watching. In fact, it's the title that got me interested in anime in the first place.

    I know this will shock you, but I actually spent hours trying to solve this on my own before posting here in the NEWBIE (i.e. not an expert) section. How do you think I learned how to extract the audio track with mkvcleaver or use mkvtoolnix to mux the two files together? This is the first movie I've needed to do any work on and given that fixing sync issues can be difficult to diagnose I thought I would ask an expert for help. Forgive me if my level of knowledge doesn't meet your high and mighty standards.

    I haven't just been sitting around waiting for an answer either. I have done numerous searches for mkv audio sync issues over the last few days regarding this issue and the movie and did not find any results until today. The post regarding the slightly altered video was two entries in a multiple page forum post from an obscure blu-ray review website that up until that last page had been discussing whether they were going to buy the blu-ray when it came out later on in 2015. A blu-ray review forum post is not where I would normally go to research a MKV technical issue for a niche title, but I was running out of ideas.

    Thank you for telling me that things are difficult if you have not done it before. I never would have guessed that on my own. Not that it matters, but the comment was meant to indicate that I didn't think it was worth wasting "tons of time" (my own and potentially others) trying to learn how to edit video unless there is a program that makes it easy for someone with no editing experience to pick up and use. The fact that I won't be able to have my "crappy dub" on the blu-ray mkv isn't going to break my heart; it was just something I thought could be done with some help. I appreciate all those who have offered to help. Your comments are those of a troll and are worthless.
    Last edited by Revec; 8th Jun 2018 at 20:47.
    Quote Quote  
  18. Originally Posted by Revec View Post
    I appreciate all those who have offered to help.
    You appreciate? No apology at all to sneaker and the others that wasted their time over the course of three days trying to help you when all you were doing was sending them off on wild goose chases with your incomplete and just plain bad information? Sure, I had nothing useful to offer, but if you had known and stated what was wrong from the beginning I and others could have pointed out the way forward and told you you were wasting your time. You mentioned how much time you put in working on and researching the problem, but you didn't even figure out the cause of the problem until the end.

    I've done this exact thing before (cutting video frames here and there in order to resynch audio) and it's no fun at all. And I know what I'm doing. For a rookie it's next to impossible. And it requires a complete video reencode. Or you could add silence at the appropriate places to stretch the audio to the length of the video. That only requires an audio reencode and you could keep the original untouched video, other audio, subs and menus (if needed and wanted).

    Sometimes we do these things out of love but doing it for an English dub track of a Japanese creation? The mind boggles.
    Quote Quote  
  19. No, I did not think I needed to apologize since it was an honest mistake; not a deliberate attempt to mislead. I thought thanking Sneaker for trying to help me was sufficient. On the other hand, I can sort of see your view on that single point and I will apologize for not being able to find this information out sooner.
    Last edited by Revec; 8th Jun 2018 at 22:18.
    Quote Quote  



Similar Threads