Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 26th January 2013, 05:25   #1  |  Link
xekon
Registered User
 
Join Date: Jul 2011
Posts: 224
Guide Correcting audio delay for Anime that has an Audio Delay issue, ie Dragonball Z

Guide Correcting audio delay for Anime that has an Audio Delay issue, ie Dragonball Z

I hope this guide saves some people some time when they are trying to correct an audio delay issue caused by the production studio.

The issue was a combination of open gops and authoring errors by the production studio.
The combination of the two and me being new to ripping dvds in general had me pulling my hair out. (thanks neuron2 & manono for all your help)

Before you invest the time to follow this guide, the audio correction are not automatic, you still have to listen to and line up the audio, but with the method I am using, you only have to do it to one episode, and then you can use it as a basis for audio alignment in all the remaining episodes, for a show like DBZ with 291 episodes, that is a lot of time saved!

Before I was doing something incorrectly in my ripping/decrypting/demuxing process that caused open gops throughout the episode, so if I lined up one spot in the episode, other spots would be off by as much as 300+ ms(the open gops were between individual cells for the given vob ID), once correctly ripped, you can apply a single delay to the entire episode to bring it back into alignment. (to fix the alignment issue the production studio made.)

There may be other workflows that work, possibly with even less steps, this is just what has been working reliably for me.

1. AnyDVD HD 7.1.2.0 installed and enabled, default settings.

2. Set DVD Decrypter to the following settings: http://adubvideo.net/how-to/anydvd-dvd-decrypter
In addition to this guide, set these settings on the file mode tab:


3. With AnyDVD in system tray and active/enabled, insert DVD
If your working with ISO/image files then install virtual clonedrive: http://www.slysoft.com/en/virtual-clonedrive.html
and mount your image, was using Daemon Tools lite, but virtual clonedrive is by the same company as AnyDVD and is supposed to work more efficiently with virtual clonedrive, or so im told.

4. Load RipIt4Me, I am using 1-Click Mode.

Above is my settings. Make sure to set your "Base path for target rips"
I click 1 click mode and then next.
It then goes to work with dvd decrypter, ifo/vob cleanup

5. Load PgcDemux, Load the input IFO created from the previous step(largest size),
select an output folder.
check "Create a PGC VPOB", have all the other options unchecked.
click "by VOB id" for the Mode, Select the First VID in the drop down menu that is over 10 minutes. (First episode)
click Process, as you do this its a good idea to rename the vobs to the episode number
process all vids in the drop down menu over 10 minutes.


6. Load DGIndex, set Video > Field Operation > "Force Film"
Open 001.VOB that you created in the previous PgcDemux step, click ok.
from the menu select Audio -> Output Method -> Demux All Tracks.
and goto File -> Save Project, which will generate a .d2v, and audio files.

7. Load AvsPmod, use the following test.avs:

Code:
LoadPlugin("F:\AviSynth\plugins\audgraph.dll")
LoadPlugin("F:\AviSynth\plugins\DGDecode.dll")
LoadPlugin("F:\AviSynth\plugins\NicAudio.dll")
A = NicAC3Source("F:\dbz_s1d1\001 T81 2_0ch 192Kbps DELAY -213ms.ac3")
V = MPEG2Source("F:\dbz_s1d1\001.d2v")
AudioDub(V, A)
DelayAudio(-0.246)
ConvertToRGB()
AudioGraph(1)
You want to find the eyecatch, and go 3 frames into the eyecatch:


As you can see for Season 1 episode 1 (remastered orange bricks), If you look at the file DGIndex demuxed The reported delay is -213ms or DelayAudio(-0.213).
This delay is incorrect, and the reason is not that DGIndex demuxed the audio incorrectly, it is because the production studio did not have the audio alignment correct.
As you can see in my script I am using a delay of -246ms or DelayAudio(-0.246).
I came to this value by carefully listening to several places within the episode, making small adjustments, playing it back again, and also inspecting the audio graph.(hours worth of checking)

If you have properly ripped your dvd/image and followed my guide, your audiograph alignment for episode 1 should look like this at the different frame numbers.
If your audiograph is way off on some of the frame numbers then you may still have some open gops, and need to make sure you are ripping it correctly.


So If you have your episode1 finished and it is in sync you are now ready to rip other episodes and get them into the same sync.
Follow the same procedure and get your second episode loaded into AvsPmod

Now to line up the second episode you dont have to torture yourself listening to it over and over trying to line it up.
Just find the eyecatch for episode2 and go to the third frame into the eyecatch just like in episode 1.

In AvsPmod I keep episode1 open, and open a new tab to work on additional episodes as you can see in this screenshot.
in AvsPmod if you hold down control and press tab, it will cycle through the tabs, so can do that back to back to quickly compare the audio graph between the two episodes.
on your episode2, 3rd frame into the eyecatch, you want to adjust the DelayAudio() until it is close to lining up with episode1.
You can see in the screenshot where I zoomed it in and drew a yellow line across the audio graph. I adjusted all the other episodes so that they are at that yellow line or just 1ms past it.
So all you have to do now is keep a .avs file per episode with correct audio delay, or if your doing your encodes through a batch file then take note of the delay on each episode.

If the audiograph is so far off that you dont even see the same section of graph, you can change AudioGraph(1) to AudioGraph(5), that will make it display more frames worth of audio at once, then once your close set it back to AudioGraph(1) so you can fine tune more easily.

Then just continue to line up each episode using the audio graph.

Now this covers the alignment of the Bruce Faulconer track on the orange bricks.
If you were using the other tracks that had the original japanesse music, you use the same idea.
Instead of 3 frames into the eyecatch go 5 frames into it, also you may have noticed the audiograph is rather flat, you can apply AmplifydB(10) right before the AudioGraph() call to make the graph more visible.
Also the audiograph was displaying oddly for the 6channel track, so I downmixed it to 2 channel, just for alignment purposes, make sure you remove it before encoding, unless all you want is 2 channel audio of coarse.


I am still not finished encoding the entire series, if I find anywhere that this method does not hold up, I will post about it.
I have been doing my ripping/correcting/encoding by series, dont have enough hard drive space to do the entire show at once.

I am assuming that anyone reading this has a basic idea of how to encode the audio & video using a .avs file, and then mux them into an mkv using mkvtoolnix.
This guide was just meant to cover my approach to correcting the audio alignment of the Dragonball Z series.
This method could be applied to other Anime too (ones with an eyecatch that has audio), but hopefully you wont run into to many other titles that have audio sync issues.

Now as you have noticed, using PgcDemux like this gets you just the episode, you dont get the opening or closing song, or NEP.
I actually prefer to encode them seperately instead of having the opening song on all 291 episodes, for one it will save some file space, it also makes it easier to watch the series marathon style.
you can process them seperately and combine them: http://forum.videohelp.com/threads/344103-Avisynth-Script-Help-Trimming-and-Joining
or you can even skip using PgcDemux, and use DGIndex on the entire episode without creating the PGCvob.
If you want to skip using PgcDemux you can use IfoEdit to strip one of the two angle. (PgcDemux automatically keeps angle1 only)

Last edited by xekon; 26th January 2013 at 20:33.
xekon is offline   Reply With Quote
 

Tags
audio, audiodelay, correct, delay, dragonball


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.