English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 01 July 2003, 14:02   #1
trance007
 
Posts: n/a
Sound get un-synchronized from video on AVI

This was first discussed on a previous tread, but here is the current state :

I am trying to record the Desert Dream demo to AVI to burn it on a DVD, to remember the past with friends.

On the recorded AVI, the sound get unsynchronized of the video.
It is not just a matter of starting the audio some ms before or after the video.
At start, the sound IS perfectly synchronized with the video, but the much longer the video, the much delay I get.

After 10 minute, I have a delay of about 2 seconds.

Of course, this can be fixed by adjusting the framerate in Virtualdub, but then I'll lose the frame rate needed for DVD compatibility.

It can also be fixed by compressing the audio for 1 or 2 seconds, but I think this problem actually lies on a bug in the AVI recording routine.

When playing the demo without AVI recording, the picture and sound are perfectly synchronized...

It looks like more PCM data are sent to the AVI file than to the soundcard.

I tryed using uncompressed RGB / PCM audio and DivX / MP3 -> same delay on both file.

Does other people experience the same problem ?

Any help, suggestion, Toni point of view is welcome.

Last edited by trance007; 01 July 2003 at 14:07.
 
Old 01 July 2003, 14:35   #2
Echo
Registered User
 
Echo's Avatar
 
Join Date: Jan 2003
Location: South-West Wales
Posts: 382
Perhaps you missed my reply in the old thread before creating this one?
Echo is offline  
Old 01 July 2003, 17:42   #3
Phiber
Hardware Freak
 
Phiber's Avatar
 
Join Date: May 2002
Location: Helsinki / Finland
Age: 50
Posts: 222
Send a message via MSN to Phiber
Have had similar problems myself earlier with sound out of sync..

Here are a few tips i'd suggest you try out

what/which codecs do you use?

if there are more than one or two mp3-codecs in your system, get rid of the extras, because sometimes windows reverts to a crappier codec found on system which might need to resample the sound data, resulting delay in the sound

I'd definately advice against installing codec-packs found on the net like Nemo's and Tsunami.. Usually they are the easiest way to screw up a perfectly working system (i have seen this many times)

Check out the Codec priorities
Phiber is offline  
Old 02 July 2003, 05:45   #4
7-Zark-7
Zone Friend
 
7-Zark-7's Avatar
 
Join Date: Aug 2001
Location: Brisbane/Australia
Posts: 1,270
Lightbulb

Just a thought, what drive are you actually capturing your AVI file to? Capturing to the system drive wouldn't be helping matters.
7-Zark-7 is offline  
Old 02 July 2003, 10:54   #5
trance007
 
Posts: n/a
Echo: I see your reply and, as I said in the begining of this tread, modifying the framerate (from 50 to 49.8 or so) WILL fix the problem if you watch the AVI file on a PC, but I want to put the video on DVD, so the framerate MUST be exactely 50 fps (interlaced).
But thanks for the help

7-Zark-7: I am saving in a different drive, but this should not matter, as the AVI is not rendered using a real-time capture.

I tryed with different codec combination (Uncompressed RGB and uncompressed PCM audio) and (DivX and MP3 using Radium fraunhaufer professional MP3 codec) and the delay was exactely the same, so I don't think it could be caused by the codec configuration.
Anyway, I only have one MP3 codec, the MP3 professional (Radium) and I never installed any codec pack (never do this!).

Better solution to fix this problem would be to compress the sound for 1 or 2 second, but all this are workarounds for a problem that actually lies in the emulator himself.

I would like to convince the author that the audio length saved in the AVI does not match the picture quantity.

In a normal situation, using 50 fps and audio at 48000 Hz, I should have 960 audio samples by picture, and if you look at the AVI file, you'll notice that you get about 962 audio samples by picture...

Considering there are no delay when watching the demo in real-time, the last thing I can do is capture the audio data send to the audio adapter, using TotalRecorder, and compare it to the audio saved to the AVI file.

Maybe the problem is actually that there are not enough picture rendered ???

Thanks to all the persons that give suggestions, but I am more and more convinced this problem lies in the emulator himself, or the AVI recording routine.

I'll do my bet to discover the real problem, but at the end, I'll need the author help to fix this in the emulator (Toni?)
 
Old 03 July 2003, 03:29   #6
Phiber
Hardware Freak
 
Phiber's Avatar
 
