I have a problem compressing audio (speeding it up while preserving pitch). I've done this quite a few times when doing NTSC Film to PAL conversions with 23.976 DivX's as source. Lately I get audio sync problems when using these files creating PAL VCD's.
This is what I do:
I extract the audio from the DivX using VirtualDub (audio direct stream copy -> Save WAV). I extract the video from the DivX using VirtualDub (video direct stream copy, change frame rate to 25fps, audio: no audio -> save as AVI). I open the 25fps avi I created this way in Virtual Dub and note the duration after going to the one before last frame (<Ctrl>+<Right> followed by <Left>.
I open the audio stream (mp3) into CoolEdit and select Time/Pitch under Stretch. I enter the duration of the 25fps video stream and let it compress. I save the end result as .wav file.
The 25fps video stream and the wav created by CoolEdit are fed to TMPGEnc to create a PAL VCD.
This procedure has worked many times. Now it's failing all the time showing audio sync problems. I've tried demultiplexing and remultiplexing in bbMPEG. I've tried converting the mp3 to wav before opening it in CoolEdit. I've tried having VirtualDub save the audio from the DivX as uncompressed wav but it crashed at 99%.
I noticed that the audio is already out of sync after CoolEdit compressed it. When I open both video and audio using AVISynth it's already out of sync. So I can imagine that TMPGEnc creates an out of sync mpg and that remuxing wont help here. The durations of both audio and video stream are exactly the same.
Does anyone recognise this and figured out how to solve it? My best guess is that it has to do with codecs. Maybe an update is needed although I can play the DivX's just fine.
Please help! I can't stand that a procedure that worked fine suddenly fails on me!
Thank you for your time,
Willem
+ Reply to Thread
Results 1 to 18 of 18
-
-
Hi
I'm trying to see if there is any advantage in converting NTSC to PAL VCD the way you are doing it.
By mistake I made a NTSC VCD and deleted the original AVI. So I also needed to convert the dat file over to PAL.
Converted the dat file to mpeg with Vcd Gear, then used TMPGEnc to convert that to PAL VCD, never stripped out any audio. Just wondering why people are stripping out the audio. -
The reason I go through so much trouble is that loading the 23.976fps avi into TMPGEnc and converting to 25fps PAL gives jerky video playback. This is viewable but annoying. Apparently "Hollywood productions" are converted in a similar way.
AVISynth has got an assumefps function where it would playback the video as 25fps and keep the audio in sync. I have had no luck trying this. I end up with only 25fps video and no audio. At the moment this is the only way to produce smooth playing 25fps VCD's that I know of. Of course I'm open to other methods so please post them if you know any.
Regards,
Willem -
Willem
I followed your procedures and I have exactly the same problem - audio out of sync. It's very frustrating. I got a few Divx movies at 23.976 fps which I want to convert to 25 fps svcd. I even tried to change the fps setting in tempenc to 23.976 and start encoding, but the end result is the same - jerky playback. In fact I am very surprised that there are no mention of this problem in the divx to svcd guide -
Willem
I think I found the solution to this problem. I finally got the thing working. The important thing here is not to load the audio file into cooledit with .mp3 extension. After you got your .mp3 file from virtualdub, convert it to .wav (I use audioactive production studio)then load it into cooledit with the .wav extension (ie windows pcm file type), then do your pitch stretching and the rest. Everything should work and the audio should be in sync.
Good luck. -
Thanks ipf123 for your reply. I tried something similar wit dbPowerAmp but that didn't work. I saw that there is a trial version of audioactive production studio. I'll see how that works. The reason may be that the mp3 uses VBR which CoolEdit (and maybe dbPowerAmp) don't handle well. The strange thing is though that when I had converted the mp3 to wav I played that stream together with the original DivX using AVISynth. It was properly in sync! After compressing it and playing it together with the 25fps video stream using AVISynth it was out of sync!
Anyway I'll try what you are suggesting and see if it works for me too. Thanks again for posting it.
Regards,
Willem -
Guess what, now that I fixed the audio sync problem, I got one more problem. The svcd movie won't play on my standalone dvd player. It plays ok on my comp - perfect video and audio. This is really weird. I did not have problem playing svcd movies on my dvd player before - until I tried to convert the divx to 25 fps to correct for the jerky playback. Any ideas?
One thing I noticed is that the size of the bin file (using VCDIMager) ia about 100Mb more that the .mpg file. My experience tells me that this is not right. Usually the bin file is only slightly bigger than the original mpg file.
-
Hi
I always assumed those jerky films was down to the original recording. Most of the Divx files are just fine, but now and then I get a Mpeg 4, its half the size of regular downloads, but I assumed the jerkiness was the number of frames that were missing.
Only Mpeg4 films are like this, all the others are good, TMPGEnc to PALVCD and burn, no problems. -
I'm glad to report I have fixed the second problem as well. What I did was I encoded the video and audio separately with tmpgenc, then multiplex them together with bbmpeg. Then bbmpeg complained about video stram and said at the end that the video might have problem. This was when I got the problem playing the mpg file with my standalone dvd player. Now instead of using bbmpeg to multiplex, I used tmpgenc and everything is working now. I could not understand why multiplexing with bbmpeg had problems. It's just weird.
-
Good to hear that you solved it. I'm still strugling. The thing is when I extract the mp3 audio from the avi and convert it to wav, the wav is perfectly in sync with the original (23.976fps) avi. So the extraction did not introduce any audiosync problems. However when I compress this wav using CoolEdit entering the duration of the 25fps video stream the resulting (wav) audio stream is out of sync with the 25fps video stream. I don't bother feeding it into TMPGEnc.
This really beats me. I've done it quite a few times before and for some reason it fails every single time using the same procedure (even on different source DivX's). Fortunately I can check between steps so I don't waste time converting out of sync source files with TMPGEnc.
I'll keep on trying until I cracked it.
Thanks for keeping me updated.
Regards,
Willem -
Willem
Could you show me how to use Avisync to check the video and audio are in sync before encoding please. Do you have to frameserve them to Avisync. How?
I just tried to convert another Divx and I have audio sync problem again. Virtualdub can rip the audio to mp3 but audioactive production does not recognise it as mp3.
Thanks in advance.
-
The program I use is called AVISynth. Download Avisynth 1.0 beta 3 I believe it's in the tools section. Copy the avisynth.dll to the windows\system32 or winnt\system32 directory and doubleclick on install.reg to register it in the registry.
Create a file test.avs using notepad containing the line:
version()
Save this file (make sure it has got the avs extension and not test.avs.txt). If you doubleclick on this file, mediaplayer should open (you have to tell Windows to use MediaPlayer the first time you double click it) and show you the version of AVISynth. Now you're sure that AVISynth is properly installed.
Now create a new avs script eg movie.avs containing these lines:
movie = AVIFileSource("originaldivx.avi")
audio = WAVSource("extractedwav.wav")
movie.audiodub(audio)
With this script you can check if the extracted mp3 from the DivX file, after you converted it to wav (I use dbPowerAmp for that), is in sync with the original DivX. Just doubleclick on the file and it will open MediaPlayer and play both streams. Then I compress the wav in CoolEdit and save it again as wav. Now I compare it with the 25fps videostream I created using VirtualDub by changing the lines in movie.avs like so:
movie = AVIFileSource("25fpsavi.avi")
audio = WAVSource("compressedwav.wav")
movie.audiodub(audio)
Again doubleclick on the avs script and skim through it to check if it's in sync.
I believe you can also open this avs script in TMPGEnc, never tried it. I select the 25fps AVI as video source and the compressed WAV as audio source.
To answer your second question. Maybe AudioActive doesn't recognise your mp3 properly because you didn't specify the .mp3 extension when saving it in VirtualDub. I had a similar problem with CoolEdit. It would only open the first 15 minutes instead of 1.5 hours it should. Or convert it to wav first.
I haven't tried AudioActive yet, but may have solved my problem. Instead of specifying the duration in CoolEdit I specified a percentage of 104.271 (25/23.976). Now it's properly in sync. Still don't know why, but it worked on two films that previously failed.
Hope this helps.
Regards,
Willem -
Willem
Thanks for the instructions for Avisync. I am just experiencing the same problem as you are, sometimes it works sometimes it doesn't. The problem must be coming from the conversion by cooledit.
You got me confused now. Isn't it that we have to shorten the audio by about 4%, how come you are saying you use a percentage of 104.271. In cooledit there are 3 settings - Preserve Pitch, Preserve Tempo and Preserve Neither. I have been using Preserve Neither on 2 movies and were sucessful. Which option are we suppose to use. -
We want to shorten the duration so we speed it up. Instead of playing it at 100% of the speed we play it at 25/23.976 * 100% = 104.271%. Basically 25fps is 104.271% of 23.976fps and the audio is changed accordingly.
Of the three settings I use preserve pitch. This way the frequencies remain the same. Apparently the human ear can't hear the frequency differences when you speed it up / slow it down <=5% so the other should work as well. You can also let CoolEdit adjust the sampling rate. I think changing the sampling rate from 44100 to 45864 would also yield a 4% speedup. This way is probably faster too. Preserving pitch is a more advanced way where you will definately not hear a difference whereas with a samplingrate increase (no conversion) the voices may sound a little higher (but since it's less then 5% you may not hear this difference at all).
AVISynth (version 1.0beta3 only) comes with the assumefps function and the option audio_sync=true. I never were able to get it to work but in this case AVISynth adjusts the samplingrate of the audiostream so the durations of both audio and video match. It might be worth to try get it to work, because it would make the whole process easier. All you have to do is create a script and tell it to play it at 25fps. You have TMPGEnc point at this script and it saves you the trouble of extracting the video and audio, speeding the audio up and put both together.
I hope this clarifies a little. I'm not that familiar with audiomatter. What I know, I've picked up from various discussions in this forum.
What I'll try next is installing a different DivX codec. There is a 3.11, a 3.2 version and a 4.0 beta version. I have the 3.11 version installed. <wild guess> Maybe the DivX films created using the 3.2 DivX codec can't be converted properly on my system with the 3.11 DivX installed.</wild guess> So I'll install the 3.2 DivX codec and try again. Maybe you can check what version you use?
Regards,
Willem -
I think the audio out of sync problem may well be because we are using virtualdub to extract the audio. Virtualdub is a great program but it has it's fair share of problems too. I have a couple of Divx movies that I had audio sync problems using virtualdub. I had success with them using Tmpgenc to extract the audio, then stretch with cooledit. May be you should try that. Anyhow converting Divx to svcd is a very frustrating process, most of the problems are audio related. I had one divx movie - I tried to rip the audio with both virtualdub and tmpgenc and both failed. The resulted audio file has muffled sound.
It would be nice if someone can come up with a fool-proof way of converting Divx to SVCD and automatically converting the frame rate as well. If you can get Avisync to work let me know.
-
I have tried extracting the audio using TMPGEnc but as far as I could see the result was the same as when extracting it using VirtualDub. Did it work for you with some films? If so what did you do exactly?
I'll do some more research on this forum and probably start a new post. This post is about compressing the audio while the real problem seems to be extractig the audio properly from the DivX.
Anyway the quest continues. If I find something useful I post it here.
Regards,
Willem -
i was having similair problems with audio sync. I posted what i do in a thread titled "Frames". Haven't had any problems since.
-
Thanks PNPman for your reply. I found the posting you're referring to. I have tried saving the audio to uncompressed wav too in VirtualDub but it crashed after 99%. Maybe the 1.4.7 version released recently can save it properly.
I read in other posts that avi2vcd comes with a utility called decompress. Apparently it can extract compressed audio form avi's and save it to uncompressed wav. I'll give it a try.
Regards,
Willem
Similar Threads
-
Syncing segments of video with audio differently (stretching, compressing)
By Kreachure in forum EditingReplies: 2Last Post: 5th Mar 2012, 11:27 -
Loss of audio sync when compressing or converting DV files on Mac
By Sloperman in forum Newbie / General discussionsReplies: 2Last Post: 6th Mar 2011, 09:26 -
Compressing Audio
By Bacender in forum Newbie / General discussionsReplies: 4Last Post: 15th Jan 2009, 01:46 -
Batch Dynamic Range Compressing and Normalising audio for video files?
By dahouse in forum AudioReplies: 4Last Post: 15th May 2008, 16:30 -
problem with compressing HDV clips on Mac?
By elizavetaka in forum Camcorders (DV/HDV/AVCHD/HD)Replies: 3Last Post: 14th Oct 2007, 23:38