Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 31st December 2005, 12:02   #21  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,987
Quote:
Originally Posted by scharfis_brain
I don't know whether you are already doing this:

any_audiosurce()
ConvertAudioTo24bit() #or better float or 32bit
downmix() / upmix() / normalize()
ConvertAudioTo16bit()

this should effectively reduce rounding errors.
From AviSynth doc:

Starting from AviSynth v2.5. If some filters doesn't support a specific sample type, they are converted to the format preserving most quality (most often floats). Float samples are also automatically converted back to 16bit before delivering them as output.
SoxFilter converts audio to 32 bit integers.
Amplify: 8bit and 24bit Audio samples are converted to float in the process, the other audio formats are kept.
Normalize: The audio sample type is converted to float or is left untouched if it is 16 bits.
SSRC Shibata Sample Rate Converter is a resampler. Audio is always converted to float.
...

Then a first conversion to a specific format don't guarantee maintain this format along a DSP function.
We can analyze each DSP to search the optimum format.
tebasuna51 is offline   Reply With Quote
Old 31st December 2005, 12:31   #22  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,653
since we are using several chained instances of mixaudio, we need to process in a higher bit depth than 16 bit.
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 2nd January 2006, 04:53   #23  |  Link
Prodater64
Registered User
 
Join Date: Mar 2004
Posts: 266
I don't understand how does it work.
I want to know how to do any format to ac3 output.
Could it be reached from command line?
Is ac3 output configurable (channels, hz, kbps, etc.)
Once the script is created, with which app i will obtain the final ac3 audio file?
TIA.
__________________
Prodater64
Prodater64 is offline   Reply With Quote
Old 2nd January 2006, 11:58   #24  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,987
Quote:
Originally Posted by scharfis_brain
since we are using several chained instances of mixaudio, we need to process in a higher bit depth than 16 bit.
The Downmix DSP function's can be improved replacing the line 9 from file DownMix.extension:

c{2}=last

with:

c{2}=ConvertAudioToFloat(last)

All internal plugins used (GetChannel, MixAudio, Amplify and MergeChannels) support float format (also Normalize if you want use this DSP after the Downmix).

In a simple test the differences between the int16 and float methods are below 0.0001 (-80.76 dB)
tebasuna51 is offline   Reply With Quote
Old 3rd January 2006, 15:22   #25  |  Link
Mr_Odwin
FAVC Man
 
Mr_Odwin's Avatar
 
Join Date: Nov 2005
Posts: 411
Quote:
Originally Posted by scharfis_brain
ConvertAudioTo24bit() #or better float or 32bit
ConvertAudioTo16bit()

this should effectively reduce rounding errors.
A bit off topic I know, but what do those functions do? What is the difference between 16 bit, 24 bit, 32 bit and float? Is one 'more accurate' but more cpu-intensive? Google wouldn't tell me.
Mr_Odwin is offline   Reply With Quote
Old 8th January 2006, 14:30   #26  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,987
BeHappy New Year!

I make some mod's to BeHappy and I have also a petition, all included in:
http://personal.telefonica.terra.es/...a/behappym.zip
Here is a brief description:

1) I don't know how generate UniqueID, then for new extension I copy the Downmix UniqueID and I make a little change. Works for me.

2) Downmix: Mod <AudioDSP> Append DPL I option and c{2}=ConvertAudioToFloat(last) in <ScriptPrologue>

3) SSRC: New <AudioDSP> multioption. The samplerate conversion utility.

4) Mono -> Stereo: New <AudioDSP> without comment.

5) TimeStretch: New <AudioDSP> Only to check this function with 'tempo' parameter and two common presets. Maybe we need a complex emergent window to select between the three parameters 'tempo', 'pitch' and 'rate' and their associate values (like Belight 'SoundTouch').
At last the most used 'tempo' need a capture box to put manualy exact values (a slider don't work). Maybe at 'Tweak' section?.

6) MPASource: New <AudioSource>: Tested this decoder plugin (avisynth.org) and work ok for mp3 and mp2 inputs.

7) ffmpeg MP2: New <AudioEncoder>: Tested ffmpeg like mp2 encoder.

8) TODO:
We can use avs input to emulate the BeSweet input .mux (6 mono wav like input), with this merge.avs:

m1 = WAVSource("D:\Test\Mono_FL.wav")
m2 = WAVSource("D:\Test\Mono_FR.wav")
m3 = WAVSource("D:\Test\Mono_C.wav")
m4 = WAVSource("D:\Test\Mono_LFE.wav")
m5 = WAVSource("D:\Test\Mono_SL.wav")
m6 = WAVSource("D:\Test\Mono_SR.wav")
MergeChannels(m1, m2, m3, m4, m5, m6)

But I don't know how split a multichannel wav in mono wavs with BeHappy.
Maybe Dimzon can include a new 'Destination' item 'Mono wavs Writer' inside BeHappy code, or anybody can make a 'decoder' with standar input support.
I think is easy to do, but out of my knowledge. I only can can write a simple standalone app to do this job with a multichannel wav file input, included (Wav2mono.zip) in behappym.zip.

