Log in

View Full Version : Loud click at start of mp2 files


Swan
21st November 2002, 16:46
I am new to mp2 encoding, so please be patient with me. :-)
I have a problem with converting wav-files to mp2.
When using TooLame, both with the gui and BeeSweet's gui, the encoded mp2 file always starts with an annoying loud clicking sound.

I capure videos with Mjpeg compression at 720 x 576 PAL, using a capture card. I do not use audio compression and sample at 48.000 Hz.
After extracting the audio and editing it (fade in and out, etc), I feed the video and the wav to TMPGEnc and let it encode using the DVD preset.
Then I create a SVCD compliant file too, before discarding the source file.

It would be convenient for me to encode the mp2 file manually sometimes. That way, after the mpeg-2 encoding is done and I notice I should have, for example, normalized the audio, I could make some changes to the wav file, encode to mp2 and mux it into the Mpeg-2 file, instead of starting a new encoding process, just to mux in a new audio file.

When I let TMPGEnc encode both audio and video, using TooLame, I don't get clicks. When I encode the wav to mp2 manually with Beesweet or the Lame gui, I get clicking sound at the start of the audio.

It isn't a playback problem. When I open the mp2 in Sound Forge, I see a large spike at the beginning of the file.

I have taken a screen shot of TMPGEnc's settings when TooLame starts and use the same ones in BeeSweet and copied them. Still, I get a clicking sound.

This is the setting in Besweet:
"C:\Program Files\Toolame_0.2i\tooLAME.exe" -s 48.0 -m s -p 1 -b 384 -e "f:\MJPEG\masayah_audio48.wav" "f:\besweet.mp2"

Any help would be much appreciated

/Swan

DSPguru
22nd November 2002, 14:51
are you using ssrc for downsampling ?

:logfile:

Swan
22nd November 2002, 19:25
are you using ssrc for downsampling ?
No.

I do this:
1. capture
2. edit clip in VirtualDub --> DirectstreamCopy --->new video file
3. Open new video file in VirtualDub ---> Export wav
4. Feed the wav to Beesweet
The wav sounds fine. The encoded mp2 file starts with a click.

When I downsampled (for the SVCD) I used Wavelab.
Same procedure as above, except I opened the wav in Wavelab, saved as a new file, downsampled to 44.100 Hz, then fed that to Beesweet (or rather Toolame, using the Gui for Besweet, I guess). The downsampled wav sounds fine when Wavelab does the job, but when I let Toolame downsample, it sounds awful.

I'll see if I find the log file and post it. Thanks a lot for wanting to help.

/Swan

Swan
23rd November 2002, 18:07
I think I've cracked it. :)
I noticed yesterday that if I opened a file I had edited in Wavelab in Sound Forge, and just saved it without modifications, I did *not* get a click. So, I nailed it down to Wavelab. I figured it may be writing something into the header of the wav, which TooLame doesn't understand. I checked the help file and there it was:
"Create optimized audio file headers:
This option adds some space to align the first sample of the file on a disk sector. Note: Some applications do not properly read optimized Wave file headers. These applications read the space as the real start of the file, which can cause a click at the start. Disable the option if this occurs.".

I'm hoping someone else can benefit from this info too.
Unchecking "Create optimized audio file headers" seems to solve the issue. It does not explain why the click didn't get produced when letting TMPGEnc encode the audio from a Wavelab-produced wav, though. It uses TooLame too, so it's till a bit of a mystery. Or does TMPGEnc open the wav one specifices, then creates a new, temporary wav file, which it then encodes to mp2?
That would explain it, wouldn't it? If TMPGEnc makes a temp wav file (without the "optimized audio file header").

One question, which is the best tool to use in BeeSweet for mp2 encoding?
TooLame or MP2enc.dll?

As I understand, pressing the TooLame button and then wav-->mp2 uses TooLame, right?
And pressing the BeeSweet button and then wav-->mp2 uses Mp2enc.dll?

/Swan