VideoHelp Forum
+ Reply to Thread
Results 1 to 17 of 17
Thread
  1. hey guys.

    I'm having a weird problem with mkvextract. there is one specific .ac3 track in my .mkv which I can not extract properly. Let me show you first how the AC3-track looks INSIDE of the .mkv (Track ID 3):

    Code:
    Format                                   : Matroska
    Format version                           : Version 1
    File size                                : 748 MiB
    Duration                                 : 20mn 39s
    Overall bit rate                         : 5 065 Kbps
    Encoded date                             : UTC 2012-01-15 12:39:53
    Writing application                      : mkclean 0.8.6 ro from libebml v0.7.8 + libmatroska v0.8.1 + mkvmerge v2.3.0 ('Freak U') built on Sep  9 2008 17:43:22
    Writing library                          : libebml2 v0.21.1 + libmatroska2 v0.22.1
    
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L3.1
    Format settings, CABAC                   : No
    Format settings, ReFrames                : 2 frames
    Format settings, GOP                     : N=1
    Muxing mode                              : Header stripping
    Codec ID                                 : V_MPEG4/ISO/AVC
    Duration                                 : 20mn 39s
    Bit rate                                 : 4 132 Kbps
    Width                                    : 1 280 pixels
    Height                                   : 720 pixels
    Display aspect ratio                     : 16:9
    Frame rate                               : 25.000 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.179
    Stream size                              : 611 MiB (82%)
    Language                                 : English
    Color primaries                          : BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177
    Transfer characteristics                 : BT.709-5, BT.1361
    Matrix coefficients                      : BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177
    
    Audio #1
    ID                                       : 2
    Format                                   : AC-3
    Format/Info                              : Audio Coding 3
    Mode extension                           : CM (complete main)
    Muxing mode                              : Header stripping
    Codec ID                                 : A_AC3
    Duration                                 : 20mn 39s
    Bit rate mode                            : Constant
    Bit rate                                 : 448 Kbps
    Channel(s)                               : 6 channels
    Channel positions                        : Front: L C R, Side: L R, LFE
    Sampling rate                            : 48.0 KHz
    Bit depth                                : 16 bits
    Compression mode                         : Lossy
    Stream size                              : 66.2 MiB (9%)
    Title                                    : GER 5.1 TVS
    Language                                 : German
    
    Audio #2
    ID                                       : 3
    Format                                   : AC-3
    Format/Info                              : Audio Coding 3
    Mode extension                           : CM (complete main)
    Muxing mode                              : Header stripping
    Codec ID                                 : A_AC3
    Duration                                 : 20mn 39s
    Bit rate mode                            : Constant
    Bit rate                                 : 384 Kbps
    Channel(s)                               : 6 channels
    Channel positions                        : Front: L C R, Side: L R, LFE
    Sampling rate                            : 48.0 KHz
    Bit depth                                : 16 bits
    Compression mode                         : Lossy
    Stream size                              : 56.7 MiB (8%)
    Title                                    : ENG
    Language                                 : English
    And here how that track looks after extraction with mkvextract:

    Code:
    Format                                   : AC-3
    Format/Info                              : Audio Coding 3
    File size                                : 59.1 MiB
    Duration                                 : 21mn 31s
    Overall bit rate mode                    : Constant
    Overall bit rate                         : 384 Kbps
    
    Audio
    Format                                   : AC-3
    Format/Info                              : Audio Coding 3
    Mode extension                           : CM (complete main)
    Duration                                 : 21mn 31s
    Bit rate mode                            : Constant
    Bit rate                                 : 384 Kbps
    Channel(s)                               : 6 channels
    Channel positions                        : Front: L C R, Side: L R, LFE
    Sampling rate                            : 48.0 KHz
    Bit depth                                : 16 bits
    Compression mode                         : Lossy
    Stream size                              : 59.1 MiB (100%)
    I noticed that inside of the mkv the duration of this track is 20mn 39s but the extracted one suddenly get's a duration of 21mn 31s. I tried a few options with mkvextract, --raw output or --fullraw output, nothing worked. I even tried it on different operation systems with different version of mkvextract but still no luck.

    That's the reason I can't mux it up into a .mp4 container. Well I can but then the audio isn't in sync with th video anymore. And the problem is not smal delay it seems like mkvextrect "stretched" the audio, making it impossible for me to correct it with delaying back or forwards.

    I hope some of you can help me out because I have lot's of files like this. I don't know what else to try. 1st I thought maybe the "header stripping" was the problem but it wasn't. I removed it with MKVtools and with MKVtoolnix. Tried even to "fix" the mkv with mkclean, nothing changed. I hope you can help me.
    Quote Quote  
  2. aBigMeanie aedipuss's Avatar
    Join Date
    Oct 2005
    Location
    666th portal
    Search Comp PM
    first i'd try to get the mkv to work without header stripping. get the latest mkvmergegui, uncheck header stripping. add the mkv, put checks in just the video, audio, etc. you want and have it re-mux just those parts. check to see if it's in sync. if so go ahead and try converting to mp4.
    --
    "a lot of people are better dead" - prisoner KSC2-303
    Quote Quote  
  3. Try muxing it directly e.g. mkvtomp4 or ffmpeg
    Quote Quote  
  4. Originally Posted by aedipuss View Post
    first i'd try to get the mkv to work without header stripping. get the latest mkvmergegui, uncheck header stripping. add the mkv, put checks in just the video, audio, etc. you want and have it re-mux just those parts. check to see if it's in sync. if so go ahead and try converting to mp4.
    thanks for the reply!

    but I already tried that. I used 5.0.1 once and the latest one 5.2.* the remuxing progress went fine and everything was still in sync. But not after extracting/converting to mp4. Do you think the header stripping is the main problem?
    Quote Quote  
  5. Originally Posted by poisondeathray View Post
    Try muxing it directly e.g. mkvtomp4 or ffmpeg
    thanks for the advice.

    I tried mkvtomp4 but the audio is also not in sync with mkvtomp4. I think to problem with those muxers are that they all use mkvextract which causes the problem or changes the audio track.

    I used ffmpeg with this command: "ffmpeg -i source.mkv -vcodec copy -acodec copy output.mp4"

    but I got this error:

    "[mp4 @ 0x7f9ccb011200] pts < dts in stream 0
    av_interleaved_write_frame(): Operation not permitted"

    What did I do wrong?
    Quote Quote  
  6. you didn't necessarily do anything wrong with ffmpeg , might be some incompatibility in your file

    you can try eac3to

    eac3to input.mkv -demux
    Quote Quote  
  7. Also what is the actual source? What was this mkv derived from ? Is it a "euro" source 25 fps ?

    20min 39 vs. 21min 31 is almost the difference between 25fps and 23.976 fps .... might be some other funky business going on

    It it a VFR mkv ? If so you will never get the MP4 in sync without making it VFR

    Also note , mediainfo is not necessarily correct, all it does is read header information
    Quote Quote  
  8. thanks for your help!

    seems like eac3to has extracted the ac3 file correctly, all I can tell right now is that the duration of the extracted ac3 file is correct. I'll try to put them into a mp4 container now as soon as possible but my external drive where all the files are just kind of died so I'm working an that now.

    about the source I'm not quite sure. It's a little mixed up but the 1st audio track is german (I guess from europe) and the 2nd audio track (which makes problems) is definitly from US source.

    video and 1st audio track are perfectly sync no matter what. Guess you're right about that 25 fps and 23,96 fps. Does that help us?
    Quote Quote  
  9. Well try muxing it in as is first (from the eac3to demux) , if it's in sync, case solved


    If not, and still there is a discrepancy in A/V length, you would have to convert either the video or audio to match (either fps of video, or stretch/shrink audio to match with an audio editor e.g. audacity, or eac3to can do it too)

    (If it was "euro" source, the "english" audio might be already sped up)

    Having more information about the source can often help. E.g. if this was Hollywood theatrical production, then the real original would be film rate, 23.976 (or 24000/1001 exactly) , but the mkv you have might have other processing done to it. But if it was BBC production, it might be 25fps
    Quote Quote  
  10. Originally Posted by poisondeathray View Post
    Well try muxing it in as is first (from the eac3to demux) , if it's in sync, case solved


    If not, and still there is a discrepancy in A/V length, you would have to convert either the video or audio to match (either fps of video, or stretch/shrink audio to match with an audio editor e.g. audacity, or eac3to can do it too)

    (If it was "euro" source, the "english" audio might be already sped up)

    Having more information about the source can often help. E.g. if this was Hollywood theatrical production, then the real original would be film rate, 23.976 (or 24000/1001 exactly) , but the mkv you have might have other processing done to it. But if it was BBC production, it might be 25fps
    eac3to did something with the ac3 file without reencode it, I don't know what exactly it did but it's far better as the extracted one with mkvextract. now it fits better with the video but it isn't 100% in sync. I'll try a few things with audacity now, thank you and please let me know something comes into your mind.
    Quote Quote  
  11. can you post the eac3to log file ? it will say what has been done

    is the desync constant (e.g. 1sec off the entire way) , or progressively worsening ? how much is it off by ?

    was original mkv in sync (when you selected english audio track) ?
    Quote Quote  
  12. Originally Posted by poisondeathray View Post
    can you post the eac3to log file ? it will say what has been done

    is the desync constant (e.g. 1sec off the entire way) , or progressively worsening ? how much is it off by ?

    was original mkv in sync (when you selected english audio track) ?
    yeah sure.
    the original mkv was always in sync both of the audio tracks where in sync. maybe there's a funktion inside the mkv container which corrects the ac3 track somehow.

    it's not constant delay and at the first few minutes I thought everything was in sync, but it get's worse. Maybe it get's up to 0,7sec-1,0sec I'm not sure Sound come earlier btw. Here's the eac3to log file:

    Code:
    eac3to v3.24
    command line: C:\Users\****\Desktop\eac3to\eac3to.exe  D:\Downloads\source.mkv -demux
    ------------------------------------------------------------------------------
    MKV, 1 video track, 2 audio tracks, 0:20:40, 25p
    1: h264/AVC, 720p (16:9)
    2: AC3, German, 5.1 channels, 448kbps, 48kHz
    3: AC3, 5.1 channels, 384kbps, 48kHz, dialnorm: -27dB
    [v01] The video track doesn't contain framerate information.  <WARNING>
    [v01] Extracting video track number 1...
    [a02] Extracting audio track number 2...
    [a03] Extracting audio track number 3...
    [v01] Writing new framerate "25fps" to bitstream.
    [a03] Removing AC3 dialog normalization...
    [v01] Creating file "source - 1 - h264, 720p.h264"...
    [a02] Creating file "source - 2 - AC3, German, 5.1 channels, 448kbps, 48kHz.ac3"...
    [a03] Creating file "source - 3 - AC3, 5.1 channels, 384kbps, 48kHz.ac3"...
    [a03] Audio overlaps for 11ms at playtime 0:00:01.  <WARNING>
    [a03] Audio overlaps for 10ms at playtime 0:00:01.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:00:01.  <WARNING>
    [a03] Audio overlaps for 10ms at playtime 0:00:01.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:00:02.  <WARNING>
    [a03] Audio overlaps for 10ms at playtime 0:00:02.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:00:02.  <WARNING>
    [a03] Audio overlaps for 13ms at playtime 0:00:03.  <WARNING>
    [a03] Audio overlaps for 10ms at playtime 0:00:03.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:00:03.  <WARNING>
    [a03] Audio overlaps for 10ms at playtime 0:00:03.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:00:03.  <WARNING>
    [a03] Audio overlaps for 10ms at playtime 0:00:04.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:00:04.  <WARNING>
    [a03] Audio overlaps for 12ms at playtime 0:00:04.  <WARNING>
    [a03] Audio overlaps for 10ms at playtime 0:00:04.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:00:05.  <WARNING>
    [a03] Audio overlaps for 10ms at playtime 0:00:05.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:00:05.  <WARNING>
    [a03] Audio overlaps for 10ms at playtime 0:00:05.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:00:06.  <WARNING>
    [a03] Audio overlaps for 10ms at playtime 0:00:06.  <WARNING>
    [a03] Audio overlaps for 13ms at playtime 0:00:06.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:00:06.  <WARNING>
    [a03] Audio overlaps for 10ms at playtime 0:00:07.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:00:07.  <WARNING>
    
    [...]
    
    [a03] Audio overlaps for 10ms at playtime 0:20:34.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:20:35.  <WARNING>
    [a03] Audio overlaps for 10ms at playtime 0:20:35.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:20:35.  <WARNING>
    [a03] Audio overlaps for 12ms at playtime 0:20:35.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:20:36.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:20:36.  <WARNING>
    [a03] Audio overlaps for 10ms at playtime 0:20:36.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:20:36.  <WARNING>
    [a03] Audio overlaps for 10ms at playtime 0:20:36.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:20:37.  <WARNING>
    [a03] Audio overlaps for 10ms at playtime 0:20:37.  <WARNING>
    [a03] Audio overlaps for 12ms at playtime 0:20:37.  <WARNING>
    [a03] Audio overlaps for 10ms at playtime 0:20:38.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:20:38.  <WARNING>
    [a03] Audio overlaps for 10ms at playtime 0:20:38.  <WARNING>
    [a03] Audio overlaps for 11ms at playtime 0:20:38.  <WARNING>
    [a03] Audio overlaps for 10ms at playtime 0:20:39.  <WARNING>
    [a03] Starting 2nd pass...
    [a03] Realizing (E-)AC3 gaps...
    [a03] Creating file "source - 3 - AC3, 5.1 channels, 384kbps, 48kHz.ac3"...
    Video track 1 contains 30970 frames.
    eac3to processing took 5 minutes, 54 seconds.
    Done.
    does this say something to you?
    Quote Quote  
  13. It means there were a bunch of audio gaps in track 3 (the english), that it tried to fix

    Not sure what else to do, you'll have to play with ti

    Or just leave it as is, is there any reason why you want to mux into mp4 ?
    Quote Quote  
  14. Originally Posted by poisondeathray View Post
    It means there were a bunch of audio gaps in track 3 (the english), that it tried to fix

    Not sure what else to do, you'll have to play with ti

    Or just leave it as is, is there any reason why you want to mux into mp4 ?
    hmmm ok... what do you mean with ti?

    mp4 just so I could watch it on apple tv. kind of important for me :/. I'll try the slowdown and speedup option with eac2to and see what happens.
    Quote Quote  
  15. sorry, typo

    "ti" = "it" ; play with it
    Quote Quote  
  16. Originally Posted by poisondeathray View Post
    sorry, typo

    "ti" = "it" ; play with it
    hey. I just tested the ac3 file with eac3to and the slowdown speedup options. turns out the speedup options is all i need to do and the audio is perfectly in sync with audio. you were right ac3 was in 23,76 fps and needed to be 25.00 fps.

    thank you so much for your help. just one more question: do you know any other method to do this? I'm working on a mac and I couldn't get eac3to to work with wine. if not, thaks again and have good night!
    Quote Quote  
  17. Well you can do it in any audio editor, it's just the ratio of 24000/1001 vs. 25.0

    But I don't know if eac3to "fixed" something besides the slowdown (like gaps & errors)

    or maybe avidemux ? there is a mac version

    load the mkv, select the audio track, audio => set ac3 => then under audio filters set PAL to FILM => then audio=>save (enter name with extension )

    EDIT: actually it's the other way around for you: FILM=>PAL

    Alternatively, you can try muxing 24000/1001 FPS for the video, and keeping the audio as is
    Last edited by poisondeathray; 15th Jan 2012 at 18:29.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!