I appreciate test and comment.
tebasuna51 is offline   Reply With Quote
Old 10th January 2006, 11:35   #27  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by tebasuna51
BeHappy New Year!
I make some mod's to BeHappy and I have also a petition, all included in:
http://personal.telefonica.terra.es/...a/behappym.zip
Here is a brief description:
WOW, Thanx a lot!
Unfortunally I can't download it now

Quote:
Originally Posted by tebasuna51
1) I don't know how generate UniqueID, then for new extension I copy the Downmix UniqueID and I make a little change. Works for me.
http://kruithof.xs4all.nl/uuid/uuidgen

Quote:
Originally Posted by tebasuna51
7) ffmpeg MP2: New <AudioEncoder>: Tested ffmpeg like mp2 encoder.
Why ffmpeg and not tooLame? Does ffmpeg produce better quality?

Quote:
Originally Posted by tebasuna51
or anybody can make a 'decoder' with standar input support.
I will write it a little later
dimzon is offline   Reply With Quote
Old 10th January 2006, 14:12   #28  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,987
Thanks for the reply.
Quote:
Originally Posted by dimzon
Why ffmpeg and not tooLame? Does ffmpeg produce better quality?
I don't know if there are quality differences, but TooLame don't work for me.
I tried TooLame v0.2k and v0.2l.

The unique partial success I get is with TooLame v0.2l and this parameters:
<ExecutableArguments>- "{0}"</ExecutableArguments>

Partial because:
- TooLame don't read the header and is treated as raw PCM, then there are a initial click and the data is treated as 44100 (default for TooLame)

- Insert a:
<UseRawPCM>true</UseRawPCM>
seems don't work for this kind of extension.

- Insert a parameter to override the default 44100 like:
<ExecutableArguments>-s 48000 - "{0}"</ExecutableArguments> or
<ExecutableArguments>- -s 48000 "{0}"</ExecutableArguments>
Produce a:
Error: Can't start encoder: Cannot process request because the process (1644) has exited.

- With TooLame v0.2k the parameters:
<ExecutableArguments>- "{0}"</ExecutableArguments>
work without errors but the encoded file is incorrect (a click and a short silence).

- Any other combination of parameters produce errors like:
Error: Abnormal encoder termination 1 OR
Error: Can't start encoder: Cannot process request because the process (596) has exited.

Maybe I don't found the correct method.
tebasuna51 is offline   Reply With Quote
Old 14th January 2006, 10:26   #29  |  Link
Prodater64
Registered User
 
Join Date: Mar 2004
Posts: 266
I asked a question on jan/2 http://forum.doom9.org/showthread.ph...695#post760695

Could somebody answer me, please.

Quote:
I don't understand how does it work.
I want to know how to do any format to ac3 output.
Could it be reached from command line?
Is ac3 output configurable (channels, hz, kbps, etc.)
Once the script is created, with which app i will obtain the final ac3 audio file?
TIA.
__________________
Prodater64
Prodater64 is offline   Reply With Quote
Old 14th January 2006, 13:11   #30  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,987
Quote:
Originally Posted by Prodater64
I don't understand how does it work.
Refer to original idea for a complete discussion:
http://forum.doom9.org/showthread.php?t=103069

Basically:
1) Open/Decode any audio source to obtain a uncompressed audio.
You can use a specific audio decoder plugin (NicAudio for dts/ac3, MpaSource for mp2/mp3) or the generic DirectShowSource then the adequate installed filter is used. If you have ffdshow installed you can use Audio decoder configuration facility.

2) Use any DSP or Tweak option to modify the uncompressed audio. Then you can: Delay, Split, Downmix, Resample (SSRC), Stretch, Amplify, Normalize, ...(the Upmix option don't work now).

3) Recompress the audio (or save as wav) with any of the tested encoders.

Quote:
Originally Posted by Prodater64
I want to know how to do any format to ac3 output.
1) Select the source and the appropriate decoder (or DirectShowSource).
2) Apply the desired DSP and/or Tweak options. (maybe nothing)
3) Select the output filename and ffmpeg ac3 encoder
4) Add to Job Control and run the job (in Job Control window)

Quote:
Originally Posted by Prodater64
Could it be reached from command line?
Then you need write the avs script (or use Export Avisynt Script from BeHappy), and use BePipe (see the related thread 'original idea')

Quote:
Originally Posted by Prodater64
Is ac3 output configurable (channels, hz, kbps, etc.)
The free encoder ffmpeg only accept, afaik, the bitrate parameter (like ac3enc with BeSweet). The channels and Hz are taken from the source (DownMix or Resample can modify this).

Quote:
Originally Posted by Prodater64
Once the script is created, with which app i will obtain the final ac3 audio file?
Add to Job Control and run the job (in Job Control window) and the ac3 is obtained.
tebasuna51 is offline   Reply With Quote
Old 16th January 2006, 18:42   #31  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,987
Tested TwoLAME 0.3.3 Release 2005-06-09, (The fork of the tooLAME project. ICL4.5), from http://www.rarewares.org/mp3.html

