Log in

View Full Version : Remuxing MKV creates Audio Sync Issue


nekrosoft13
29th October 2010, 03:38
Ok, I have few MKV files of Polish TV show in 720p.

file info
General
Complete name : \\Czas Honoru\Season 3\New folder\Czas Honoru - S03E03 - Oddział do zadań specjalnych.mkv
Format : Matroska
File size : 1.09 GiB
Duration : 44mn 29s
Overall bit rate : 3 516 Kbps
Encoded date : UTC 2010-10-04 12:30:11
Writing application : mkvmerge v3.4.0 ('Rapunzel') built on May 15 2010 09:38:20
Writing library : libebml v0.8.0 + libmatroska v0.9.0

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings, CABAC : Yes
Format settings, ReFrames : 5 frames
Muxing mode : Container profile=Unknown@4.1
Codec ID : V_MPEG4/ISO/AVC
Duration : 44mn 29s
Bit rate : 3 131 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.136
Stream size : 974 MiB (87%)
Writing library : x264 core 105 r1724 b02df7b
Encoding settings : cabac=1 / ref=5 / deblock=1:-2:-2 / analyse=0x3:0x113 / me=umh / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=27 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=2 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=6 / sliced_threads=0 / slices=2 / nr=0 / decimate=1 / interlaced=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=3131 / ratetol=2.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=14000 / vbv_bufsize=14500 / ip_ratio=1.40 / aq=1:1.00 / nal_hrd=none
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
ID : 2
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Codec ID : A_AC3
Duration : 44mn 29s
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
Stream size : 122 MiB (11%)

What ever i try to remux it to TS or M2TS file always results in Audio Sync Issue.

I tried checking for any audio delay in Media Info, MKVmerge, Clown BD, MKVInfo, Ripbot, none of those apps show me that there could be any Audio Delay.

If I re-encode the file to AVCHD in Ripbot the audio in resulting file is fine.

Can someone help to remux this file to TS and keep the audio sync in place?

Adub
29th October 2010, 05:55
What media software are you experiencing the sync problems on?

As for the re-encoded version, is the audio converted to anything (ex: re-encoded AC3 or AAC), or just copied through?

Oh, and how did you get this MKV?

nekrosoft13
29th October 2010, 06:10
Audio sync happens in wmp12, media center, xbmc, you name it.

in the re-encoded version, i tried direct copy and re-encoded AC3, both were fine.

Adub
31st October 2010, 09:59
Interesting. Well, it sounds like you get your desired outcome using the direct copy mode. The nice thing about direct copy is that it is essentially a remux, which means that you can retain all original audio quality.

As to why you are seeing audio sync issues when remuxing by hand, I cannot say. Some files just have bad internal timestamps or the demuxing software has a bug.

Chug a Bug
1st November 2010, 16:15
Unfortunately TV rips often have all kinds of errors in the streams, you could try running it through Mpeg2repair if it's MPEG2 video and putting the AC3 through AC3fix to try and fix errors but it's not guaranteed to work. The only reliable H264 tv rip editing software I've found is VideoRedo, but it's shareware.

nekrosoft13
1st November 2010, 19:39
Interesting. Well, it sounds like you get your desired outcome using the direct copy mode. The nice thing about direct copy is that it is essentially a remux, which means that you can retain all original audio quality.

As to why you are seeing audio sync issues when remuxing by hand, I cannot say. Some files just have bad internal timestamps or the demuxing software has a bug.

not excactly, because video portion has to be re-encoded. if video is remuxed audio will be out of sync.

Adub
3rd November 2010, 00:36
Okay, I see what you mean.

However, it appears that RipBot uses mkvextract to extract the audio. It even saves the audio file in a temporary location. What you can do is try extracting your audio using one of the mkvextract guis (there are two of them in use these days, MKVCleaver and MKVExtractGUI2) and then remuxing the video as you desire, or use RipBot's extracted stream (shown in the audio file source dropdown menu).

Let us know how it goes.

nekrosoft13
3rd November 2010, 02:47
Okay, I see what you mean.

However, it appears that RipBot uses mkvextract to extract the audio. It even saves the audio file in a temporary location. What you can do is try extracting your audio using one of the mkvextract guis (there are two of them in use these days, MKVCleaver and MKVExtractGUI2) and then remuxing the video as you desire, or use RipBot's extracted stream (shown in the audio file source dropdown menu).

Let us know how it goes.

that is the thing, if i remux the original video stream, audio will get out of sync, if i re-encode the original video with original audio it will be in sync.

Adub
3rd November 2010, 02:51
Even if you remux the video stream using the audio stream that you extracted using mkvextract?

nekrosoft13
3rd November 2010, 03:10
yes...