Help with out of synch sound - AVI vs WAV

Post Reply
Karlos
Posts: 24
Joined: Tue Sep 06, 2005 10:38 pm
Location: Bozeman, MT

Help with out of synch sound - AVI vs WAV

Post by Karlos »

I’m having a problem with out of synch (OOS) sound, and would like some help understanding the best way to deal with this. I’ve searched the forums and read issues related to MPG encoding, but that does not apply here AFAIK.

1. Source video: Ulead Video Capture via Canopus ADVC-100 (firewire DV) of a VHS tape of a wedding shot with lousy equipment by the church itself.
2. Capture settings: DV type-1 (a mistake?); saved as approx 6 GB AVI (approx 30 minutes)
3. Audio problem: terrible AC (60 Hz) hum throughout. Media Studio Pro filters do nothing for this.
4. Solution, based on reading this forum: clean up the audio in the open source Audacity program
5. Problem: resulting audio will not synch exactly


To get the audio into Audacity and back into MSP:

1. I opened the audio in Ulead Audio Editor – because Audacity could not open the AVI file (over 10 minutes and ate up to 1GB real and 1GB virtual memory before I killed it).
2. Saved as WAV (PCM) 44.1kHz, 16bit stereo. I tried saving as WAV DV-Audio NTSC, but Audacity crashes with this format.
3. Opened WAV (PCM) in Audacity, removed noise, saved as WAV (PCM only option).
4. Opened WAV from Audacity in Ulead Audio Editor and saved as WAV DV-Audio NTSC (you’ll see why)

The screenshot below shows the original, synchronized AVI audio track on top, the WAV (PCM) audio track in the middle, and the WAV (DV-Audio NTSC) at the bottom.

Image

You can see that the WAV (PCM) has drafted considerably. 25 minutes into the video, the sound is delayed 0.6 seconds. While a small percentage, the result is unusable.

Converting the WAV (PCM) to WAV DV-Audio NTSC in Audio Editor puts us only 3 frames behind the action at 25 minutes into the video, a delay of only 0.1 second, but still enough that watching the lips and sound is disappointing.


I’d appreciate any help in understanding what workflow to use to avoid sound drift like this. Given that the Ulead Audio Editor component of Media Studio Pro 7 has WAV as the least-compressed output format … and simply opening an AVI file and saving the file as WAV results in shrinkage of the length of the audio …I’m not sure what to do?

I understand the suggested workaround of cutting the clip into small sections – perhaps 10 minutes each and putting them back together again. But, there must be a workflow that doesn’t require this? (I would have to use the extra step of DVI-audio conversion even there to get perfectly locked on sound.)

Thanks for any ideas and suggestions!

Karl
Terry Stetler
Posts: 973
Joined: Thu Mar 17, 2005 3:34 pm
Location: Westland, Michigan USA

Post by Terry Stetler »

DV can use two sampling rates: 32 khz and 48 khz bit, with 48 khz being the more preferable of the two. Which is used can be set in your cams prefs.

A sampling rate of 44.1 khz is not an option with DV.

Use the Info button in the Insert Video File dialog or the Properties context menu selection on the timeline to get this info for your sources.

Once you have it export your WAV from Audio Editor and do all the processing in Audacity, including the export, at the same settings.

For the record: I transcode all my audio sources into 48khz 16 bit stereo for use in DV projects and have my camera set liikewise (some come set for 32khz, which to me is silly).
Terry Stetler
maddrummer3301
Posts: 2507
Joined: Fri Dec 10, 2004 10:24 pm
Location: US

Post by maddrummer3301 »

You can try this:
You need to know the exact sampling frequency of the original dv tape.
Either 32khz or 48khz.
Save the file as the exact same audio attributes, 32khz mono/stereo or 48khz mono/stereo.
Also, under the properties of the dv.avi file write down the number of audio samples. The number of audio samples relates to the length of the audio track.

Whatever the original audio data is, either 32 or 48khz do not change that when exporting or editing and saving/re-importing.

In audacity use the 60hz Notch filter AND the 120hz Notch filter.

Hope this helps,

MD
Devil
Posts: 3032
Joined: Fri Mar 18, 2005 8:06 am
Location: Cyprus

Post by Devil »

The others have given the sound advice (pun intended) to get you going. As I have been one of those recommending Audacity, perhaps I feel concerned. I've often done what you are trying to do and have never had synch problems.

Another point is that, as the original is from a VHS, is it mono? If so, you might find the hum is on the unused track only. Your DV audio from the ADVC-100 is automatically stereo. In Audacity, pull down the track menu, split, erase the non-audio track, and copy the good track to the blank one, then make stereo. It will still be mono, but it will play equally from both speakers.
[b][i][color=red]Devil[/color][/i][/b]

[size=84]P4 Core 2 Duo 2.6 GHz/Elite NVidia NF650iSLIT-A/2 Gb dual channel FSB 1333 MHz/Gainward NVidia 7300/2 x 80 Gb, 1 x 300 Gb, 1 x 200 Gb/DVCAM DRV-1000P drive/ Pan NV-DX1&-DX100/MSP8/WS2/PI11/C3D etc.[/size]
Karlos
Posts: 24
Joined: Tue Sep 06, 2005 10:38 pm
Location: Bozeman, MT

Post by Karlos »

Hi Guys,

Thank you all for your fast and informative responses! :D
Terry Stetler wrote:A sampling rate of 44.1 khz is not an option with DV.