It work fine with BeHappy and is based in TooLAME 0.2mbeta, then can be used instead ffmpeg for mp2 encoder.

There are new version 0.3.4 and 0.3.5 (Last updated 29-Nov-2005) in http://www.twolame.org/ , but I don't found any Windows compiled exe.

Included in http://personal.telefonica.terra.es/...a/behappym.zip with other minor changes (interested see the readme inside the zip).
tebasuna51 is offline   Reply With Quote
Old 16th January 2006, 18:47   #32  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by tebasuna51
Tested TwoLAME 0.3.3 Release 2005-06-09, (The fork of the tooLAME project. ICL4.5), from http://www.rarewares.org/mp3.html

It work fine with BeHappy and is based in TooLAME 0.2mbeta, then can be used instead ffmpeg for mp2 encoder.

There are new version 0.3.4 and 0.3.5 (Last updated 29-Nov-2005) in http://www.twolame.org/ , but I don't found any Windows compiled exe.

Included in http://personal.telefonica.terra.es/...a/behappym.zip with other minor changes (interested see the readme inside the zip).
can you reupload it to http://www.mytempdir.com
dimzon is offline   Reply With Quote
Old 16th January 2006, 18:55   #33  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,987
@Dimzon
Upload bhappym.zip: http://www.mytempdir.com/388248
tebasuna51 is offline   Reply With Quote
Old 16th January 2006, 19:05   #34  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by tebasuna51
@Dimzon
Upload bhappym.zip: http://www.mytempdir.com/388248
Ok, Thanx!
according documentation SSRC can't convert any samplerate to any another.
http://www.avisynth.org/SSRC

but You can use ResampleAudio http://www.avisynth.org/ResampleAudio

So I think better solution will be to write more intellectual function. It must check: does SSRC applicable to this samplerates and use ResampleAudio if not
dimzon is offline   Reply With Quote
Old 16th January 2006, 19:12   #35  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,987
Also TimeStretch can do the job:
"Adjusting "Rate" is equivalent to using AssumeSampleRate and ResampleAudio, but at very high quality."
tebasuna51 is offline   Reply With Quote
Old 23rd January 2006, 07:16   #36  |  Link
buttfacepoop
Registered User
 
Join Date: Feb 2005
Posts: 13
great work dimzon. i switched over to behappy from besweet as encoding with nero 7's aac was becoming too difficult with besweet.

just one question - is it not possible to do 2-pass encoding with your tool because of the stdin input?
buttfacepoop is offline   Reply With Quote
Old 23rd January 2006, 09:21   #37  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by buttfacepoop
great work dimzon. i switched over to behappy from besweet as encoding with nero 7's aac was becoming too difficult with besweet.

just one question - is it not possible to do 2-pass encoding with your tool because of the stdin input?
Does you really need it? Can you post me link @ 2-pass audio encoder?
dimzon is offline   Reply With Quote
Old 24th January 2006, 00:51   #38  |  Link
buttfacepoop
Registered User
 
Join Date: Feb 2005
Posts: 13
Quote:
Originally Posted by dimzon
Does you really need it? Can you post me link @ 2-pass audio encoder?
sorry i mean normalizing.
buttfacepoop is offline   Reply With Quote
Old 24th January 2006, 11:42   #39  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by buttfacepoop
sorry i mean normalizing.
normalizing are possiible via AviSynth ( Normalize() )
dimzon is offline   Reply With Quote
Old 29th January 2006, 01:02   #40  |  Link
NorthPole
Registered User
 
Join Date: Jan 2006
Posts: 141
Really liked the idea behind behappy and looking forward to the upmix option (if it is possible).

I had a question about the bepipe command line utility. Currently I am upmixing audio for recorded TV. I have been using fbr2k with a dsp plugin to convert and write the 6 channel wave. Then I was pluggin the wave into behappy to get the correct ac3 file. I tried to go directly from the mp2 to the ac3 in fb2k but can't because of the ac3 channel mapping problem. I had the idea of calling bepipe from fb2k to remap (i think its just frameserving) the audio and encode with ffmpeg.
To see if it could worked I tried to get bepipe working from the command prompt with the following command line:

BePipe.exe --script "WavSource(^incorrect.wav^) AudioDubEx(BlankClip(length=Int(1000*AudioLengthF(last)/Audiorate(last)),width=32,height=32,pixel_type=^RGB24^,fps=1000),last) 6==Audiochannels(last)?GetChannel(last,1,3,2,5,6,4):last AudioDubEx(Tone(),last)" | ffmpeg.exe -i - -y -acodec ac3 -ab 448 "correct.ac3" <incorrect.wav

No luck. runs fine but doesn't remap the channels. Any suggestions?
NorthPole is offline   Reply With Quote
Reply

Tags
behappy

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:47.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.