I'm posting this so you folks won't have to go through the 8-hour search I just did through Reddits, video and audio forums, and trial-and-error with video and audio editors and converters to resolve a baffling out-of-sync audio/video problem with audio extracted from a video.
I recorded audio and video on-camera so I wouldn't have to sync audio later. However, I did want to extract the audio and fix some noise issues in Audacity, then recombine. This seemed easy until I saw that now, the audio and video were not in sync.
I tried extracting in Camtasia, in Audacity, and with various video-to-audio converters, and what I found was that the audio file was slightly different in length for each extraction.
At first, the Internet mind led me to believe this was because of a frame rate discrepancy (29.97 vs 30fps), so I re-created my videos at 30fps. Alas, this didn't solve the problem.
Finally, I saw that both Camtasia and Audacity (and the converters I'd tried) all padded the beginning and end of the extracted audio file.
I could fix that by trimming the extracted audio, but there had to be a better way!
There is, and two hours later I found Pazera Free Audio Extractor (http://www.pazera-software.com/products/audio-extractor/), which is capable of extracting the audio from video files without altering it in any way.
Now the extracted audio and video are in sync. And, if you are encountering this frustrating problem, yours can be, too!
Thanks for the tip. If I could add to that I would remind people that another thing that could be causing sync issues when you export and re-import the audio from a video clip is with the audio software itself. Videos should be recorded at 48Khz. Some software imports and works at the same settings as the original file, but some programs have the option to auto-convert the audio on import... but that doesn't necessarily mean it will convert it back on export because you have to select what settings to use, and some never think of making sure it stays at 48Khz, which means when you drop the audio back on your timeline the video software has to convert it from 44.1 to 48.
Another issue during the "auto-conversion" is the bit rate - If it was recorded at 16 bit for example then converted to 24 bit during import but not converted back to 16 bit, sync issues could arise. Sometimes just converting it could cause issues.
It's important to remember that audio editing to a computer is nothing more than math. When you're editing at 24bit your computer can do better math than 16bit, but it stills truncates the numbers. When you convert it to 16 bit, it does less math and more truncating. The best solution is to record at the highest setting your system can handle and STAY at that setting. Upscaling from 16 bit to 24 bit does not create a better sounding audio file, it just creates a bigger file with this one caveat... if you have to do a lot of editing and manipulation, it's better to have the extra headroom so your computer can do the math.
Last but not least, we often get "drift" issues while recording. Most times it's not noticeable but for very long recordings the audio could drift out of sync. The best solution is to make shorter recordings. For example, if your lecture is 5 minutes and you decide to do several takes to get the best possible performance, or you make a few mistakes and start over but never stop the recording, you could end up with recordings that are 30 minutes or even an hour long, and some audio drifting. Sometimes it's better to just hit stop, take a short break to collect your thoughts, then go again with a new recording.
This doesn't mean hit stop every time you make a little blunder, but if your recording sessions are getting longer, a short break will help - with drift and with your frustration levels, especially if you have long lectures to begin with- those repeated performances could make some very long recordings with drift issues.
Hope that helps a little,
I agree with Kenn. I will also add that in the past I had issues with software (not camera) that record with variable bit rate, which throws off the timing if you record with external recorders.