Use the Info button in the Insert Video File dialog or the Properties context menu selection on the timeline to get this info for your sources.
Duh. About time I learned this, I'd say. Info/Properties reveals that audio as being 48 khz PCM. I had tried saving as 48 khz from Audio Editor before the report above, but did not see any difference in timing ... I'll repeat later today and report back. Thanks, Terry.

[Thinking of MSP8 arriving soon...shouldn't 48khz be the default in Audio Editor then, as a component of MSP...? Even if you do a File New in Audio Editor (MSP7) 48 khz isn't a standard option - has to be typed in manually as user defined. Similarly, seems like if I open a 48 khz file (the avi) in Audio Editor, that when I go to 'save as', that Audio Editor should offer to save at the same frequency as the the source by default?]
maddrummer3301 wrote:You need to know the exact sampling frequency of the original dv tape...Save the file as the exact same audio attributes...
Also, under the properties of the dv.avi file write down the number of audio samples. The number of audio samples relates to the length of the audio track.

In audacity use the 60hz Notch filter AND the 120hz Notch filter.
Thanks for that, MD. Another 'duh' - didn't realize I could read off number of samples there. See it now. ;-)

I don't see the 'notch' filters that you mention. in the Effects menu (Audacity v1.2.3). I was using the equalization and/or fft effects with a curve that bumped out those frequencies...? Are the notch filters a separate download, or maybe I'm just not looking in the right place?
Devil wrote:Another point is that, as the original is from a VHS, is it mono? If so, you might find the hum is on the unused track only.
Thanks, Devil. Good idea for me to keep in mind if I run into it in the future, or if someone else reading this has that problem. Sadly, sound is stereo and AC hum is on both tracks. I tried each individually to see if it was worth killing the other, but not.

Will post a followup later - hopefully announcing success! Thanks again to all for sharing your knowledge!

Karl
XP Pro SP2+, 3GHz HT P4, 1.5 GB RAM, 128 MB ATI Radeon 9700 Pro, 100's of GB disk, dual LCD, Canopus ADVC-100, Sony Digital-8
Devil
Posts: 3032
Joined: Fri Mar 18, 2005 8:06 am
Location: Cyprus

Post by Devil »

The easiest way in Audacity is to find a period where there is only hum (on each track) and no wanted sound and use that as your base in Noise Removal: it is remarkably effective, but don't try to overdo it. If it is insufficient, make two copies in the app. Use the first to apply high-pass filter with the cut-off frequency at 80 Hz and the second with the low-pass filter at 45 Hz, then merge them. (If you have no bass in your sound track, then just the first will do, you can try it.) This notches out a band centred at 60 Hz but does also remove some of the bass. You may wish to try bass boost to compensate. The only music I think that may be noticeably affected is some organ sounds with 32' pipes. I suggest you try 10 dB at 80 Hz, if it's necessary.

Be aware though: any such sound manipulation may achieve a significant improvement, but there is a price to pay in the quality of the remaining sound. However, as the original is off VHS, this isn't exactly hi-fi or anything close to it!

Just had a thought: is your hum on the tape? If a TV is sitting close to a VHS on playback, it can induce hum because of the magnetic field from the degausser coil which is operative even when switched off. I recommend you separate TV (or CRT monitor) and VHS by at least 1 m. If this is not possible, pull the power plug of the TV/CRT when capturing.
[b][i][color=red]Devil[/color][/i][/b]

[size=84]P4 Core 2 Duo 2.6 GHz/Elite NVidia NF650iSLIT-A/2 Gb dual channel FSB 1333 MHz/Gainward NVidia 7300/2 x 80 Gb, 1 x 300 Gb, 1 x 200 Gb/DVCAM DRV-1000P drive/ Pan NV-DX1&-DX100/MSP8/WS2/PI11/C3D etc.[/size]
Karlos
Posts: 24
Joined: Tue Sep 06, 2005 10:38 pm
Location: Bozeman, MT

Post by Karlos »

48 khz for the WAV was the ticket. Perfect synch.

I'm confused by PCM vs DVI/NTSC encoding of the WAV file. I only get the same number of samples as the original DV file with PCM. If I save as DVI/NTSC from AE, I get 85,504,705 samples vs the 85,504,670 samples with PCM (and original DV). What's the DVI/NTSC encoding for? (A link to where I could learn more maybe?)

I got the best results removing the noise with the Audacity Noise Removal filter, since I did have a good sample area with just noise. As you say, Devil, it's remarkable. Trying to cut the noise out via high-pass / low-pass multi-tracks was going nowhere... slowly. The hum shows up at all kinds of frequencies. That made the Noise Removal filter all the more a life-saver ... and of course makes me wish for such a filter/effect in MSP itself.

(I see that MSP 8 beta doesn't have any new audio effects ... a shame, as it should minimally have the ones that let you clean things up. Back to MSP 7 - I can install the HNM filters that Terry pointed the forum to and then have high pass / low pass in MSP [no free 'noise removal' miracle like audacity though, that I found]. BUT ... these VST effects are not recognized by Audio Editor 7 ... so it is not extensible? I haven't tested MSP 8's audio editor ... if it can't accept VST, perhaps someone with a beta "in" can request that? ;-) Love the MSP 8 interface improvements!! )

Thanks again guys. The wedding video that the relatives thought they'd never see will finally get finished! ;-)

Karl
XP Pro SP2+, 3GHz HT P4, 1.5 GB RAM, 128 MB ATI Radeon 9700 Pro, 100's of GB disk, dual LCD, Canopus ADVC-100, Sony Digital-8
Post Reply