Skip to main content

Topic: AC3 audio editor (Read 13660 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • jeffdgr8
  • [*]
AC3 audio editor
I want to combine an HDTV video recording and an AC3 DVD audio track, but the audio track doesn't quite fit with the video. I need to crop off the beginning and end (MGM lion roaring) and add the proper amount of silence to make the track the correct length to fit the video before muxing them together. I've extracted the audio from the DVD and saved it as a .ac3 file. The only program I've gotten to open the AC3 file for editing is Nero Wave Editor (latest v4.3.4.0) and for some reason, it only opens the first 15:30 of the track. I've tried Sound Forge, Audacity, Audition, and Soundbooth and none of these programs will edit AC3 audio. Maybe some of these programs require a plugin to unlock this capability. Does anyone have any suggestions? I don't really need to do a lot of editing to the track. I'm not adding anything except for silence, just removing is all. So if it were possible to do this without having to decode and reencode the whole track, that would be best.

  • j7n
  • [*][*][*][*][*]
AC3 audio editor
Reply #1
AC-3 streams can be cut without re-encoding with the help of a hex editor. It's a long and tedious process.

Always cut whole AC-3 frames. Each frame starts with header 0B 77. This header occurs at regular intervals in a CBR file.

To see how many bytes you should remove use this formula:

bytes = bitrate[kBit/s] * 1000 * time / 8.

So, a lion lasting 4.6 seconds ends at byte 258048 in a 448 kBit/s stream.

It is likely that your DVD has already defined a cell (chapter) for the lion clip. If this is so, just demultiplex the MPEG-2 Program Stream by cells, and you'll have the lion separated. Your DVD ripper migth allow to select chapters before ripping. If it does, this is the easiest way to get rid of chapter 0.

After this is done you'll have to determine the remaining video-audio delay, which is beyond the scope of this discussion.

If one of your video sources runs at 25 fps and the other at 23.976 fps, you will have to resample and re-encode the audio. One transcoded HDTV capture is not worth all this work IMO.

  • smok3
  • [*][*][*][*][*]
  • Moderator
AC3 audio editor
Reply #2
if you look for a mpeg2 cutters they usually have the ability to cut the ac3 as well, like for example:




(free trial)

(free trial)

no, i don't remember which exactly has this ability.

edit: maybe you can do something with virtualdub as well and its 'audio direct stream copy' option.
  • Last Edit: 28 August, 2008, 06:12:25 PM by smok3
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

  • jeffdgr8
  • [*]
AC3 audio editor
Reply #3
I was able to do what I needed with a program from Womble. I didn't use VCR, as suggested. But I used their newer MPEG Video Wizard DVD. Strangely though, I was unable to get the program to rip the AC3 data from the VOB files correctly. It was cutting off the very beginning of the files and resulted in errors in the track where the VOB files transitioned. I used the .ac3 audio file that I had previously extracted using a program called DVD Audio Extractor. MPEG Video Wizard DVD was able to cut the track where needed and add silence as well. Once I saved the AC3 file to the correct length for the HDTV video, I used mkvtoolnix to mux the video and audio tracks together. I did have to figure out the video-audio delay, which took some trial and error. But all I needed to do was shift the track in MPEG Video Wizard DVD and export it again. I could have also used the delay settings in mkvtoolnix. The frame rate wasn't an issue even though the DVD was NTSC and the HDTV video was 23.976 FPS. Both had the same timing with the audio. I just had to make sure to specify the correct frame rate for the video in mkvtoolnix. Thanks for your help!