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 2nd February 2006, 13:54   #61  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
@tebasuna51
Great!
Unfortunally I'm not DSP expert.
Why not to use Normalize() BEFORE Dynamic Range Compression?
dimzon is offline   Reply With Quote
Old 2nd February 2006, 15:54   #62  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,778
Quote:
Originally Posted by dimzon
Why not to use Normalize() BEFORE Dynamic Range Compression?
The decoder output (NicAudio) have the full dynamic range and can have samples with 0 dB, then the Normalize function do nothing with this signal.

We need, also, apply attenuation over the decoder output to compensate DialNorm (if distinct of -31 dB) for input correctly in DRC curves.

The solution is make alternate curves with normalized output. I'm work about this.
tebasuna51 is offline   Reply With Quote
Old 2nd February 2006, 16:34   #63  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by tebasuna51
The decoder output (NicAudio) have the full dynamic range and can have samples with 0 dB, then the Normalize function do nothing with this signal.
Do not forget - we can use DRC on NON-AC3 input

Quote:
Originally Posted by tebasuna51
The solution is make alternate curves with normalized output. I'm work about this.
Yeah, it's the best
dimzon is offline   Reply With Quote
Old 2nd February 2006, 18:57   #64  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
fresh beta is out
dimzon is offline   Reply With Quote
Old 2nd February 2006, 19:34   #65  |  Link
Dayvon
I'm Dayvon, an MP4 addict
 
Dayvon's Avatar
 
Join Date: Dec 2005
Location: Minneapolis
Posts: 238
Quote:
Originally Posted by dimzon
2 All
Hi! You can help BeHappy project!
I need:
BeHappy logo & icons
I'd like to help with this Dimzon. You have any preferences or specifics in mind?
__________________
My Gear
Dayvon is offline   Reply With Quote
Old 3rd February 2006, 04:34   #66  |  Link
NorthPole
Registered User
 
Join Date: Jan 2006
Posts: 141
Made some changes to the upmix extension I posted earlier...

Removed the option to use the avisynth equilizer because it is extremely slow in execution.

I added a second upix option that tries to remove most of the dialog from the left, right and surround speakers and sends it just to the center speaker.
Also, inverted the LFE, attenuated and delayed the surround speakers as before.

Code:
<?xml version="1.0"?>
<BeHappy.Extension xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://workspaces.gotdotnet.com/behappy">
  <AudioDSP UniqueID="9579E57B-2D27-4583-99A4-921718E25B41">
    <Plugin>
      <MultiOptionDSP Type="BeHappy.Extensions.MultiOptionDSP, BeHappy">
        <TitleFormatString>{0}</TitleFormatString>
        <ScriptPrologue>
	# Store clip in variable
	Stereo_{2} = convertaudiotofloat(last)
        </ScriptPrologue>
        <Option>
          <Name>Upmix with equalizer adjustments</Name>
          <Value>
	# Sox filter using frequency selection, 20ms surround delay and attenuation
	Front_{2} = mixaudio(Stereo_{2}.soxfilter("filter 0-600"),mixaudio(Stereo_{2}.soxfilter("filter 600-1200"),Stereo_{2}.soxfilter("filter 1200-7000"),0.45,0.25),0.50,1)
	Back_{2} = mixaudio(Stereo_{2}.soxfilter("filter 0-600"),mixaudio(Stereo_{2}.soxfilter("filter 600-1200"),Stereo_{2}.soxfilter("filter 1200-7000"),0.35,0.15),0.40,1)
	fl_{2} = GetLeftChannel(Front_{2})
	fr_{2} = GetRightChannel(Front_{2})
	cc_{2} = ConvertToMono(stereo_{2}).SoxFilter("filter 625-24000")
	lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 100","vol -0.5")
	sl_{2} = GetLeftChannel(Back_{2})
	sr_{2} = GetRightChannel(Back_{2})
	sl_{2} = DelayAudio(sl_{2},0.02)
	sr_{2} = DelayAudio(sr_{2},0.02)
          </Value>
        </Option>
        <Option>
          <Name>Upmix with center channel dialog</Name>
          <Value>
	# channel subtraction with sox filter, 20ms surround delay and attenuation
	left_{2} = stereo_{2}.GetLeftChannel()
	right_{2} = stereo_{2}.GetRightChannel()
	fl_{2} = mixaudio(left_{2}.soxfilter("filter 0-24000"),right_{2}.soxfilter("filter 0-24000"),0.6,-0.5)
	fr_{2} = mixaudio(right_{2}.soxfilter("filter 0-24000"),left_{2}.soxfilter("filter 0-24000"),0.6,-0.5)
	cc_{2} = ConvertToMono(stereo_{2}).SoxFilter("filter 625-24000")
	lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 100","vol -0.5")
	sl_{2} = mixaudio(left_{2}.soxfilter("filter 0-24000"),right_{2}.soxfilter("filter 0-24000"),0.5,-0.4)
	sr_{2} = mixaudio(right_{2}.soxfilter("filter 0-24000"),left_{2}.soxfilter("filter 0-24000"),0.5,-0.4)
	sl_{2} = DelayAudio(sl_{2},0.02)
	sr_{2} = DelayAudio(sr_{2},0.02)
          </Value>
        </Option>
        <ScriptEpilogue>
	# Return result
	MergeChannels( fl_{2}, fr_{2}, cc_{2}, lfe_{2}, sl_{2}, sr_{2})
	ConvertAudioTo16Bit()
        </ScriptEpilogue>
      </MultiOptionDSP>
    </Plugin>
  </AudioDSP>
