Forum Archive Home -> User guides -> How to fix gradual loss of sync once and for all
How to fix gradual loss of sync once and for all | ||||||||||||
| Acidagent posted 2003 Jan 29 22:30 | ||||||||||||
| Ok i guess this topic has been covered quite a few times. So i'll try and make it quick.
Now Phat J's guide did give me some clues, but he overlooked a simpler, more accurate and quicker solution. I guarantee and promise this will work. Basically you need to resample rather than compress or expand the time. The example I've done here works for MPEGs but you could apply the same methods for AVI files. Unbeknownst to most people I should imagine. Sound cards suggest they are record at 44.1KHz. Well in most cases they probably do. However, sometimes they don't quite sample correctly and are off by about 0.005KHz. This is what causes your gradual sync people. Some guitarists may recognise this if you have a software tuner. You need to calibarate the soundcard to get the perfect tuning. The method will also work with VHS captures too, even if you capture other sources and they are in sync. Is everybody in, is everybody in, so let me begin. You will need: Sonic Foundry's Sound Forge or Cool Edit (Both are available as demos) TMPGenc VirtualDub 1. Similiar to Phat J's guide Use VirtualDub to find a time in the video to find a noticeable sound. It helps if you can lip-read but it's not essential. Make a note whether the sound is behind or before the video. Here I've found a frame from the Let It Be film, where John is going to sing the word "Seeeeee" from the song I've Got A Feeling.
Jot the time down, in this case it's 1:16:22.891. The audio is ahead. 2. Use TMPGenc and under MPEG Tools to demultiplex the MPEG file into two separate files. So in this case it would Let It Be.m1v for the video and Let It Be.mp2 3. Open your audio file in Sound Forge (This may take a while if it's huge) and find your jotted time. Play the sound and note the where it's playing.
Here you can see the beginning of the "Seeee" peak and the audio is about 0.939 seconds ahead out of sync. 4. Now here's the amazing part. Instead of expanding or compressing the sound, we're going to adjust sample rate of the sound instead. Under Process you will find an option called Resample.
Make sure you only set the sample rate first only. Here i've added 9Hz because the sound was ahead so it needs to be played ever slightly more quickly. Reduce the sample rate if it's behind. You'll have to tinker with the sampling rate, but you'll find that adding 1 Hz will reduce about 0.1 seconds off over an hour. Don't worry about the pitch change, it's doesn't make a difference due to such a small change.
Now you can see i'm only 0.002 seconds out. This is alot more accurate than the time expand/compression utility. Not only that, you don't have to render the effect to preview, so you don't have to wait ages if you've got a big file. Some soundcards won't play at 41,109Hz but this really isn't a worry. 5. Once you've found the correct sample rate, you need to resample. So this time go back to Process and Resample and clear the box that says: "Set the sample rate only(Do Not Resample") and adjust the new sample rate to 44,100Hz. You don't need to apply an anti-aliasing filter, the resampling difference is so small to justify the time taken to apply the filter. Once you've set it it will start to resample which may take a while. Now you can see your sound is at 44,100Hz and the sync is damn as near correct as it can be. No amount of time expanding/compression can get this close. 6. Now all you need to do is save the file. You'll have to save it as a Wave File at 44,100Hz Stereo unfortunately, which means mega space, but it'll be worth it. 7. After you've saved it, use TMPGenc to change the wav file into an mp2 file.
8. Use TMPGenc again and goto MPEG Tools and select Multiplex. Here it would be Let It Be.m1v as the video and Let It Be.mp2 as the audio. Choose anything you want as the output file( well make sure you end it .mpg or mpeg) 9. Enjoy your newly synched video. 10. Praise me for wasting hours trying to sort this out once and for all. I really do believe you can't get any more accurate than this method and it works with humungous files. So to cap off, blame the soundcard, it's not recording at the correct sampling rate it's supposed to. The soundcard in this case actually records at probably about 44,109 to 44,110Hz. Perhaps video capturering software needs to use an audio calibrating utility like guitar tuning software does to help with the sampling rate and synch. Thanks to Phat J for spurring me a bout of inspiration and thanks all for those in sync-hell. Welcome to uniformity. Yours in humanity ACID Agent | ||||||||||||
| Acidagent posted 2003 Jan 30 12:15 | ||||||||||||
| /me is sad :( no one's praising me for my fantastic efforts in audio department. I should get some Nobel award for this research. We should have VCDHelp medals. | ||||||||||||
| donpedro posted 2003 Jan 30 13:41 | ||||||||||||
| I will try it ;-) I will try also that another option :) | ||||||||||||
| Acidagent posted 2003 Jan 30 15:47 | ||||||||||||
| That is most kind sir, tell me how you get on, i'm sure you'll be pleased with the results. | ||||||||||||
| edwags posted 2003 Jan 30 19:11 | ||||||||||||
| your info looks great. im not very audio knowledgeable. i use cool edit and goldwave any chance you could show how to use one of those? also im not sure of the difference between playback rate and resampling. i tried it with goldwave now my wav is 44090 which i presume wont work as a svcd. thank you ejw | ||||||||||||
| BJ_M posted 2003 Jan 30 19:16 | ||||||||||||
| well - its a nice guide you wrote but i mentioned also you can just load the mpeg file (audio and video) into soundforge and view both together (vegas is even better for this) and adjust your audio .. then save out only the new wav (or mp2 file) .. | ||||||||||||
| lpn1160 posted 2003 Jan 30 19:33 | ||||||||||||
| where was this guide when I was capping with a USB capture device?? :wink: Then my audio was always out-of-synch.
Since I bought a PCI card and cap to .avi instead of mpeg2 I haven't had the problem since!! But should I ever run into that problem again I have your guide. Good-job, Well done!!!!! | ||||||||||||
| Acidagent posted 2003 Jan 30 20:14 | ||||||||||||
| EJW, it looks as if you're getting somewhere. You're right in saying that at 44090Hz it won't be SVCD compatible. I've just downloaded Goldwave.
[EDIT]See my post below about the whole Playback rate issue. Although it really shouldn't be called Playback rate. It may confuse you more, but if you just want to do the job just read below. To permenantly change the audio file for compatibility and to get it into sync, the first thing you should do in Goldwave is set the "Playback rate" to 44090Hz. Next click Resample and change that to 44100Hz. It should then render the file so that the "correct" recorded sample rate of 44090Hz will be upsampled to the compliant VCD/SVCD sample rate of 44100Hz. The timing will stay the same as 44090Hz, but it will now be a legitimate 44100Hz audio file. Now save your file as a wav file. Sorry if i've explained that really poorly. I'll give you another example. In ye olden days of computing audio recording was limited to recording at 22500Hz. The quality of 22500Hz recordings is half the quality of a 44100Hz recording. So if you were to set the playback rate of your 22500Hz file to 44100Hz it would play the file at double the speed although the file would still remain a 22500Hz file. If you were to immediately resample the file, then the 22500Hz would be converted to 44100Hz without the change of speed. If you set the playback rate first and then resample it, you would end up with a file that plays double the original speed and 44100Hz. BJ_M i didn't even bother at first trying to open the MPEG in Sound Forge or Vegas!!! I overlooked that one. Can you adjust the playback rate of the sound only and then resample it in Vegas. I'll have a look when i get back to my computer tomorrow. The only problem i can predict is that Vegas will have to encode the whole mpeg again, but i guess this might solve a error message i got in TMPGenc when i multiplexed. I'll try to remember what it said, but it worked fine when i played it back. Sorry Lpn1160.. twas never destined for this guide to come to light any earlier or later in time. Or maybe i was just a lazy bastard :wink: I've only really got into video encoding, it's time to get rid of my Hauppauge PCI Card, the quality is pretty terrible for previewing and/or capturing. I wanna watch decent quality TV on my new 17" IIyama LCD screen!! | ||||||||||||
| BJ_M posted 2003 Jan 30 21:17 | ||||||||||||
| no -- dont touch the mpeg file in vegas or soundforge .. your just adjusting audio , render out the audio file only ... the video is loaded in there for refrence only ..
demultiplex existing audio and re-multiplex with new audio after btw -- sample rate has NOTHING to do with playback rate .. you are only tricking the audio decoder on how many sample bits are in a stream .. many decoders just would not play . audio is normally 30fps NDF but you can change that .. 30fps still plays at the same speed as say 24fps .. , just that there are 24 pictures instead of 30 every sec.. audio - the same thing .. except with audio you can more easy to stretch or shrink it .. sample rates should not be changed for a number of reasons except if nessessary between 44.1 and 48 ... | ||||||||||||
| edwags posted 2003 Jan 30 23:16 | ||||||||||||
| thanks for all the info i will play around with this on sat. ejw | ||||||||||||
| Acidagent posted 2003 Jan 31 00:34 | ||||||||||||
| BJ_M - I've edited my fourth post to make things a bit clearer. I don't know if it's just me, but I don't think you understand :-? . The finished file ends up as a 44.1KHz audio file. Complete compatibility. The decoder will see it as a 44.1KHz file.
44090Hz was what the audio was really recorded by the soundcard but encoded at 44100Hz and so hence it goes out of sync. So we need to set the sample rate back to 44090Hz and then upsample and encode it from that to 44100Hz. The "playback rate" at 44090Hz will seem to "play" slower(although it really always plays at the same speed of 30 fps) when actually the audio has been expanded(if you saved the file now, it would be a 44090Hz file and incompatible)!!! However Goldwave is tricked into thinking it now has a sample rate of 44090Hz. Since Goldwave now thinks the sample rate is 44090Hz you can now upsample from 44090Hz(which is taken from the adjusted "playback rate" in Goldwave) to 44100Hz. You end up with a file which is 44100Hz, in sync and compatible. I agree playbackrate is a totally different thing. Goldwave is a bit silly really, instead of calling it the playback rate, they should change it to "set sample rate only" instead, to clear things up like Sound Forge. Playback rate to me suggests 1x 2x speed settings, rather than using Hz. I hope this clears a few things up. BJ_M i don't know if you believe me, but i promise you what i'm doing is 100% compatible and in-sync. Maybe i'm just not explaining it well enough. | ||||||||||||
| BJ_M posted 2003 Jan 31 00:51 | ||||||||||||
| ok my error then -- i didnt understand and perhaps didnt read your post through enough ...
don't get me wrong either ... its great that you have taken the time to put this together and worked it all out ... very nice work .. | ||||||||||||
| drewson99 posted 2003 Jan 31 00:57 | ||||||||||||
| vcdhelp medals, heh. i second that motion. | ||||||||||||
| Acidagent posted 2003 Jan 31 15:34 | ||||||||||||
| Thanks BJ_M i knew we'd get there eventually. Explaining sampling is not the easiest subjects to deal with. | ||||||||||||
| vitualis posted 2003 Jan 31 16:03 | ||||||||||||
Actually, there are many other reasons for gradual sync issues -- codec problems, muxing problems, etc. Unless you have a capture card that locks the video clock and audio clock together, you will often have drift between the video and audio. This isn't necessarily a problem, however, as a good capture program (e.g., VirtualDub) will drop the necessary frames to keep A/V sync... As for "awards", the mods have suggested creating a "karma" rating system... However, it is not that easy to implement. Until it actually comes into being, I give you positive karma points for you guide! ;-) Regards. | ||||||||||||
| Bizuser posted 2003 Jan 31 19:29 | ||||||||||||
| Acidagent - I came across this guide, and subsequent thread, because you posted in a thread I was participating in. You pointed people over here to solve audio drift problems. My issue is that I get audio 'drift' (starts great; ends up 2 seconds out after 30 mins), so I came over here to read your guide.
My situation is that I can capture video at 352x240 using ATI, direct to MPEG 1; The MPEG1 file plays great in ATI file player - no synch issues. I can also author the mpeg file as VCD using VCDEasy and get a decent VCD file that plays on my standalone. Then I tried to capture video at 480x480, direct to MPEG-2. The MPEG 2 file plays great in ATI file player - no synch issues. When I author this file to SVCD, I get lots of errors (encoding errors). I then demux/remux using TMPG, author as SVCD (no encoding errors), and get an output file that has the audio drift. So - referring to the post of the moderator, and your posts/guide, would you think I'm experiencing the problem you are addressing (poor clock / timing attributes of the audio stream), or, problems with the codec, muxing problems, etc? My hunch is that I'm experiencing Muxing or codec issues, since my audio is in synch on captures with certain settings. Only falls apart when I capture to MPEG2, and/or at certain settings, and process the files. Of course, I'll give the audio cleanup a shot. I have beSweet - that should be usable, should it not? I'd rather not learn yet another audio program!! Thanks for the guide. | ||||||||||||
| Acidagent posted 2003 Jan 31 23:26 | ||||||||||||
| Vitualis - Yep you're right, i was a bit carried away with the moment thinking i found the sole cause to gradual sync problem :lol: But resampling should help a lot of people out whether it be the soundcard or the codec, etc. We all need aid to get us some decent capture cards.
It's about time i got some good karma, although it worries me cos now i've got good karma somewhere along the line will come the bad karma :D Bizuser - I'm guessing that its ATI's MPEG2 codec which is a bit buggy when it comes to compliancy. The same goes for Cyberlink's too in PowerVCR. I think it's probably down to them trying to save processing power or cutting corners because they capture in realtime but their players can regonise and correct this. I've had a look at beSweet and it doesn't look the most useable of programs but it's in its early days by the looks of things. beSweet seems to be more of a channel converter. You really need to see the data to see where the sound fits in. I really suggest you try the Sound Forge Demo or Goldwave demo. Personally i'd go for Sound Forge but Goldwave is a lot smaller and quicker to download. | ||||||||||||
| mazinz posted 2003 Feb 01 14:34 | ||||||||||||
| thanks for the newer info this would expalin a lot. Actually i have heard of this before and if you use soundforge to cpature it has the option of properly caliberating your sound card to fix any speed problem it migt have.
i just did 2 dvd projects and had 2 audio tracks for each. Long story short, i have soundblaster 2k and it has the rate at 48k for dvd, anyway whatever i ran in would NEVER properly sync up to the video source already on my pc or the other sound itself. it was driving me nuts and i did some side by side to make sure my source and sound were playing the same speeds which they were. thanks for the info check on the resample rate to fix that issue. | ||||||||||||
| Valnar posted 2003 Feb 01 17:50 | ||||||||||||
| My 2 cents for analog source captures:
Of course, one way to fix sync is to capture it in sync in the first place! PCI drift is definitely caused by the fact the sound card and video capture board (or USB, or whatever) aren't keeping track of each other with any time code. So you need software to do it for you. If you use Windows 9x, then AVI_IO is the best program. It drops or adds blank frames to adjust for the sound drift. If you have Win2K/XP and all WDM driver based hardware, then the best capture app is Virtual VCR at www.digtv.ws. It can resample the audio dynamically to keep sync with the video. We're talking less than .01% so not even somebody with perfect pitch can hear the difference. The only other 32-bit Windows program that keeps audio in sync correctly is Showshifter, but its not freeware. I capture all my VHS tapes with VirtualVCR. As long as you set it up right, then you'll have perfect captures every time. Proper settings under the AV tab are: * Check: Resample Audio & Resample audio dynamically * No Check: Adjust Stream Offset -Robert | ||||||||||||
| dark_knight_br posted 2003 Feb 02 10:03 | ||||||||||||
| Hey!
What should I do if my synch problem is the video, not the audio? I have a video at 24.021 fps and I have to convert it to 29.97 fps, so I can watch it in my standalone dvd player. And doing the conversion, the video becomes like 15 minutes shorter. I can easily fix the audio to match that lenght and have no synch problems. But that video is a concert, and that change in the lenght really screws it up. So, how do I convert the framerate without changing the lenght? | ||||||||||||
| kenmo posted 2003 Feb 02 10:20 | ||||||||||||
I could not agree more. VirtualVCR is the best capture program bar none. I've been using it since Christmas and I capture at least two hours of video daily (Star Trek Voyager shows on two stations in Halifax daily) and I only had one instance where video was out of synch. This was due to audio noise during the shows broadcast. This is one awesome piece of software. Strongly recommend it. Getting the best results ever from my ATi TV Wonder (pci version and not VE version). | ||||||||||||
| mazinz posted 2003 Feb 02 16:33 | ||||||||||||
| for the record my card is the dazzle 2 (dvc2) i also have a tbc so my issues are not cpaturing. Sometimes i ripped a certain dvd and looked at the aiudio, yours truly made some commentaries for my own benefit to add on the actual disc. So iwould just run in the sound as thats what was only recored (via the mic input, as its just me tlaking), but i have eveerything on key and due to the sound card it would throw off the sync and now i know why | ||||||||||||
| Bizuser posted 2003 Feb 02 18:04 | ||||||||||||
| (I'm the poster who complained of audio synch problems with ATI AIW, using direct-to-MPEG2).
Yesterday I experimented with adjusting the audio stream. I used 'WLA' (wavelength adjust), and found that my audio and video were finally in synch - but the process for me is tedious based on the tools I'm using (demux; convert audio to wav; adjust length of audio; convert back to mpa; remux). I know it could be easier if I used recommended tools, but anyway I proved the point. FYI, for me, I adjusted from 44100 to 44200, NOT to 44095 - but it seems somewhat random. Rather than go through this whole process (since I also have difficulty cutting these native mpeg2 files) ... Today I experimented with both PicVideo MJPEG and Huffyuv codecs in VDub. While the Huffyuv results were very good, the size is extremely large. MJPEG, at setting '18', seems to be giving me great quality AND manageable sizes (2 gig for 20 minutes). I then use avisynth to frame-serve the AVI to TMPG. So at this point, I'm thinking of giving up on the MPEG2, even though it's great compression and good video quality. Now you bring up virtualVCR ... I'll definitely give it a try. I see, from reading the website, that it too requires/recommends MJPEG or Huffyuv codecs; so ... if I'm getting good results with Vdub+MJPEG and Huffyuv, what may I expect that's better with virtualVCR? From reading here, I'm guessing that VirtualVCR adds the audio clock-synching feature. Ironically, I don't seem to be getting audio synch problems in the first place once I use VDub! Thanks everyone for the help! | ||||||||||||
| Bizuser posted 2003 Feb 02 18:13 | ||||||||||||
Dark Knight jr:
There are many 'standard' ways to handle this. The most common is to set a 'pulldown' flag in the output stream. TMPG can do this. Thus, no adjustment of the video is really required. Click 'settings', then on the 'video' tab, click 'encode mode', and select 3:2 pulldown when playback. If you are making VCDs, you don't even need to do the pulldown flag - VCD standard actually supports 23.976 natively. But if you want SVCD, you must set the pulldown flag, which 'fakes out' the player to think it's got a 29.976 stream. Actually, the mpeg stream 'instructs' the dvd player to repeat a frame every now and then. This is now movies (in US/NTSC)are stored on DVD - stored at 23.976, played back at 29.976 due to pulldown - thus you get better use of the bandwidth on the dvd. | ||||||||||||
| Bizuser posted 2003 Feb 02 23:39 | ||||||||||||
To Valmar and Kenmo:
I just downloaded VirtualVCR and tried it. When I preview, I get sound but no video (black screen/window). I have the ATI All-In-Wonder 128 card. I notice, on the VirtualVCR web page, a list of supported cards and 'All In Wonder' is not mentioned. At least one of you guys say you have ATI TV wonder - which is supported (actually, to be accurate, the listing is for cards supported by the WDM Open source driver, which supports BT8*8 chip). So is the AIW 128 specifically excluded by any chance? I will do more research of course, but I'm just wondering if you know the answer off the top of your heads - it's been a long weekend and this is just 'one more thing' to figure out! Further searching of the web, and looking at my setup, suggests I have a 'Rage Theater' tuner, not a BT8*8 tuner chip. Is this a problem for Virtual VCR? I verified I have directX 8.1. I can use virtualDub, and the 10 or so :wink: other programs I've been downloading and testing with ... so I'm not too suspicious of out of date stuff - but could have conflicts at this point! (EDIT) - well of course, right after posting this, I gave it 'just one more try' and ... got it to work (of course...!). The trick was to 'scan' for channels in the tuner tab. For whatever reason, I didn't need to do this in VirtualDub - it just 'saw' the channels already scanned by ATI tuner. Anyway, once I scanned, I could preview channels and now I'm recording!! (why, I wonder, could I hear audio, even before doing this...?) Oh well... (end edit) | ||||||||||||
| Acidagent posted 2003 Feb 03 01:07 | ||||||||||||
I'm not quite sure what you mean here, are you saying that 44095 is significant?I don't understand why you highlighted "not". Changing it to 44200 will make the audio slightly shorter. As for the randomness, perhaps you're not setting the sample rate first and then resampling that back to 44100. What program are you using? If you're getting random figures by using the same varibles then i'd definitely say it was a software problem or limitation. I definitely agree that it's a lot better to deal with the problem before you capture. It's just a shame that you have to re-encode to MPG and the amount of disc space avi's take although 6 GB/hour doesn't seem too bad in the days of 200 GB hard disc drives. But the end quality will be much higher even when it's converted to MPEG2, just don't use ATI's program to covert it. I'd love to encode real decent quality MPEG2 files in realtime and in sync, but i still think it requires a lot more ooomph than they(ATI, Cyberlink, Intervideo)say and their software still need to sort out quite a few bugs out. It's a real shame, it'd save a lot of people's time to spend on something else, but with MPEG-4 hardware players coming out, i should imagine they will head towards that direction. | ||||||||||||
| Bizuser posted 2003 Feb 03 14:24 | ||||||||||||
Valmar/Kenmo - so I succeeded in getting VirtualVCR installed, and did some test recordings. To my surprise, the audio synch was quite bad! I double-checked all my settings, made sure I was resampling the audio dynamically
I made several 20 minute clips. The audio synch starts out good (first few seconds) but then almost immediately goes to hell (30 seconds into clip!). Retested several times. Went back to VirutalDub (using same video compression settings - Picvideo MJpeg), got very good results again. I'm sure you guys are right, in that VirtualVCR will do a great job; I must be missing a setting somewhere! Do my symptoms suggest any obvious error? Thanks! | ||||||||||||
| duhmez posted 2003 Feb 06 16:50 | ||||||||||||
| Just to straighteneveryone out who may take wrong info out of here.
NTSC is 29.970or, even more specifically, 29.9706 (Note the zero) Not 29.976 NTSC FILM is 23.976 (Pulled down to 29.970) | ||||||||||||
| eric5417 posted 2003 Feb 06 17:38 | ||||||||||||
| when i open up sound forge and try to open up the music file, it says i need a proper plug-in and to get it i have to buy something. is it okay if i just use the wav in soundforge that i got from virtual dub? | ||||||||||||
| rabiee140 posted 2003 Feb 09 21:03 | ||||||||||||
| I'm wondering the same thing eric. The problem is when i load my .wav file, there is no audio with some programs. It will play in Windows Media Player, but not with Musicmatch Jukebox, and when I load it into Sound Forge, it appears to have no audio to it. Are you having that problem? | ||||||||||||
| BJ_M posted 2003 Feb 10 07:51 | ||||||||||||
| w/ soundforge , you need the mpeg plug in ... that plug in is good for all sonic foundry products .. | ||||||||||||
| giantsquid posted 2003 Feb 12 21:56 | ||||||||||||
| How do I obtain the mpeg plugin for soundforge? | ||||||||||||
| freqge posted 2003 May 06 10:11 | ||||||||||||
| Anyone out there acutally try this????
Sounds like a great idea so I got sound forge 6.0 and actually got the mpeg codec for it so I could easily and accurately determine the delta time thing.... So anyhow I have noticed that step 4 is not working as advertised for some reason. As I adjust the sample rate I do experience a change in the speed of the audio....but.....this change in time is not at all reflected on the time table.......so when my "flagged" noise is at 1:41:53.342 and I adjust the sample rate up I do actually hear it earlier but the time table still reflects the same time.... Do I have some setting wrong? I have looked but have found nothing odvious........ Thanks in advance!!!! | ||||||||||||
| wadster posted 2003 Jul 02 01:07 | ||||||||||||
| :? Same problem here. Step #4 seems to not be working for me. I don't know if a settings thing or what. Help please!!! | ||||||||||||
| Scienide posted 2003 Jul 02 07:52 | ||||||||||||
| Ok people i have nailed this problem on my computer. Maybe this will work for you too.
I tried all of the above techniques but to no avail. I decided to do a bit of trial and error. My audio was only slightly out of sync with the video and it was a gradual loss of sync. Towards the end of the mpeg file my audio looked and sounded dubbed like a chinese kung fu flick. :cry: So i opened my Mpeg2 (SVCD) file in DVD2AVI and then saved the project leaving me with the DV2 file. I then opened this file in Tmpgenc but instead of opening the seperate audio file aswell I used the original Mpeg2 file as the audio track. Then in the advanced settings (the one where the source range box is) i checked the bottom box. The framerate box.
Then i encoded the file as normal. The result was as follows: My final Mpeg1 file was an exact replica of the original Mpeg2 file (obviously with a little less quality) and the audio was in perfect sync all the way through. I've now burnt this to a disc and watched it prefectly with no complaints. This method was acheievd when trying to convert an SVCD to a VCD. but theres every chance it might work with other source files so i suggest you give it a whirl. :D I'd be interested to know if anyone else has any success with this. Its saved me loads of trouble. :D | ||||||||||||
| DustyCat posted 2003 Jul 08 09:41 | ||||||||||||
| I had a problem with the demo of Sonic Foundry Sound Forge 6. When I attempted to open my mp2 file, the program appeared as if it would freeze and then I received an error message which said this:
"An error occurred while opening one or more files. The requested plug-in does not have the necessary features unlocked." Any idea what I can do about that? | ||||||||||||
| BJ_M posted 2003 Jul 08 13:09 | ||||||||||||
mpeg2 functions do not work in demo versions -- you have to buy it .. | ||||||||||||
| DustyCat posted 2003 Jul 08 14:55 | ||||||||||||
| Ok thanks for the help, so that means there is no other program I could use in place of it?
The person who made the guide made it sound like using the demo would work fine. I need to fix gradual sync problems with the audio, and I was wondering what other programs I could use in place of Sound Forge 6? | ||||||||||||
| DustyCat posted 2003 Jul 08 15:04 | ||||||||||||
| Hi I know you're not supposed to reply to your own topic right away but I saw something I had not earlier seen.
The file I tried to open in Sound Forge was an MP2 (audio) file not an MPEG-2 file. The file was definitely MPEG-1 because I had JUST converted SVCD to VCD before the audio gradual sync problem occurred. So now that I cleared that up (because the person who replied to me originally said that Sound Forge didn't support MPEG-2 in the demo version) I wasn't using MPEG-2. And all I know is that the guide said to load the mp2 file (that's just the audio file, seperate from the video) into Sound Forge and I got that error message: "An error occurred while opening one or more files. The requested plug-in does not have the necessary features unlocked." Any idea what I can do? I am not using MPEG-2 files tho! Just letting ya know! | ||||||||||||
| BJ_M posted 2003 Jul 08 15:44 | ||||||||||||
| mpeg1 also doesnt work in demo mode (i believe - im am pretty sure) | ||||||||||||
| DustyCat posted 2003 Jul 08 17:50 | ||||||||||||
| Ok, so my problem still exists. I need a way to fix the audio on this MPEG-1. It's odd though because the audio starts off as what seems like maybe a half of a second too early, but by the time like 5 minutes or so goes by, even less, like three minutes...the video has wound up very far behind the audio. So this is my dilemma. I want to use the guides posted to fix my problem, but you see my original problem is that I need freeware, or at least shareware that will allow me to load my mp2 audio file.
Any programs I can use in place of Sound Forge that have usable demo versions? | ||||||||||||
| DustyCat posted 2003 Jul 08 23:03 | ||||||||||||
| so then what program should i use in place of sound forge? freeware please, or shareware that allows me to play MPEG-1. | ||||||||||||
| SoupStain posted 2003 Jul 09 00:29 | ||||||||||||
| Acidagent,
Thanks for your clear thinking. I had never thought about why the audio would drift out of synch before. Now it all makes sense. I got so fed up with the synch problem that I stumped up for one of the AVDC-100 units to use for my captures. SoupStain. | ||||||||||||
| jwehby posted 2003 Oct 28 02:15 | ||||||||||||
| ACID Agent,
Thank you for the clear instructions. In following your directions I stumbled on a way to take one program out of the process. Steps 3 thru 6 can all be accomplished in VirtualDub. Step 2 will need to be altered. It can be done in TMPEnc or VirtualDub. Let me see if I can detail the process: 2.a. In VirtualDub (I have release 1.5.6), under the File pulldown, select Save WAV. Then under the Audio pulldown, select No audio. Under the File pulldown, select Save as AVI. or 2.b. In TMPEnc, under the File pulldown, select Output to file-->WAV file. Then under the File pulldown, select Output to file-->AVI file and uncheck the audio box. 3. Open de-multiplexed video file in VirtualDub. Select the Audio pulldown -- you will see that Source Audio is the default setting. Select the WAV Audio... option. Immediately, a dialog box will pop up prompting you to "Open WAV File." Select the corresponding, recently de-multiplexed WAV file. 4. From the Audio pulldown, you will see that the "Direct stream copy" is the default. Select "Full processing mode." Again, under the Audio pulldown, select "Use advanced filtering." Once more, from the Audio pulldown, select "Filters." Immediately, the "Audio filters" dialog will appear. Select "Add" then doubleclick input, new rate, and output. Close the "Add Audio Filter" dialog. Doubleclick the "new rate" icon. Change the rate as directed per ACID Agent's instructions. Move the slider near the end of the video and preview the output. Once it is correct, move on to step 5. 5. Drink some coffee or other prefered beverage. 6. From the File Pulldown, select "Save WAV." Continue per ACID Agent's instructions.... Your humble servant, Me | ||||||||||||
| miko_sing posted 2003 Nov 16 18:03 | ||||||||||||
| I tried Acidagent's method on my out of synch vcd. It wasn't easy for a layman like me. Anyway, I discovered a lot of things along the way. For eg.
1. After multiplexing, I had to convert the mp2 to a wav file or else Sound Forge 7 doesn't recognise it and will not open it. I am not sure if it's due to the fact it is a trial version. 2. As only part of the movie is out of synch, logical solution would suggest to select the part which is out-of-synch and then resample it... 3.However, Sound Forge 7 doesn't allow resampling of selection. It insist on resampling the entire data so the end result would be - the out of synch part will become in-synch but the part which was in-synch originally will become out of synch. Sigh... 4. So I tried to select the part that needs resampling, copy it out to a new project, resample it, then paste it back to the original piece by overwriting the part that is not good. 5. Doesn't work.... 6. I then decided to try it the other way. I copied out the part that is good onto a new project, then resample the entire movie. After which I paste back the good part onto the new-resampled data. And ... voila! It works! Ok this may sound idiotically simple to guys who are pro in the biz of fiddling with audio and video but for newbies like me who has absolutely no idea, it was a great moment for me to figure out this for myself. I want to thank Acidagent too for his research and info, if not I will not be able to fix my vcd. Keep up the good work guys! | ||||||||||||
| Cho~KinG posted 2003 Nov 24 00:55 | ||||||||||||
| I followed Acidagent's guide and it worked for me. [Thanks Acidagent]
Just to clarify I'll tell you how I got mine to work. I encoded my video (VCD to SVCD conversion) the way I normally do using TMPGEnc. From now on the source video is no longer used. I opened up the encoded video in Virtual Dub and found the exact postion of a distinctive point, ie gun blast (use muzzle flash (visual cue) as a reference for when the gun blast (audio cue) should occur). I noted the exact time of the muzzle flash. Lets say it occurred at time 1000 sec (these aren't the actual numbers I used but they serve as an example). Then I saved an uncompressed .wav of the enocoded video using VD. I opened the .wav using GoldWave and found the occurence of the gun blast, lets say it was at 999 sec. The audio is early by 1 sec. I then calculated the percantage change using the occurence of the gun blast as the base (ie 999 secs is base). Percentage change = (1000-999) / 999 = 0.001 (or 0.1%) Now since the audio is early it needs to be slowed down. This means increasing the Hz by the percentage change. New Playback Rate = 44100 x 1.001 = 44144 Hz. I changed the .wav to this playback rate using GW's 'Playback Rate' feature under the 'Effect' menu. I then resampled the .wav back to 44100 Hz using the 'Resample' feature(directly below Playback Rate feature). I encoded this .wav to .mp2 format using tooLame (a cmd-line based plugin for TMPGEnc). Then the audio was combined back with the video using TMPGEnc's MPEG Tools: Simple-Multiplex. Note that the calculations are rough even though you try to be as accurate as possible. You may have to repeat this process all over again changing the Hz by one if you're really nit picky. Also when selecting your audio/visual cue, use a point towards the end of the video. This will make your values more accurate as the way I have calculated it depends on percentages. | ||||||||||||
| bighousie posted 2004 Jan 07 11:55 | ||||||||||||
| ||||||||||||
| cgiesler83 posted 2004 Jan 21 09:11 | ||||||||||||
| Hey Valnar/Or Anyone That Can Help!
I am a fond user of Virtual VCR v3.0 I love how it can clean up a television signal and make it look fantastic. I have been going through forum after forum trying to find out about synching problems but to no avail. I read Valnar's tips on the settings in Virtual VCR and I have tried that. This is what i need: I record eps of Degrassi High(a show up here in Canada) and want to take the commercials out so I can put it on DVD. Here is the problem: The main file is absolutely flawless! I mean in Windows Media Player, and especially Power DVD it plays the file with no sync problems. As soon as i use womble mpeg vcr to edit out the commercials and re save it(NO REENCODING) It slowly becomes out of sync. Is there a simple way to how I can fix this? I have a P4 2.3 ghz 128mgram Dell with a 80 gig hard drive. Someone please help me ASAP!! Craig Giesler cgiesler@hotmail.com | ||||||||||||
| hamidi posted 2004 Feb 01 07:54 | ||||||||||||
| hi acidagent
i couldn't load mp2 file in sound forge 7 it says: Warning: An error occurred during the current operation. The file format plugin for the specified format was not properly initialized. what can i do? | ||||||||||||
| BJ_M posted 2004 Feb 01 07:55 | ||||||||||||
register the main concept plugin at the sony soundforge web site .. just follow the directions that pop up when you try to render something mpeg | ||||||||||||
| hamidi posted 2004 Feb 11 13:16 | ||||||||||||
| hi all
would u please cooperate in solving my problem: http://www.dvdrhelp.com/forum/viewtopic.php?p=808673 thank u | ||||||||||||
| LisaB posted 2004 Feb 11 14:25 | ||||||||||||
| BJ_M,
When you say Vegas, do you mean Vegas Video? I'm not sure how many different products Vegas makes, which is why I ask. You see, what I find most difficult about AV synch is actually determining how out-of-synch the source is. Something where you can interactively change the audio delay and then play to test would be great. The best thing I have found so far for this is Media Player Classic, the mod of WMP that can be found at doom9.org. With MPC, there is an option to adjust the audio delay....so it just comes down to trial-and-error, alternately adjusting audio delay and playing the file to determine the actual desynch. It sounds like Vegas Video might make this even easier, I don't know. Acidagent, This is an interesting guide you have made. I see how your process can work. But I don't agree that it is any more accurate than time stretching. If you use "time warp" in GoldWave, you can set a duration for the new audio file to within 1 ms. For a 2-hour movie this means accuracy to 1 part in 7.2 million. Resampling allows for accuracy to 1 part in 44,100. Both methods are way more accurate than is necessary to correct audio synch. The GoldWave "time warp" alternatively lets you set the new speed of the audio, but this method of "time warping" only gives you accuracy to 1 part in 1000 which is definately not good enough for fixing audio synch. Maybe this is why you thought resampling was more accurate. The upshot of all this is that if you specify time instead of speed in the GoldWave time warp filter, then you will have all the accuracy you need. I know, because I just used GoldWave a few days ago to correct a very subtle audio desynch (about 2 seconds over the course of a 2-hr movie, which translates to a 1 part in 4000 adjustment). The only question here is: which is faster, resampling or time-warping? Both methods work and are very accurate, but which is quickest and/or easiest to implement? | ||||||||||||
| BJ_M posted 2004 Feb 11 14:26 | ||||||||||||
| yes -- i mean "sony vegas video" -- where you can shrink or stretch the audio or move it around very easy ..
i use it to resync HD movies almost on a daily basis .. | ||||||||||||
| hamidi posted 2004 Feb 12 06:18 | ||||||||||||
| hi
i've some questions about the main post, acid agent, please let's consider on it and follow the steps gradually 1. why i must find the same moments in video and audio and adapt them? this may be erroneous, at least not accurate adaptation. can i consider the exact time of the whole video and audio instead? 2. 1:16:23.828-1:16:22.891=.937. how u say it's about .939 seconds ahead? 3. resampling omits some data while compressing or expanding does not. right? if so, doesn't it remove valuable parts of sound? 4. essentially does compressing or expanding sound work? how do u say this is more accurate? what do u mean i don't have to render the effect to preview? 5. why 9Hz?! how did u find this value? u say i've to tinker, u mean trial and error method? if so, this takes a lot of time. the movie is about 1:51:00 and everytime i have to wait. let's use ur suggestion, 1 Hz for .1 seconds in an hour 2 Hz for .2 seconds in an hour 1 Hz for .2 seconds in two hours this makes the following formula: f=36000*t/T while f is the added frequency, t is the amount of being ahead and T is the amount of time t is ahead in. is this a right formula? putting ur values in it makes: f=36000*(.939)/(1:16:23.828)=7.37, where did 9 came from?! if the value is 7.37, what can i do with .37? sound forge doesn't accept floating points! 6. u say "Now you can see i'm only 0.002 seconds out". i couldn't find this .002 seconds. yes, sorry, unfortunately ur right, i'm really dumb! 7. u blamed the soundcard. i used mplayer2 and saw the rendered audio at accurately 44100Hz, but video at about 24.98 (it was PAL). i think this is the fault of video instead of audio. audio is not ahead, video is behind. right? if so, may it be fixed by this method? what can i do? 8. sound forge couldn't open the .mp2 file. it says: Warning: An error occurred during the current operation. The file format plugin for the specified format was not properly initialized. what can i do? i used JetAudio to convert it to .mp3, then it opened the .mp3 file. isn't there a better software? or another one which is not so robust. 9. what u do is playing back the tape again with the recorded speed and then saving the result with the normal speed. right? 10. i think frame lost while capturing caused the problem. so, the frames may not be lost uniformly during the whole of the movie. the method u suggested changes the audio sample rate uniformly. can i use a method to get the .m1v file and fix the frames from 24.98 or anything to exactly 25 frames per second? 11. please also visit this url: http://www.dvdrhelp.com/forum/viewtopic.php?t=204123 thanx | ||||||||||||
| BJ_M posted 2004 Feb 12 08:13 | ||||||||||||
generally means you have not properly reg'd your product .. there is the main reg and the mpeg (audio and video) reg /// call customeer support and they can get you the reg info or you have buggered up your install - so uninstall - remove directory and re-install and re-register | ||||||||||||
| Acidagent posted 2004 Feb 12 08:54 | ||||||||||||
| Hi all, apologies i haven't been around for a while. But here goes
Hamidi, you have a few questions which i'll try to answer and explain.
When it's out of sync, you have to at least find one place (preferably near the end) you are certain where you could match the sound to the video. Think about someone kicking a ball, you know exactly what this sounds like so you would mark down when you hear the ball being kicked and mark down when you see the ball being kicked. This is how you work out whether the audio is behind or ahead. Sometimes, the length of the sound in the Mpg can be erroneous, especially if you record some blue screen, ie static. Basically you need an anchor point to work from.
23.828-22.891=0.939 (a)The time where you can hear John sing "Seeee" - (b) the point you can see in the video where John sings "Seee" = The difference between the audio and video, here it equals 0.939 which means the audio is ahead by 0.939 seconds.
Firstly you are right, resampling can omit some data, but we're talking 9Hz, which on the grand scale of things isn't really all that much at all in fact it really is nothing. It's really not noticeable to the ears. In fact 9Hz is about 0.02% of 44100Hz. Secondly, you don't have to render the effect at first. If you leave the line on the wave file and set the sample rate only, you can see the line has moved to another time. Then sound forge will give you the new time for where in this case John says "Seeeee", in the guide it's show at 1:16:22.889, to set the sample rate only only takes about 1 second no matter how big the file is! 0.002 seconds (22.889-22.891=-0.002, which in reality now makes the audio 0.002 seconds behind) is virtually nothing and certainly not noticeable. When you're happy with a similar gap using setting the sample rate only(the bit you don't need to render) then render the sample rate to 44100Hz to make it conform the sound file. The times will remain the same because you have now rendered it from 44109 to 44100 rather than just setting it.
where does the figure 36000 come from? I must point out it was only an estimation. and yes floating points aren't accepted in sound forge. It is trial and error, but just remember you don't need to render it to preview where the sound has changed position)
Sometimes soundcards record at frequencies higher or lower than 44100 even though it states it has recorded at 44100Hz. So when you come back to play it, it will tell you the file is 44100Hz. But the actual recording itself may not have been! In your case, it could well be the video is well. I was a bit over the top just to blame the soundcard which records the material. But in most cases it is the sound card.
You need to demux the mpg in Tmpgenc first, the video file will be called something like filename.m2v and the soundfile like filename.wav Prevention is always better than cure. As i've stated this guide can is for gradual loss of sync. Altho it can be altered for situations like yours, but i have to go uni now. Thanks for your empathy[/quote] | ||||||||||||
| BJ_M posted 2004 Feb 12 08:59 | ||||||||||||
[/quote] sound forge doesnt take de-muxed files -- they must be in program stream ... and you cant have a wav file multiplexed with a m2v stream anyway .. | ||||||||||||
| LisaB posted 2004 Feb 12 10:39 | ||||||||||||
| Hamidi,
1. you *must* look at points in the video to determine audio synch. You can't just go by the duration of the audio and the video. Remember, if the audio, for example, was erroneously sampled at 44,109 Hz, its actual duration will be different than its apparent duration. It *appears* to be the same length of the video (assuming 44,100 Hz sampling), but this is not true, which is why there is audio synch problems in the first place. 2. If you resample *up*, then you are actually *adding* data. In any event, resampling isn't changing the amount of data that much, as Acidagent points out. What I think is most important to point out is that compressing/expanding is not magic - it is essentially *resampling*. The point is, whether you compress/expand with GoldWave or resample in SoundForge, you are doing essentially the same thing. Think about it - if you change the duration of audio while keeping the sampling rate constant, then you are changing the number of samples! Voila - you must be doing resampling! Acidagent has just found another way to manually do what the compress/expand filter in GoldWave already does, and he thinks his method is a little easier. I should add, however, that the compress/expand filter in GoldWave is a bit more sophisticated, because it not only resamples, but makes adjustments to compensate for the resulting change in pitch. As Acidagent points out, it only takes a second to set the sample rate in SoundForge, so it should be quick and easy to narrow in on the appropriate sample rate in a short period of time (i.e., where does the 9Hz come from? - trial and error!). However, I will also point out that it only takes a second to set the audio lag in Media Player Classic, so it is similarly quick and easy to determine the audio de-synch. | ||||||||||||
| Acidagent posted 2004 Feb 12 11:15 | ||||||||||||
| BJ_M - You're absolutely right. TMPGenc doesn't demux the files to mv1 and wav. It's been quite awhile. It does indeed demux the audio to a .mp2 file. Much apologies. | ||||||||||||
| Acidagent posted 2004 Feb 12 11:19 | ||||||||||||
| Thanks Lisa, you have mastered the art of English much better than I could! I'll try and answer your question you asked way back after some grub!! | ||||||||||||
| majot posted 2004 Mar 08 16:09 | ||||||||||||
| Lisa b/anybody
could you write a guide or point me to where I can find one for how to set up the time warping in goldwave so I can get my audio to sync with my video I haven't had much luck with Acid Agents guide (Havent got to grips with Sound forge) Thanks for any assistance PS didn't mean to sound ungrateful Acid Agent - think u're doing a great job | ||||||||||||
| The.Legend posted 2004 Apr 12 11:45 | ||||||||||||
| Hi there,
first of all thanks to everyone who posted here, especially Acidagent for the great help with problems I had in some of my video files. However, I changed Acidagent's method a little bit to make it more accurate, because I'm not a big fan of trial-and-error searching around for the right sample rate, and there are quite some numbers which can be used to calculate more accurate rates and values. Here is what I've done: For the following explanations I'm also using the tools VirtualDub 1.5.10 SoundForge 7 TMPGEnc just like Acidagent in his guide. Pre-Note Thanks to Lisa B. for pointing this out, I forgot to mention in my original post that the following process makes the assumption and only works if your video and audio duration are different but both belong to the exact same amount of time!! If your audio and video have the same length, this method won't change anything. The Problem To fix gradually loss of audio/video synch in MPEG-1 video stream. The REAL Problem Fine, so your video is losing synch towards the end of the file, but do you really know what causes this problem? Everything talked about in this thread assumes that your problem is related to the audio portion of your stream. However, let's not forget that the problem can also be video related, the most common cause being bad frames or edited files, for example cutting out commercials at intermediate frames can easily get the audio out of synch. Finding the Cause As anyone here knows, there is no one-button fix-everything solution (yet). It takes some time and playing around to find the cause for your problem, and often you end up trying different methods hoping that one might fix it. A big helper for situations like that are the numerous tools out there which tell you all kinds of information about your file, video and audio sample rates, number of samples and frames, resolution etc. This information can help you to find the cause for your problem. As described by AcidAgent, the easiest way to detect gradually loss of audio and video synch is to use VirtualDub and play the file at different positions and watch what happens to the audio. Gathering Information Using VirtualDub, you can view the most useful information when opening the File -> File Information... menu item. Here an example for a file I had and some explanations (I don't list all the information, only what we need right now): Frame size, fps: 352x240, 29.970 fps: While the video standard and frame rate has become less important because most dvd players play almost anything, this information is important later when we have to remux our video stream and need to select the right video profile in tools such as TMPGEnc. Video # of frames (time): 75788 (42:08 ): This information is very useful and will be used later on when determining the error between audio and video duration. Audio Format: 44 KHz, 224Kbps layer II: Except for the bitrate you should expect audio to be in 44 KHz most of the time. However, it's always good to check on that and make sure you haven't gotten some weird file. Audio # of frames: 96608: This is the second piece of information which can be used to detect the exact off-synch. Using SoundForge, we can get some more information about our audio stream. I simply extracted the Audio from my video file with VirtualDub by using the File -> Save WAV.. menu option. I then opened this file in SoundForge, which tells me in the status bar in the lower right corner the following: 44,100 Hz, 16 Bit, Stereo, 42:03.637 Doing the Math In my case, the video length came out to be 42 minutes and 8 seconds. However, SoundForge tells us that the audio length is only 42 minutes and 3.637 seconds, which is a difference of 4.363 seconds. This is the exact amount of time audio and video are out of synch at the end of the file (which means in the middle of the file it should be about 2 seconds off, since it is starting in synch at the beginning and then gradually loses the synch). Fixing the Audio Now all we need to do is use this information to resample the audio. SoundForge has a nice function under the Process menu called Time Stretch, which changes the length of an audio file without affecting the pitch (I guess in the same way Goldwave does). We just have to input the audio length we would like to have, and let SoundForge do the work. Now, I'm a real accuracy freak, so when SoundForge asked me to enter the length with 3 digit floating point precision, I didn't just want to take the 42 minutes and 8 seconds. So I recalculated the exact video length by using the number of frames and the framerate: 75788 / 29.970 = 42 minutes and 8.795 seconds. To most people this .795 seconds might seem insignificant, but the human brain is very sensitive when it comes to slight off-synch in video files. And since SoundForge offers it, why not make use of it! I entered the time in the Final Time field in SoundForge and left the Mode at A01 Music 1. I haven't tried different modes here, but for a small change like that there shouldn't be much difference to other modes. A click on Ok initiates the process, which shouldn't take very long. On my machine, the time stretch took 1 minute and 10 seconds. After the procedure is done, we can see the new audio duration in the status bar: 42 minutes 8.606 seconds!! Although we entered 8.795 seconds, it came out at 8.606 seconds, which is due to the sample length (you cannot have half a sample or something like that, so the resampling is done to the closest time possible). The difference between audio and video will now be 0.189 seconds at the end of the file, which is small enough to not be visible to the viewer. Testing the Results After saving the file in SoundForge, we want to test the results to make sure it worked as we want it. So we go back to VirtualDub and chose WAV Audio.. from the Audio menu. We select the file we just saved and are now able to check the results by playing the file at different positions just like we did in the very beginning to detect the loss of synch. Voila, the loss of synch is gone! Merging Audio and Video All we have to do now is to mux our video and audio together again to get a single file. For that I use TMPGEnc, where we cancel the Wizard and then open the video file. When we do that, it automatically choses the same file for the audio source, since we still have the original audio in the file. So we simply click on the Browse button for Audio and select our fixed file. I then Load the profile which is right for my video file, and as we learned from the file information in the beginning, my file was a NTSC VideoCD, so I chose that profile. The Finish Line One TMPGEnc is done creating the new file, we are done, and there should be no detectable off-synch between audio and video left in the file!! Some Statistics Here a little overview how long the whole process took for me: - Open the file in VirtualDub and check for loss of synch: 3 minutes. - Save the WAV in VirtualDub: 1 minute. - Open the WAV in SoundForge: 30 seconds. - Time Strech the WAV in SoundForge: 1 minute. - Check result in VirtualDub: 2 minutes (take your time for this step, if you rush and it's still not good, you lose time doing the whole thing again). - Remux Audio and Video in TMPGEnc: 30 minutes. - Check results one more time: 2 minutes. - Total time: 39 minutes 30 seconds Note The process described above worked fine for me (and didn't require any trying around and finding the right sample rate!!), and if it didn't work for you and you still followed all the steps described, then your problem might be of a different nature. Please don't hesitate to post any results, problems etc., maybe we can work it out together! I hope I could help and contribute a little to the help I have received from you guys! Thanks to everyone, Legend | ||||||||||||
| LisaB posted 2004 Apr 12 13:45 | ||||||||||||
| Legend,
It would be nice if one could remove the trial-and-error determination of audio synch, but to do so requires that one make an assumption - namely, that the durations of the video and audio data correspond to exactly the same physical length of time. The process you outline simply makes the video and audio durations the same. All, There is a very quick test that one can do to determine whether or not Legend's method will work. VirtualDub can actually change the video framerate so that the audio and video durations are the same. If you go to the VirtualDub menu (Video -> Framerate), you can make a source rate adjustment...it changes the framerate of the video so that it is the same length as the audio. In parenthesis, VDub will show you what the new framerate will be (note that this value is inaccurate if your vid has VBR audio). Take a look at the number in parenthesis - if it is the same as the current rate, then you can immediately conclude that Legend's method will not work for this case. If it is something different, then go ahead and change it. Now, check a few places in the video -- see if the audio is in synch. If it is, then that means that the video and audio really do correspond to the same physical length of time, and thus Legend's method would work. However, if this is a video file that you intend to only play on your computer, then you don't even have to go through all the work of Legend's method - just save out a new avi using direct stream copy...total time about 2 minutes! On the other hand, if this is an mpeg, or if you intend to convert the avi to an mpeg sometime in the future, then you would be better off going through Legend's method to make the audio the same duration as the video. Remember, Legend's method is not really a method of correcting audio synch - it is a method to make the audio the same length as the video. In some cases, this will fix the audio synch. You can very quickly and easily test this theory using VirtualDub. Even Acidagent's method makes an assumption - namely, that the audio is perfectly in synch with the video at the beginning of the clip. This is usually but not always true -- it's easy enough to check, however. If your video is out of synch at the beginning, then you will have to determine audio synch at *two* points in the video -- preferably one point near the beginning and one point near the end. If the desynch is the same at both points, then you have a case of constant audio desynch - in other words, the audio is simply shifted with respect to the video. If the desynch is different, let's say d1 and d2, then the audio is both shifted and stretched with respect to the video. So if d1 and d2 was measured at points A and B in the video, then you must determine STRETCH = 1 + ((d2-d1)/(B-A)) and then SHIFT = d1 - A*(STRETCH-1). Remember that d is positive when video is *ahead* of audio. Finally, to fix this video, you must use Goldwave Timewarp to stretch the audio by the factor (1/STRETCH), and then trim the amount SHIFT off of either the audio or the video, depending on whether SHIFT is positive or negative. If this is an MPEG video, then you will not want to trim the video - instead you can insert blank audio using Goldwave. I had to do exactly this process with an AVI not long ago... Finally, as Legend pointed out, sometimes audio is out-of-synch because of bad edits/joins/frames. In this case, there will be an abrupt change in audio synch at the bad points. None of the above methods will work for something like this. You must chop the video into parts, separating it at the bad points, and then fix the synch for each part separately using methods outlined throughout this thread. Lisa B. | ||||||||||||
| johns0 posted 2004 Apr 12 14:02 | ||||||||||||
| The way i take guess work out of stretching or shrinking the timeline is i input the video in virtualdub and scan the file to near the end where you last see people talking and choose audio/interleaving and input into audio skew correction the value i need and then click on the output playback to see how close the sync is and then when it spot on i note done the value i used and then go to goldwave and use that value in timewarp.Works the same with audio shifts in parts where you have to add audio.Just check where the audio goes out of sync and just add the seconds with goldwave,dont need to chop video. | ||||||||||||
| The.Legend posted 2004 Apr 12 14:06 | ||||||||||||
| Lisa,
thanks for your additional comments. Actually I meant to add to my posting that it makes certain assumptions, but then I forgot later while I was writing it. It's absolutely correct that my method only makes both video and audio have the same length, and if the durations are already equal, then the method won't produce any results, that's very important! So as Lisa wrote, please check your file in different places and try to figure out exactly the actual problem you are facing. Also, it only works if the audio and video portions in your file actually belong to the exact same amount and period of time. This means, there are scenarios where your audio duration is longer than your video duration, but the file is NOT out of synch. What happens then is that at the end of the video stream, the audio is just cut off, although there might be audio data left for another couple of seconds. Now if you have a situation where your audio is out of synch but would also have overlapped at the end, then the method I described above will make the audio be too fast, meaning it will be ahead of the video. Then you will have to find out how much the overlapping part was to find the right audio length and fix it. As I said before, and as Lisa emphasized, there are so many different scenarios which can cause the audio and video to lose synch, especially when editing, cutting, transcoding between formats, having bad frames or unusual frame rates etc. At some point in time it would probably be best to have kind of a matrix which tells you what to do in which situation, where you look up your video and audio problem and know what to do. Or even better, it would be nice if future video standards/formats included timecodes for audio and video which are maintained throughout transcoding and editing procedures. Then again, if you have a gradual synch loss which is due to a slightly off audio sample rate, then the timecodes will already be set wrong in the original file, and you are left with the same desynch problem AND faulty timecodes. Also, you are lucky if the same solution works for more than one file, I had cases were I had 10 erroneous files and the problem was different in each of them. Good luck to everyone, keep posting your questions / comments! Legend P.S.: I edited my original posting to point out Lisa's comments. | ||||||||||||
| Joseph Vigo posted 2004 Apr 17 14:25 | ||||||||||||
| reading through this post was interesting but users who want to transfer their video to SVCD shouldn`t need a degree in Advanced Logic and Sound Technology to make the audio of their video stay in synch.
Lets be honest here. The original is fine. The captured AVI`s are fine. It is TMPGEnc that does the encoding and TMPGEnc that has this Achilles Heel. It`s like advertising a car where the steering wheel gradually comes loose and you have to follow complex diagrams to make minor adjustments so you can stay on the road. Maybe I was too simplistic. But this thread is too complicated. | ||||||||||||
| cd_crazyman posted 2004 Sep 28 03:32 | ||||||||||||
| It's definately way too complicated but I need help and this appears to be the thread to do it on:
I had a 77 minute RM file that I wanted to convert to VCD. I tried several Real Media converters and they wouldn't even touch this file (read: crash). I finally used Boilsoft's RM Converter and chose RM-2-VCD and it made an MPEG. However... the video was in hyper speed so I had to stretch it back out to 77 minutes in length. I searched and found Virtual Dub has a setting under Video>Frame Rate called "Change so video and audio durations match". Doing this made an AVI with a pretty good picture. However... The audio starts several seconds late at the very beginning and graually gets worse. At about 30 minutes it is off 2 minutes and then at about 45 minutes it is off 3 and at about 60 minutes it is off 4 minutes. In other words it loses 1 minute for every 15 minutes of footage, so from start to end it loses about 5 minutes. I've tried converting directly to [non-VCD] MPEG with RM Converter and it either crashed or had a logo on the video or the picture sucked. I've tried converting directly to AVI with RM Converter and and it either crashed or had a logo on the video or the picture sucked. I've tried converting directly to DVD (just to try it) with RM Converter and it crashed. The conversion to VCD resulted in the best picture quality {I tried at least 20 different codecs in all} from the codecs available in this program. The only draw back was it played in hyper speed. Is there a way to fix either the MPEG with hyper-video or the duration-matching AVI to make an in-sync-as-much-as-possible VCD? Spare me any formula mumbo jumbo technical stuff, just tell me what to do with what program. I have VirtualDub, Goldwave, AVI2VCD, DivFix, DrDivx, DVD2AVI, GraphEdit, Headac3he, TMPGEnc, Video Fixer. If I need another program it needs to be a fully functional demo, not cripple-ware as this is a one time thing. I'm never converting another RM file ever! Wayyyyyyy too much trouble. I've wasted at least 100 hours processing on this one video alone. | ||||||||||||
| leonid_makarovsky posted 2004 Oct 13 11:18 | ||||||||||||
| Acidagent,
thanks for the article. I had M-Audio Audiophile 2496 Soundcard. When I was doing a video capture, my audio was always behind the video. For NTSC video after 1 hour my audio was .100 of a second delayed - thatis 3 NTSC frames. I had no problem squeezing the WAV file afterwards to the correct length using GoldWave. Right now I changed the soundcard to Terratec Aureon 7.1 Universe. Now when I capture my audio is ahead of the video. In 2 hours it's .155 of a second ahead. Not a big deal, but still 5 NTSC frames. Now I need to stretch the file. Unlike squeezing, stretching may introduce some distortion and unwanted clicks. I tried it with Goldwave and it didn't do a good job. So I found your article. Very good idea. The only thing is that I don't like resampling with SoundForge or GoldWave. I use SSRC.exe to resample 'cause it gives far better quality than those 2. But it choked when I went from 47.999kHz to 48kHz. Anyway, I guess I should be telling my capture program to capture something like at 48001Hz and then just set sampling rate to 48kHz. I'll have look into it. I definitely don't want to resample on the fly 'cause it will give me worse quality than postprocess resampling. --Leonid | ||||||||||||
| peter762033 posted 2006 Jun 24 06:08 | ||||||||||||
| Hi where can i get the sound forge 6 because i can only get 8 and im using that and i cant open the mp2 audio because it says theres errors. | ||||||||||||
| paros posted 2007 May 03 13:18 | ||||||||||||
| I have an uncompressed AVI and an uncompressed .WAV file for the sound. I need to mux them togethor, but the resulting video goes more and more out of sync (even though it is synced at the beginning). This guide requires that I convert them all into these weird off-the-wall formats, use 5 different apps, convert them back, and then convert them back again.
Nothing in the world should be this difficult. If the problem is sampling rate, and nothing but sampling rate, shouldn't I be able to simply resample the damn wave file in CoolEdit, and then mux them as usual?? I do not want to convert my wav file into "mp2" and convert my uncompressed AVI into MPEG, play software musical chairs, and then convert them all back at the end. It would take over 2 hours just to do all that, once!!! | ||||||||||||
| Almost Human posted 2007 May 03 14:09 | ||||||||||||
| Before making any changes, like cutting out unwanted sections:
Open your AVI in VirtualDub. Under "Video" select "Frame Rate". In "Source rate adjustment" select "Change so video and audio durations match, OK. Under "Video" select "Direct stream copy". Under "File" select "Save as AVI". Save to the other hard drive. Check your new AVI's file info and you will see that the audio and video are the same length. Go ahead and cut the unwanted sections. Save back to the original hard drive making sure the video "Direct stream copy is still checked". This will probably produce an AVI with a frame rate of 29.968 or thereabouts which is still within the normal parameters of most encoding programs (TMPGEnc has no problems with it). | ||||||||||||
| Pinstripes23 posted 2007 May 03 18:45 | ||||||||||||
If it's syncd in the beginning but gradually gets out of sync, then you most likely have different running times for the video and audio(makes sense doesn't it?). FIND OUT the running time of the video, use cool edit/audition or whatever and change the running time/length of the audio TO MATCH the running time of the video. In audition it's under time/pitch --> stretch. And NO if you already have a wav file you should NEVER have to convert to several formats and use several different software just to fix a simple sync problem. | ||||||||||||
| LeChat posted 2007 Jul 06 15:29 | ||||||||||||
| ok let me just start by saying that every time i found myself having problems with an encoding job over the many years, more often then not my frenzied googleing led me here to the solution so thanks to the numerous people who took time out to help the noobs and experts alike
this solution totally works and the only reason i felt the need to sign up and say so is because after years of randomly having this problem with no apparent solution this finally done the trick couple of things i wish to note 1. soundforge did not work for me. it might be the best program in the world and maybe i got a bad copy or messed up codecs but try as i might i couldn't get the thing to work so i went with what i know and thats goldwave 2. a justing audio length or time warping still left me with audio skew, so i stuck with the original suggestion of re-sampleing...... it worked the maths on this is pretty basic but its important you get it right so heres a quick lesson for those who are maffamatikally challenged like me 1. when you open virtualdub and note the difference between audio and video durations you need to get the total difference as a percent (guesstimation is acceptable to a certain extent) simply divide the larger number by the smaller number (like i said pretty basic) 2. once you have that number simply go to goldwave and times the current frequency by that number (should be some thing like 1.05 * 48000) 3. once sampleing is complete just resave the file and you should be good to go (might need to tmpg audio back to mp1/2) 4. remux or build dvd as normal thanks again to all those working on this solution | ||||||||||||
| ben79 posted 2007 Sep 09 11:27 | ||||||||||||
| Hi all,
I've read this thread with interest and LeChat's Goldwave suggestion was really helpful. I have a similar problem with .mp4 files which is starting to really frustrate me. I have a solution but there must be an easier way of dealing with this. Would be interested to hear if anyone has similar issues to me. I am trying to convert divx to mp4 (video H.264/AVC and audio AAC) primarily for playing on my PS3 (why can't it have Divx support built in??). I have been transcoding with eRightsoft's Super which I eventually managed to download. But I get the following problem: With the original Divx file - both sound and video are 1:58:52.053 in length and both are perfectly in sync. With the newly created mp4 - Quicktime Pro tells me that the audio track is the original length (above), but the video track has reduced to 1:58:50.7 - ie the video has shortened by about 1.3 seconds which causes the audio to gradully move out of sync until by the end of the film there is a 1.3 second gap. I assume this is frame rate issue - but I can't seem to be able to solve it. Super tells me that the original divx file has frame rate of 23.976 and in transcoding I specifically choose 23.976 in Super's menu. However, Quick time pro tells me that the new mp4 file has frame rate of 23.98. What I'm not sure of is whether this means that the frame rate has actually changed. This could just be QTPro rounding up to two decimal places. How do I tell? A maths exercise makes me suspicious that the frame rate has actually altered. If the frame rate has actually increased from 23.976 fps to 23.98 fps then a bit of maths shows that the run time of the file should reduce from the original 1:58:52.053 to 1:58:50.86, which is extremely close to the actual new run time of 1:58:50.7 (just 0.16 of a second off). So.... what do I do about this? Any suggestions??? My own solution is this: 1. I create my .mp4 file as above, getting a movie with audio out of sync by about 1.3 secs by the end. 2. I take the view that it is easier to alter the sound rather than the video (even though the fault lies with the video). I open the mp4 in Quick Time Pro. I export the audio as a wav file. 3. I open the wave file in Goldwave and use 'Timewarp' to shorten it to the same length as the video file using the option that simply resamples the file. Although this does increase the pitch of the audio the change is so small (an increase in pitch of approx 0.019%) that it is not noticeable. I save the file as a .wav file. 4. I again open the original .mp4 in Quick Time Pro and delete the original audio track. 5. I then copy and paste the new shortened audio file into the mp4 movie file. 6. I then 'export' the file as a .mp4 using 'passthrough' for video and AAC for audio. Hey presto - a movie file in sync. But..... although this works, it takes ages and I end up with a movie that is speeded up by 0.019%! Anyone got an easier way of doing this?? Ben | ||||||||||||
| ben79 posted 2007 Sep 11 11:12 | ||||||||||||
| UPDATE
so I think I've finally narrowed this down to a problem with Super's encoding. I had a source file at 25fps. After converting at 25fps the resulting mp4 was perfectly in sync; video and audio were the same length and video was playing at 25fps. The problem must be Super encoding at 23.98 when it should be encoding at 23.976. Anyone else with the same issue with Super - does this cause loss of audio synch with you? | ||||||||||||
| WolfyBrandon posted 2008 Apr 03 19:10 | ||||||||||||
| Sorry for digging up an old thread but I wanted to personally thank Acidagent for his guide!
I have a Realtek AC'97 Audio Onboard Soundcard and have been trying to record game play footage. When viewing my recorded footage I found the further into the video I go the more out of sync the audio is with the video (sound plays sooner than it should in the video). Now I’m able to fix this out of sync problem if I take the time to do it. I just have to find that magical Hz number to resample the audio at. I wonder if there is a way after doing this a few times I can figure out the Hz my soundcard is actually recording at, so I can figure out automatically what the Hz should be when I go to resample the audio instead of trying to line up the start of a specific sound in the audio to a specific frame in the video... Thanks again for shining some light on this problem for me! :idea: :D Wolfy | ||||||||||||
| Abas-Avara posted 2009 Oct 22 06:39 | ||||||||||||
I capture VHS tapes with WinDV and everytime the audio goes slighly out of sync. I also use that method and so far it goes good |
Login/Register to our forum to be able to post here.
