Log in

View Full Version : Extracting AC3 from AVI: is there an easier way than this?


FlimsyFeet
21st September 2005, 08:27
Open first AVI file in VirtualDubMod, then "append segment" and add second file. Now go to streams and demux the AC3.

Unfortunately the ac3 file that is output is not recognised by some software (e.g. DVDAuthorGUI), I think VDubMod gives it the wrong header. So now I have to open up a command window, find besplit and use the -fix option on the file. The operation itself only takes a few seconds, but the logistics of locating the executable, locating the file and typing in the pathnames is cumbersome.

(I suppose I could refine the process by making a bat file for fixing with besplit and adding it to the right-click menu for ac3 files, but I just wondered if there was a more refined method.)

There's a big thread about this on the forum, and in one post it mentions using AVI-muxGUI. However using that I can't find any option to join two files together before demuxing.

tebasuna51
21st September 2005, 11:15
Unfortunately the ac3 file that is output is not recognised by some software (e.g. DVDAuthorGUI), I think VDubMod gives it the wrong header.
Isn't a VDubMod problem. Is from creation of this avi's. Three common problems for authoring soft are:
1) Insert in ac3 stream leading bytes (with not ac3 sense) to make delays. The correct method is insert true ac3 silence.
2) Split the avi without considering the frame boundaries of ac3 stream and/or lose any byte in the process. When you append the second avi there are many possibilities to obtain a incorrect frame.
3) Any frame with bad CRC

The three problems are solved for BeSplit
(I suppose I could refine the process by making a bat file for fixing with besplit and adding it to the right-click menu for ac3 files, but I just wondered if there was a more refined method.)
You have BeSliced (GUI for BeSplit). You only need drag & drop your file over it and click "Fix".

Matthew
21st September 2005, 11:39
If I recall correctly VirtualDubMod does add a 58 byte wav header, but only if you use "save wave", not demux.

And just as a follow up to tebasuna51's post, make sure you check the BeSplit log for the location of stream errors and their size. If they are significant then the DVD will be noticeably out of sync, as BeSplit just deletes the junk.

Synergy
24th September 2005, 17:30
Mathew, how can you solve this out of sync problem?

When I join 2 avi's of the same movie and then fix this merged file with BeSliced in order to fix the errors I get in the ac3 file where the audio was joined. The resulting avi goes out of sync after the join point. Ive noticed it goes out about 200ms after fooling around with it in VirtualDub.

How can I fix this problem when the first half of the avi is in sync but the remaining is out of sync because of besliced removing the errors where it was joined?

planet1
24th September 2005, 18:04
I'll keep it short - best tool (IMHO):
http://www.doom9.org/Soft21/Editing/AVI-Mux_GUI-1.17.3.zip

Audio-extraction (any format) with VirtualDub adds a WAVE-header which means that an ACM-codec is required for playback.

bye

EDIT: as for correcting the delay of "raw" ac3 streams - delaycut should do the job - http://jsoto.posunplugged.com/audiotools.htm

Matthew
25th September 2005, 02:23
Synery you could try using delaycut on the joined file instead of BeSplit, it has an option to replace bad frames with silence.

Personally I use BeSplit to get the number of junk bytes and then substitute silent frames for those bytes on a best fit basis. Either at the join point or elsewhere in the file (very occasionally they can be corrupt earlier on). But that's an automated process as part of my avi-DVD conversion tool posted in the DVD Authoring forum, doing it manually is a bit of a pain :)

As an aside, it is also possible that the length of the audio in the first avi is markedly shorter than that of the video. In such a case you need to calculate the difference in length between the first audio/video streams and then append silent frames at the join point on a best fit basis.

If you need to do any calculations the following may assist:
-Each "good" AC3 frame is exactly the same size - 4 x the bitrate (e.g. 1792 for a 448kbps stream)
-Each AC3 frame is always 32 milliseconds in length.
-If there is junk data of x bytes then afting fixing you have lost sync by x/framesize * 32, at the point of the corruption onwards.

XIII
28th September 2005, 13:45
@FlimsyFeet

Its likely your problem is caused because of the way your
using the append segment.

The best thing to do is use the append segment then save
it using the direct stream option, then open the new joined
avi in VirtualDubMod and demux the AC3, should solve your problem.

If you still have problems just run the file through BeSweet
using AC3 > AC3 option, might not be as quick but its the
best way to get shot of errors.

AC3 ACM Decompressor is always a nice add on to have
with VirtualDubMod.

http://www.videohelp.com/tools?tool=AC3_ACM_Decompressor


XIII

f@chance
28th September 2005, 16:16
Ah, the joys of joining DivX files that some release group decided to put on 2 CDs and now you get it out of sync, the most COMMON problem. I have fiddled and dicked around with this for many moons, trying to solve the problem and have found no easy way. Every AC3 that I demux of the DivX file gets into the file name ORG. Then run it through AC3 Delay cut and take the ORG out of the destination file name, it fixes any problems plus I have the original file name again.

Now my interest is in DVDRs run the separate segments through CCE and place the video portion on the video track in DVDMaestro. Right click on the sound track and create sync sound tract. Job Done. Not quite every now and then the audio is out of sync by maybe 80 to 300 ms and it bothers me. Take the second sound track run it through AC3 Delay cut and either cut frames of or add silence to the beginning. Re-author it again check for sync problems until it is insync.

I have not found an easy way of correcting clips that need to be appended. Even worst sometimes there is a 2 second overlap for changing CDs and more fiddling and dicking around. Which helped me to come to the conclusion many times the posted stuff aint worth it.

SeeMoreDigital
28th September 2005, 16:23
If it's just the AC3 streams you are having problems joining together correctly you could try MuxMan!

I have used it to join/mux multiple AC3 (and DTS) streams together by creating a multiple (DVD) VOB title set.... and then used DGIndex to extract the AC3 element (from the VOB's) into one long uninterrupted AC3 stream.... for use with other applications!

It may not be the most elegant solution but it seems to work okay!


Cheers