Log in

View Full Version : Rejoining AC3 Files (from split MKVs)


resonator
30th September 2007, 22:19
Hey!

I rarely ever post as most of the problems I encounter have already been discussed somewhere, but this time I ran across something I couldn't find anything on.

I like my Videos as single files (not split to CD sizes, in the age of DVDRs it seems redundant to me), so I like joining MKVs I didn't make myself using mkvmerge (gui). However, sometimes sync is slightly but noticeably off during the "CD2" part of the rejoined file. I suppose it has to do with the way mkvmerge handles the audio content when it actually splits the files. I suspect it works like this:

- The video is cut on a keyframe.
- The audio is cut on the next audio frame and if the frame doesn't match with the keyframe a delay is applied.
- When rejoined, this delay isn't taken into account and the audio plays a little earlier than the video.

Can anybody confirm this?

However, I'm looking for a method to reconstruct the AC3 file as it was before it got split by the muxer. mkvextract let's me extract the ac3 files, but how could I possibly rejoin those files without loosing (audio) frames?

Any ideas?

baudi
1st October 2007, 17:32
Try:

copy /b Part1.ac3+Part2.ac3+...+PartN.ac3 FullParts.ac3

resonator
1st October 2007, 19:09
Well, I'm not sure whether a simple binary copy would solve the problem, I guess it's more likely to introduce even more corruption to the ac3 file. I'm pretty sure that during muxing and splitting a new header is written to all of the files, so you'd generate a new file with two headers in it.

baudi
1st October 2007, 22:07
After the binary copy try to fix the resulting .ac3 file with DelayCut. This may solve the corrupted ac3 packets.

setarip_old
1st October 2007, 22:13
@resonator

Hi!so I like joining MKVs I didn't make myselfYou might want to RE-read the "Announcement" at the top of the "Newbies" sub-forum, as well as all of the Forum Rules (particularly #6)...

tebasuna51
2nd October 2007, 02:43
Well, I'm not sure whether a simple binary copy would solve the problem, I guess it's more likely to introduce even more corruption to the ac3 file. I'm pretty sure that during muxing and splitting a new header is written to all of the files, so you'd generate a new file with two headers in it.

Yes, the binary copy is the best method (with a posterior pass to validate the stream with BeSplit or DelayCut) because maybe you can recover a split frame (half in first part and half in second part).

An ac3 stream have a header in each frame (32 ms for 48000 Hz) and muxing or splitting can't write new headers or frames without encoder capabilities.

If the first audio is short than video or the second audio was delayed you need add silence between the two parts. Use DelayCut and after the binary copy.

resonator
2nd October 2007, 06:29
@resonator

Hi!You might want to RE-read the "Announcement" at the top of the "Newbies" sub-forum, as well as all of the Forum Rules (particularly #6)...

Oh, you gotta be kidding me. I merely said "Files I didn't make myself", I never implied that I downloaded pirated movies. There are lots of sources of non-copyrighted material, and I don't think I have to tell you that.

resonator
2nd October 2007, 06:34
Yes, the binary copy is the best method (with a posterior pass to validate the stream with BeSplit or DelayCut) because maybe you can recover a split frame (half in first part and half in second part).

An ac3 stream have a header in each frame (32 ms for 48000 Hz) and muxing or splitting can't write new headers or frames without encoder capabilities.

If the first audio is short than video or the second audio was delayed you need add silence between the two parts. Use DelayCut and after the binary copy.

Well, I tried that method, Delaycut tells me I still loose about 120ms of audio (the content was split to 3 CD-sized MKVs). I think I gotta do some more testing with something I did myself. Thanks for the advice though!

ACrowley
2nd October 2007, 11:35
i use Filemerger for it...works perfect without any delay /corruption for ac3 and dts

tebasuna51
2nd October 2007, 19:20
i use Filemerger for it...works perfect without any delay /corruption for ac3 and dts
Yes, is the same than the binary copy but with GUI.

Don't check incomplete frames then the DelayCut pass is recommended also with Filemerger.

resonator
5th October 2007, 22:23
Yes, this definatly works pretty well. Thanks for the advice!

Now I'm sorta wondering if there's a tool to fix AAC headers as well. Any ideas?