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 > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th January 2012, 05:29   #1  |  Link
epow0317
Holic
 
Join Date: Sep 2009
Posts: 34
Audio Delay Issue

I've been trying to encode a 1080i MPEG2 into a 720p H.264 using both DGIndex and Megui.
But after muxing both video and audio, it turns out to be out of sync.
I guess DGIndex doesn't catch audio delay exactly.
Although i also tried Mediainfo, still out of sync.
Afterall i manually catched audio delay and applied it...

I don't understand why both DGIndex and Mediainfo can't catch audio delay exactly while media player can.
If this situation shows up once more, do i have to fix it manually?

I uploaded the 1080i MPEG2 in case you need more information.
It is Japanese HDTV source.
http://www.megaupload.com/?d=AO8GEUF1

(+)
Mediaplayer plays it smoothly.
DGindex says it has 10ms audio delay.
MediaInfo says it has 24ms audio delay.
But manually, it turns out to be about 100ms audio delay.
epow0317 is offline   Reply With Quote
Old 7th January 2012, 12:57   #2  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
The stream has two audio tracks. Which one are you talking about?

Did you re-encode the AAC audio to something else? Please tell your entire exact process, including your script.

>I don't understand why both DGIndex and Mediainfo can't catch audio delay exactly while media player can.

MediaPlayer has access to the timestamps in the TS, which are lost when demuxing.

Last edited by Guest; 7th January 2012 at 13:11.
Guest is offline   Reply With Quote
Old 7th January 2012, 14:34   #3  |  Link
epow0317
Holic
 
Join Date: Sep 2009
Posts: 34
Quote:
Originally Posted by neuron2 View Post
The stream has two audio tracks. Which one are you talking about?
I mean the first audio stream (187Kbsp, 48.0KHz, AAC ADTS).

Quote:
Originally Posted by neuron2 View Post
Please tell your entire exact process, including your script.
And my entire process is here,

Quote:

-- video encoding --

1. open the video with DGIndex.
2. Audio - Output Method - Demux All Tracks
3. File - Save Project

Then, it creates two files.
The one named "Perfume - Nee (Music Station - 2010.11.19).d2v".
And the other one named "Perfume - Nee (Music Station - 2010.11.19) PID 112 DELAY 10ms.aac".

4. load .d2v with Megui's Avisynth script creator (Ctrl+R).
5. Resize to 960x540.
6. In Filters menu,

Source type: Interaced
Field order: Top Field First
Deinterlace: Yadif
Resize Filter: Spline36 (Neutral)

7. Click the save button.
8. Encoder settings's not so special..

program --preset slower --pass 2 --bitrate 12000 --stats ".stats" --bframes 8 --qcomp 0.8 --merange 64 --no-dct-decimate --no-fast-pskip --output "output" "input"

9. Encode the video.

-- audio encoding --

1. Wrap the aac into .mp4 with mp4box.
2. Decode wrapped aac(.mp4) into .wav with NeroAACDec
3. Load decoded aac(.wav) with Megui.
4. Extension: .m4a (to use mp3gain)
5. Delay: 10ms (automatically)
6. Encoder settings is here.

Preferred Decoder: NicAudio
Output Channels: Downmix multichannel to Stereo
SampleRate: Keep Original
Normalize Peaks to 100
Constant Bitrate @ 160 kbit/s
AAC Profile: AAC-LC

7. Encode the audio.

-- muxing --

Simply mux both video and audio with mp4box.
And the result is out of sync slightly compared to original source.
At a glance, you may not notice.
Why does this situation occur...?

epow0317 is offline   Reply With Quote
Old 8th January 2012, 01:23   #4  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
>And the result is out of sync slightly compared to original source.

Please quantify that for me.
Guest is offline   Reply With Quote
Old 8th January 2012, 03:08   #5  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
I performed this experiment:

As the reported delay of 10ms is within the AV standards for many satellite providers, I choose to do nothing to adjust the AV sync.

I make my project. I convert the audio to AC3 using EAC3TO. I make a simple script dubbing the video to the audio decoded with NicAC3Source().

Code:
loadplugin("DGDecode.dll")
vid=mpeg2source("Perfume - Nee (Music Station - 2010.11.19).d2v")
aud=nicac3source("perfume.ac3",2)
audiodub(vid,aud)
I play the script in VirtualDub.

The result is fine for me.

I could use DelayAudio() in the script to correct the 10ms, but who cares?

>But manually, it turns out to be about 100ms audio delay.

Of course it's possible that desync can be in the source, but as I said the above script plays fine for me. So maybe your "manually" is not as accurate as you think. Human perception of desync is notoriously unreliable.

Last edited by Guest; 8th January 2012 at 03:33.
Guest is offline   Reply With Quote
Old 8th January 2012, 05:09   #6  |  Link
epow0317
Holic
 
Join Date: Sep 2009
Posts: 34
Quote:
Originally Posted by neuron2
>Please quantify that for me.
Well.. i don't know how i can demonstrate that..
Just.. both the original and the encoded one are not same in sync.

Quote:
Originally Posted by neuron2
The result is fine for me.
Yes. i understand.
About 100ms gap may not bother..
Hmm..
I'm wondering if you could append 100ms delay to audio stream and check it again.
I'm sure you would notice both video and audio are much more in harmony.

Quote:
Originally Posted by neuron2
MediaPlayer has access to the timestamps in the TS, which are lost when demuxing.
Simply put, all i want to know is just two answers.
I guess you've already answered the first question with the above statement.

1. Is it possible both DGIndex and Mediainfo can't catch audio delay exactly while media player can? - already answered
2. Then.. i should fix it manually?

Thank you neuron2 for helping me so constantly..!!

Last edited by Guest; 8th January 2012 at 16:53. Reason: accidental edit -- reverted
epow0317 is offline   Reply With Quote
Old 8th January 2012, 14:46   #7  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by epow0317 View Post
Well.. i don't know how i can demonstrate that..
Just.. both the original and the encoded one are not same in sync.
Whenever I'm not sure if the audio sync is the same I open the original and encoded videos using 2 instances of MPC-HC and run the video (starting and stopping one to sync the audio) until the audio in the 2 tracks is perfectly synced (usually it'll produce a phasing type of effect if they are).
Then it's easy to watch the two videos to see if scene changes are happening at exactly the same time in both players. If they're not then the audio sync isn't the same in both files.
hello_hello is offline   Reply With Quote
Old 8th January 2012, 16:54   #8  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Quote:
Originally Posted by epow0317 View Post
I'm wondering if you could append 100ms delay to audio stream and check it again.
I'm sure you would notice both video and audio are much more in harmony.
It seems to be so. Investigating further...
Guest is offline   Reply With Quote
Reply

Tags
delay, dgindex, hdtv, megui, mpeg2

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 14:10.


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