Log in

View Full Version : wrong 6sec delay between audio and video loaded via .avs


Ajaja2005
29th June 2005, 21:31
Pure 264-output was not the solve in my case :(
It was impossible to mux the result into mp4 with sound (aac-sbr, besweet).
MP4Box -new -fps 23.976 -add an2.264 an2.mp4
MP4Box -sbr -add an2.aac an2.mp4
and I had 6 seconds (!!!) of constant mistiming between audio-video.
MP2Box -info showed that length of both (audio and video) streams was identical, frame-to-frame comparsion (avs,DirectShowSource("an2.mp4")) showed that order of frames in original and encoded video was identical, but in the Media Player Classic (timeline comparsion) there were 6 seconds mistiming between the original and encoded videos - mp4-video passes ahead, but last seconds - static picture. I tried Nero Splitter, I tried Haali Splitter, I tried mplayer (www.mplayerhq.hu) - the same result.
I don't know, maybe problem in 23.976fps, maybe problem in long-drawn black frames at the beginning of video.
Did somebody else encode 23.976fps-long-video using x264???

bond
29th June 2005, 21:37
It was impossible to mux the result into mp4 with sound (aac-sbr, besweet).impossible to mux audio with video or audio delay? both cant happen at the same time

MP4Box -new -fps 23.976 -add an2.264 an2.mp4
MP4Box -sbr -add an2.aac an2.mp4
and I had 6 seconds (!!!) of constant mistiming between audio-video.are you sure there is no delay in the input?
do you also get the 6 sec delay when doing the whole muxing with mp4creator?
do you also have this constant delay of 6 seconds when muxing with setting the framerate to 25fps via -fps 25 in mp4box?

edit: whats your input?

Ajaja2005
29th June 2005, 22:33
I did not try mp4creator (does it support AVC?) and I did not try 25fps (I used only MP4Box -fps 23.976).

My steps:
x264.exe --no-psnr --progress --pass 1 --stats "x264.log" --bitrate 840 --bframe 2 --ref 5 --weightb --b-pyramid --analyse "all" --8x8dct --me "umh" --subme 6 -o NUL an2.avs
x264.exe --no-psnr --progress --pass 2 --stats "x264.log" --bitrate 840 --bframe 2 --ref 5 --weightb --b-pyramid --analyse "all" --8x8dct --me "umh" --subme 6 -o an2.264 an2.avs
MP4Box.exe -new -fps 23.976 -add an2.264 an2.mp4
MP4Box.exe -sbr -add an2.aac an2.mp4

an2.avs was: DirectShowSource("an2.avi",audio=false)
What I did wrong?

I'm tired of that and ran Nero Recode. I got normal mp4. To check mp4box I extracted video and audio from it and re-mux using mp4box with the same parameters. There weren't any problems. I think, problem was not in GPAC.

bond
29th June 2005, 23:08
I did not try mp4creator (does it support AVC?) and I did not try 25fps (I used only MP4Box -fps 23.976).
try it, it can help tracking the problem down

I'm tired of that and ran Nero Recode. I got normal mp4. To check mp4box I extracted video and audio from it and re-mux using mp4box with the same parameters. There weren't any problems. I think, problem was not in GPAC.
you mean you created a mp4 file with nero and remuxed it with mp4box? if yes, did you feed nero exactly with the same .avs as x264?

is the audio and video in sync in your source an2.avi? can you upload a small part of it which shows these sync problems after encoding with x264 please, so i can try it myself

Ajaja2005
30th June 2005, 06:22
you mean you created a mp4 file with nero and remuxed it with mp4box? if yes, did you feed nero exactly with the same .avs as x264?

No, avi.


is the audio and video in sync in your source an2.avi?
Yes, but it was ac3-in-avi file

OK, I'll try to repeat encoding and check

Ajaja2005
30th June 2005, 19:01
All clear!
I found the reason of 6s-delay bug: DirectShowSource()+ffdshow+Xvid source. The bug appears even in *.avs.

But, crash problem with mp4 output did not dissapear :(

bond
1st July 2005, 13:58
ok i splitted and moved this issue as its a different one than the one discussed in the original thread and i think some avs guys would be interested in this

someone else reported something similar here:
http://forum.doom9.org/showthread.php?t=96571

maye its the same issue?

Ajaja2005
1st July 2005, 20:54
I attached to this post first seconds of *.avi and avs-script. If default DS-decoder of XVID-video in the system is ffdshow , then avi plays normal, but avs-script plays too fast because it misses a lot of frames. For example, compare time of hieroglyphs appears/dissapears.

Vers.: AviSynth_050505.exe, ffdshow-20050630.exe

tritical
6th July 2005, 03:32
I was also able to reproduce this on my system using your sample file and ffdshow from july 3rd with xvid decoding by libavcodec. Unfortunately, my directshow knowledge is rather limited, but the recieve method of avisynth's directshow filter is definitely recieving samples that are discontinuous time wise (i.e. it is skipping some every now and then) I am unsure why it is happening. The file does play fine in graphedit/mpc with libavcodec decoding xvid.