</BeHappy.Extension>
@tebasuna51

Nice dynamic range compression extension. I agree that it would be nice to be able to use negative values in tweak.

@Dimzon

I tried this code but it executed extremely slowly

Code:
left_{2} = last.GetLeftChannel()
right_{2} = last.GetRightChannel()
fl_{2} = mixaudio(left_{2},right_{2},0.6,-0.5)
fr_{2} = mixaudio(right_{2},left_{2},0.6,-0.5)
cc_{2} = ConvertToMono(stereo_{2}).SoxFilter("filter 625-24000")
lfe_{2} = ConvertToMono(stereo_{2}).SoxFilter("lowpass 100","vol -0.5")
sl_{2} = mixaudio(left_{2},right_{2},0.5,-0.4)
sr_{2} = mixaudio(right_{2},left_{2},0.5,-0.4)
sl_{2} = DelayAudio(sl_{2},0.02)
sr_{2} = DelayAudio(sr_{2},0.02)
NorthPole is offline   Reply With Quote
Old 3rd February 2006, 11:07   #67  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by Dayvon
I'd like to help with this Dimzon. You have any preferences or specifics in mind?
Just make it eyecandy
dimzon is offline   Reply With Quote
Old 3rd February 2006, 16:39   #68  |  Link
Dayvon
I'm Dayvon, an MP4 addict
 
Dayvon's Avatar
 
Join Date: Dec 2005
Location: Minneapolis
Posts: 238
Quote:
Originally Posted by dimzon
Just make it eyecandy
Is this creative liberty you've given me?
__________________
My Gear
Dayvon is offline   Reply With Quote
Old 3rd February 2006, 16:45   #69  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by Dayvon
Is this creative liberty you've given me?
Yes.
By the way - since BeHappy is avisynth based software maybe we can use portion of avisynth logo in it (just proposal, feel free not to do it)
dimzon is offline   Reply With Quote
Old 3rd February 2006, 17:12   #70  |  Link
Dayvon
I'm Dayvon, an MP4 addict
 
Dayvon's Avatar
 
Join Date: Dec 2005
Location: Minneapolis
Posts: 238
Quote:
Originally Posted by dimzon
Yes.
By the way - since BeHappy is avisynth based software maybe we can use portion of avisynth logo in it (just proposal, feel free not to do it)
I'll look into it!
__________________
My Gear
Dayvon is offline   Reply With Quote
Old 4th February 2006, 12:59   #71  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,778
@Dimzon
I get incorrect wav output (BlockAlign incorrect) with your last release (and also incorrect aac encodes).

Maybe there are a bug in Encoder.cs (now there are 2 writeHeader routines)

Code:
CORRECT:
private void writeHeader(Stream target )  {
...
	target.Write(BitConverter.GetBytes(m_wavHeader.nBlockAlign),0,2);
	target.Write(BitConverter.GetBytes(m_wavHeader.wBitsPerSample),0,2);
...
}

INCORRECT:
private void writeHeader(Stream target, AviSynthClip x )  {
...
	target.Write(BitConverter.GetBytes(x.BitsPerSample/8),0,2);  // ?????
	target.Write(BitConverter.GetBytes(x.BitsPerSample),0,2);
...
}
BUG: BlockAlign = ChannelsCount * BitsPerSample/8
tebasuna51 is offline   Reply With Quote
Old 4th February 2006, 22:07   #72  |  Link
TheBashar
Registered User
 
TheBashar's Avatar
 
Join Date: Jan 2002
Posts: 112
Sanity Check

Can someone please give me a sanity check with this scheme? I like to cut out the opening and ending credits of my TV series encodes with something like Trim(90,6000)+Trim(9000,61000) for the video. Cutting, merging, and muxing the audio is ehh okay, but I've always struggled with some synch issues.