Join Date: May 2002
Location: Helsinki / Finland
Age: 50
Posts: 222
Send a message via MSN to Phiber
Quote:
Originally posted by trance007
Echo: I see your reply and, as I said in the begining of this tread, modifying the framerate (from 50 to 49.8 or so) WILL fix the problem if you watch the AVI file on a PC, but I want to put the video on DVD, so the framerate MUST be exactely 50 fps (interlaced)
ehh??

The standard framerate for a PAL-system video is 25fps.. (even on DVD) (interlaced or not) and NTSC-systems are normally 29.970 fps

If the capturerate is too high, most software start dropping frames in order to keep up resulting choppy playback and in your case those audiosync problems
Phiber is offline  
Old 03 July 2003, 09:07   #7
trance007
 
Posts: n/a
Actually, I capture at 50 fps half vertical size, and then I interlace the picture to 25 fps full vertical size using AviSynth with the following commands :
--------------------------------------
AVISource("DesertDream.avi")
AssumeFieldBased
Weave
--------------------------------------

But even when capturing at 25fps from WinUAE, I get the same sync problem
 
Old 15 August 2003, 00:31   #8
BippyM
Global Moderator
 
BippyM's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
Was a solution found as I seem to be having the same problems

This happens with most of the stuff I have done
BippyM is offline  
Old 17 August 2003, 00:27   #9
trance007
 
Posts: n/a
Actually, it seems the WinUAE author don't believe me as I never got any reply from him.

It's sad, because I am myself a software engineer and I now what I am talking about.

This problem is NOT caused by a bad codec configuration at all!
It's caused by a mis-synchronisation of the audio and video rendered by the emulator!

Here is a work around that should work, but I never tryed it myself :
1. In WinUAE, under the "Sound" tab, set the audio frequency to 47900.
2. Save your video in AVI, with audio saved as uncompressed PCM at 47900 khz (very important!).
3. Demux the audio to a WAV file.
4. Open the WAV file in Cool Edit Pro and adjust the sample rate to 48000 ("Edit" -> "Adjust Sample Rate").
5. Save the WAV and remux it with the AVI file.

To mux and demux I suggest you to use VirtualDub.

You should do some test, maybe 47900 is not 100% accurate, it's maybe 47899 or 47901 ?
It's tricky to get the exact value, I have to do some deeper tests.

Let me know if it solved your problem.
 
Old 17 August 2003, 00:29   #10
BippyM
Global Moderator
 
BippyM's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
I have it fixed

And this demo you tried took up 11+gb when I ripped the avi, once it was put back together and compressed to Mpeg2 (no sound as that is ac3) it takes up about 235Mb!!

The audio is 100% perfect
BippyM is offline  
Old 17 August 2003, 12:40   #11
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
AVI sound syncro problem was fixed 2 days ago...
Bippym has been testing the fix and it seems it really works

trance007: sorry for not responding but I wasn't originally interested in maintaining avioutput code..

btw, adjusting sound sample rate probably helps but it won't fix it 100%.
Toni Wilen is offline  
Old 17 August 2003, 17:50   #12
trance007
 
Posts: n/a
Well, thank you very much for taking time to investigate this synch problem, Toni

Is the fixed version already downloadable somewhere ?

Just for my personal curiosity, what was the cause of this problem ?
 
Old 17 August 2003, 20:47   #13
Titler
Zone Friend
 
Titler's Avatar
 
Join Date: Nov 2002
Location: UK
Posts: 303
Rather OT but...

Regarding sound syncronization, if you'd be so kind...

I've recently started converting movies to .avi files, and thus getting larger files than I would normally be playing; files of 200Mb upwards seem to play out of sync (the audio lags behind) in RealPlayer, MP9 and Intervideo WINDVD. However, when opened in Properties > Preview they play perfectly synced. I can play them synced in VirtualDub too, but when ever I try and remake the file, I just end up with a much, much larger version (as I don't seem to have a codec which will keep the compression as is). Can anyone explain is simple words how I can sort this problem out (and tidy up codecs too)?

Cheers!
Titler is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Video and Sound doesnt match (video output) hipoonios support.WinUAE 8 26 July 2009 00:25
Recording video - occasional "doubled" like frames in avi output Photon support.WinUAE 12 16 March 2008 23:06
When i Enable Vsync, audio is not synchronized cybermat support.WinUAE 5 07 January 2008 22:10
Again sync problems with sound in video Pokemoz support.WinUAE 5 15 December 2004 23:20
AVI capture sound sync problem (even using 0.8.22 Release 9) trance007 support.WinUAE 6 03 September 2003 12:37

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 +2. The time now is 18:18.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.21786 seconds with 15 queries