PDA

View Full Version : trying to convert audio from 44100 to 48000


addictarmy
17th December 2003, 22:23
I'm trying to transform the audio on my video files to ac3 with a sampling rate of 48000, but am having problems.

Most of my videos have audio with mp3 44100.
I use virtualdub to save it as a wave file which sounds fine.
But when I use besweet/ac3machine to convert it into an ac3 with a sampling rate of 48000 I get lots of distortion.

I've tested it and I only get the distortion when I try to convert it to 48000. If I leave it at 44100 the audio is distortion free.

This is the command line I am using.
"C:\dvd\BeSweetv1.4\BeSweet.exe" -core( -input "C:\dvd\_work\FLCL Episode 1 Fooly Cooly.wav" -output "C:\dvd\_work\FLCL Episode 1 Fooly Cooly.ac3" -logfilea C:\dvd\BeSweetv1.4\BeSweet.log ) -ssrc( --rate 48000 ) -boost( /b=3db ) -ac3enc( -b 384 ) -profile( The AC3Machine v0.4 )

Anyone have any ideas or other tools they've used to do this?

KpeX
17th December 2003, 22:37
Hi -

Try converting to .wav first and see if the problem still occurs. AC3enc.dll is known to produce buggy streams, see the BeSweet FAQ. Also post your full logfile.

addictarmy
17th December 2003, 22:58
If you mean try converting the 44100 wav file to 48000 wave file, I've tried that too and I get the same distortion :(

KpeX
17th December 2003, 23:33
Yes, that is what I meant.

:logfile:

What about eliminating the boost section, does the problem still occur?

addictarmy
18th December 2003, 00:00
I think I may have figured it out but I'm not quites sure how to word it.

From virtual dub when I choose to "Save WAV" it saves the audio from the avi with a wav extension, but under properties it says it's a MPEG Layer-3.

http://home.austin.rr.com/addictarmy/misc/ac3.jpg

So I tried saving the wav file as a PCM wave file first then using besweet to convert it into ac3 and it seems to work ok.

I'm not exactly sure, but I guess it means that the audio format gets preserved somehow when virtualdub exports it to wav, and if it was mp3 besweet no like.

It would be nice to just to do things in 1 step instead of 2 so if anyone knows a way to just take the ausio and convert it easily into ac3 that would be great, if not I have a 2 step workaround.

KpeX
18th December 2003, 00:14
Besweet can do avi input. Just get the vobinput.dll plugin. I haven't tested avi input recently but vob input works great so I'd recommend giving it a shot.

pacohaas
18th December 2003, 01:32
you'll want to update to the latest besweet too, a lot has been fixed since 1.4

addictarmy
22nd December 2003, 22:33
thanks for the recommendations I'll try the vobinput.dll & upgrade to the newest version of besweet too ;)

LigH
23rd December 2003, 14:20
Me too:

For several months now, we discuss again and again problems with BeSweet upon upsampling any format from 44100 to 48000 Hz, mainly for converting SVCDs or similar material to DVD (of course, usually nonsense, but people keep wanting that). And I always forget to ask here, where DSPguru may help... :angry:

In most cases, upsampling distorts the sound, especially when trying to convert from one compressed format to another (e.g. from MP2 to MP2). Often the workaround via WAV files helps, but it limits the achievable quality (due to the limited resolution of 16 bit integer samples). It may be possible that integer samples are handled differently, but definitely it must be related to the shibatch.dll - because the latest SSRC.EXE upsamples without distorsion.

P.S.: Usually the latest versions of BeSweet were installed due to our recommendation (let's say, up to 1.5b23).

theReal
27th December 2003, 01:01
... and I think there's still this major problem with AC3enc that will produce low-volume AC3s (and if you amplify the source you'll also get a lot of distortion)

I guess this problem hasn't been solved yet (or has it??)

LigH
28th December 2003, 14:37
As far as I read, DSPguru solved the problem with AC3Enc - by not supporting it anymore, up from 1.5b24! :rolleyes: :D

Unfortunately, no answer from DSPguru yet, regarding the upsampling problem; would it be impolite to ask via PM to look here? Being a SuMo myself, I know that many PMs can be very annoying... ;)