I'd like to try avisynth processing via BeHappy to see if I can use the same Trim statements to manipulate the audio as I do with the video so maybe I can avoid or eliminate the synch issues.

I set up BeHappy to do an ac3 -> aac conversion and exported the avs to look at. I was wondering if this would work.

Code:
audio = DirectShowSource("audio.ac3")
audio = EnsureVBRMP3Sync(audio)
# Above same as BeHappy Generated:
video = MPEG2Source("video.d2v")
AudioDeubEx(video, audio)
# Use same trim arguments as in video encoding script:
Trim(90,6000)+Trim(9000,61000)
AudioDubEx(Tone(), last)
# Below same as BeHappy Generated:
AudioDubEx(BlankClip(length=Int(1000*AudioLengthF(last)/Audiorate(last)), width=320,height=32,pixel_type="RGB24",fps=1000), last)
Normalize...
Encode...
Kill Video again...
So in essence I'd bring in the audio, apply the vbrsynch black magic, dub it to the actual video clip, trim with the video trim settings, kill the real video, dub it to the 1000 fps blank video, normalize, encode, and kill the blank video.

Is this a sane way to go about this task?

Thanks!
TheBashar is offline   Reply With Quote
Old 5th February 2006, 01:37   #73  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,778
You don't need:

AudioDubEx(BlankClip(length=Int(1000*AudioLengthF(last)/Audiorate(last)), width=320,height=32,pixel_type="RGB24",fps=1000), last)
...
Kill Video again...

Because this AudioDubEx sentence is only to use Trim in ms. (fps=1000), and Trim is used before based in video fps.

If you want maintain the ac3 without re-encode there are other method to trim the audio with DelayCut:

You want a first segment like this: Trim(90,6000)
If fps is 25 (replace 25 with your appropriate fps) you want a segment between 90/25 = 3.6 sec and 6000/25 = 240 sec. Then open DelayCut and Cut your original ac3 between Start = 3600 and End = 240000 ms.

For the second segment Cut between 360000 ms (9000/25 sec) and 2440000 ms. (61000/25 sec).

After join the two segments with:

> copy /B first.ac3 + second.ac3 full.ac3
tebasuna51 is offline   Reply With Quote
Old 6th February 2006, 11:56   #74  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by tebasuna51
BUG: BlockAlign = ChannelsCount * BitsPerSample/8
Are you 100% shure? (this will affect MeGUI too)
dimzon is offline   Reply With Quote
Old 6th February 2006, 13:06   #75  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,778
Quote:
Originally Posted by dimzon
Are you 100% shure? (this will affect MeGUI too)
With this kind of wavheader (PCM 16 or 32 bits int) always:

BlockAlign = ChannelsCount * BitsPerSample/8
tebasuna51 is offline   Reply With Quote
Old 6th February 2006, 13:09   #76  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by tebasuna51
With this kind of wavheader (PCM 16 or 32 bits int) always:

BlockAlign = ChannelsCount * BitsPerSample/8
Thanx a lot, will be fixed soon
dimzon is offline   Reply With Quote
Old 6th February 2006, 14:34   #77  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
http://forum.doom9.org/showthread.php?t=83752 - additional info about 5.1 upmix
dimzon is offline   Reply With Quote
Old 7th February 2006, 15:27   #78  |  Link
3dsnar
Registered User
 
3dsnar's Avatar
 
Join Date: Dec 2005
Location: Proxima Centauri
Posts: 315
Hi Dimzon. I have prepared the pseudosurround DLL for ya

I cannot attach it to this post, cause it is to big.
Please drop me an email: programmers AT aud-x.com
and I will reply and send you the attachement.

(ie. the DLL, and the complete project. Maybe it will be useful)

After downloading, please let me know, and I will remove it.
I will be happy to answer all your questions (if you have any).
__________________
Aud-X MP3 5.1 Format
3dsnar is offline   Reply With Quote
Old 7th February 2006, 15:33   #79  |  Link
shon3i
BluRay Maniac
 
shon3i's Avatar
 
Join Date: Dec 2005
Posts: 2,419
@Dimzon how to boost 6ch audio aac like hibridgain in besweet or autogk with mp3 ,with behappy
shon3i is offline   Reply With Quote
Old 14th February 2006, 00:11   #80  |  Link
grokwik
Registered User
 
grokwik's Avatar
 
Join Date: Oct 2004
Location: Aix en Provence
Posts: 25
Dimzon, thanks a lot for this awsome tool !
I can now transcode audio from multiple avi quickly. Every thing works fine.
I have noticed that nero aac encode works with or without neroipp.dll without any difference. Is this dll really necessary ?
grokwik 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 21:06.


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