Happygolucky
28th December 2003, 16:20
I've encountered this problem, also, and have a solution that works for me. It's not pretty, but it works. I first extract the audio from the avi using VirtualDub. VirtualDub does say it is a WAV, but it is really whatever format the AVI file has, usually MP3. I change the extension to MP3 (or whatever it is supposed to be). Then, to do the 44.1 to 48 upsampling, I use Easy CD-DA Extractor's Audio Converter to convert the MP3 file to a PCM WAV with 48KHz sample rate. I then use BeSweet (via the BeSweet GUI in Wizard mode) to convert the resulting WAV file to AC3. I never had any success in getting BeSweet to do the 44.1 to 48 upsampling correctly, every file had problems in playback. Getting another utility to do the MP3 to WAV conversion and doing the upsampling in that step, seems to solve the problem.

Again, it isn't pretty, and is terribly inefficient I would think, but it works.

LigH
28th December 2003, 16:57
Instead of saving the audio stream as WAV file in Direct Stream Copy mode, better demux it with VirtualDubMod to a pure file - so you can avoid a useless and disturbing WAV header as well as renaming a file to a wrong extension (which may confuse applications which rely on file formats: decoding a WAV header by an MP3 decoder may distort the output - don't do that!).

Happygolucky
29th December 2003, 15:00
Originally posted by LigH
Instead of saving the audio stream as WAV file in Direct Stream Copy mode, better demux it with VirtualDubMod to a pure file - so you can avoid a useless and disturbing WAV header as well as renaming a file to a wrong extension (which may confuse applications which rely on file formats: decoding a WAV header by an MP3 decoder may distort the output - don't do that!).

Normally I would agree with you, but so far I've not had any problem with my method. Evidently Easy CD-DA's converter doesn't care much about the header for the file, it does the MP3 > WAV conversion with no problems. When I attempted to use BeSweet to do the conversion (I tried with VirtualDub extracted audio as well as having BeSweet extract the audio directly from the AVI file) the result was horrible. Usually the resulting AC3 file sounded like a den of crickets and chipmunks having a party. It was not usable.

LigH
29th December 2003, 15:18
But if you export e.g. an AC3 audio stream as WAV file, and you open the file with an application that cares about the content (e.g. looks for a RIFF-WAVE or an AC3 header in the file), it will detect that the file indeed is a RIFF-WAVE file, tries to decode it via ACM codecs - but cannot find an ACM codec for AC3 audio, and fails.

Never rename a file just because of laziness and claim that almost no programm would have a problem... There may always be a program which will get confused. It is always better to get a pure file if a program wants it pure. Additional data in the file may be ignored, but may also lead to distorted audio for just a few milliseconds, or to a failure.

Happygolucky
31st December 2003, 19:28
Originally posted by LigH
But if you export e.g. an AC3 audio stream as WAV file, and you open the file with an application that cares about the content (e.g. looks for a RIFF-WAVE or an AC3 header in the file), it will detect that the file indeed is a RIFF-WAVE file, tries to decode it via ACM codecs - but cannot find an ACM codec for AC3 audio, and fails.

Never rename a file just because of laziness and claim that almost no programm would have a problem... There may always be a program which will get confused. It is always better to get a pure file if a program wants it pure. Additional data in the file may be ignored, but may also lead to distorted audio for just a few milliseconds, or to a failure.

I never claimed "almost no program would have a problem", only that the programs I've used, and mentioned in my post, have no problem. Again, I've tried many methods, I've used every program at my disposal (and I have a lot of them, mostly shareware/freeware) and the method I outlined is the one that produces the best results for me.

rs008f
15th April 2004, 05:03
http://forum.doom9.org/showthread.php?s=&threadid=69781&highlight=shibatch.dll

LigH
11th April 2005, 11:50
(Blowing a heap of dust off this thread...)

I wonder if DSPguru has "left the building"; at least, it seems that he does not have much time (or a good mind) to fix the still open issues.

Instead, DarkAvenger is still working on a new version of HeadAC3he, which will probably become a multi-platform tool (running on Linux as well as Windows). And he went a good part on the way to fix upsampling with SSRC/SHIBATCH.

johnman
11th April 2005, 14:05
You might find it interesting i have rewritten ssrc so it can be used as an external dll. It is actually for my own use, but maybe i can get it to work with besweet. Im working on it, but curently not very hard since i got some not so interesting tests this week. After that i think i can get it to work (with up/down sampling and dithering). BTW im not a besweet user, so i cant promise anything :)

echooff
11th April 2005, 14:22
That would be nice. Anyone willing to give their time for tools in our community is much appreciated.:p

johnman
13th April 2005, 21:26
I've sended a pm to dspguru about implementing my version of the ssrc dll directly in besweet but he is a little busy. So i wonder if anyone on this forum has any experience with making plugins for besweet. I dont even got experience with besweet, so any help is greatly appreciated.