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 5th October 2004, 03:17   #1  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
Guide: Stereo to 5.1 upmix using DPLII (2nd Ed.)

Stereo to 5.1 upmix using DPLII (2nd Ed.)
Originally posted by bleo, Updated by joshbm

Last Updated on October 28, 2004

This Updated Version adds/revises the following:
- Optional LFE channel to the DPLII upmix.
- Eliminates the need for a Hex Editor.
- Allows user to increase bit from 16-bit to 32-bit float.
- Correct channels with channel swapping
- Optional WAVE_EXT header.
- Sample Rate conversion on the fly, +more!


I. Software Required[list=1]All software used in this guide is freeware.[*]InterVideo Processor Fx (full 1.54 MB, required only 182 KB), from InterVideo WinDVD (Trial)[*]GraphEdit[*]ffdshow (http://ffdshow.sourceforge.net/)[*]BeSweet or other multi-channel encoder[/list=1]II. Stereo to 6-Channel Wave[list=1][*]Download and install the required software if you have not already. While you are downloading, it might be a good idea to briefly look over Section IV: Other Useful Information and apply changes accordingly. You may want to add 5 seconds of black to your video and 5 seconds of silence to your audio to allow the filter to mute the first ~1.5 seconds. Look at Section IV for more information.
[*]Make sure you run "register.bat" when you unzip GraphEdit and if you downloaded the full or required filters above. It contains filters such as WavDest necessary to this guide.
[*]In GraphEdit go to File > Render Media File... > Open your 2-channel audio file
[*]Clear everything except your stereo 2-channel file as well as "Wave Parser"
[*]Go to Graph > Insert Filters... > DirectShow Filters >
- Click on "InterVideo Audio Processor Fx > Insert Filter"
- Click on "ffdshow Audio Decoder > Insert Filter"
- Click on "WavDest > Insert Filter"
- Click on "File writer > Insert Filter"
* Once you have inserted File writer it will prompt you for a filename. This is your output 6-channel DPLII file.
* DO NOT connect these filters up *yet*!
[*]Setting up ffdshow Audio Decoder.
- Right click on "ffdshow Audio Decoder" > "Filter Properties..."
- Under "Supported Codecs" scroll down to "Uncompressed" (or whichever your input filetype is) and click on Decoder and make sure it is set to "all supported".
- If LFE is desired check "LFE Crossover" and click on it. Set the "Lowpass frequency" to about 120 (or your desired bass range) and set the gain appropriately (mine is at 0db). You may also choose to remove the bass from your incoming channels.
- From this point the channel mapping is as follows:
* Channel 1->"FL"
* Channel 2->"FR"
* Channel 3->"C"
* Channel 4->"LFE"
* Channel 5->"SL"
* Channel 6->"SR"

In order for channel mapping to be correct for most AC3 encoders (including BeSweet), you need to map the channels to:
* Channel 1->"FL"
* Channel 2->"C"
* Channel 3->"FR"
* Channel 4->"SL"
* Channel 5->"SR"
* Channel 6->"LFE"

And thus need to check "Channel Swap" and enter the following:
Quote:
Front left -> front left
Front center -> front right
Front right -> front center
Back left -> LFE
Back center -> back center
Back right -> back left
LFE -> back right
- Check "Mixer" and click on it. "Output speakers configuration" should be set to "3/2+LFE 5.1 channels"
- Click "Input/Output" and select all "Allowed sample formats..." and only check one desired "Supported output sample format".
- Some programs do NOT support wave files that are WAVE_EX (like BeSweet's ac3enc!)-- which is what ffdshow outputs! To remove this check: "Don't use WAVEFORMATEXSIBLE header when not needed"
- Click "Apply" then "OK" to exit with changes.
[*]Connect it up similarly to:
stereo.wav > Wave Parser > InterVideo Audio Processor Fx > ffdshow Audio Decoder > WavDest > File writer
[*]Setting up InterVideo Audio Processor Fx.
- Right click on "InterVideo Audio Processor Fx" > "Filter Properties..."
- Set the "Output CH" to "6 SPEAKER"
- Click on the "InterVideo Container DMO" tab.
- Click "InterVideo EXP DMO" under "Available DMOs" and click "Append <---"
- Click OK to exit the settings.
[*]Hit the Play button in GraphEdit and immediately follow by clicking Stop. This is necessary because "InterVideo Audio Processor Fx" filter needs to "initialize".
[*]Change settings in InterVideo Audio Processor Fx.
- Right click on "InterVideo Audio Processor Fx" > "Filter Properties..."
- Click on the "InterVideo EXP DMO" tab.
- Set the "Algorithm" to "ProLogic2"
- Click OK to exit the settings.
[*]Hit the Play button within GraphEdit and wait until it has finished (play button reactivates).[/list=1]
You now have a 6-Channel wave with LFE, no Hex Editing, channel swapped, at the desired bit-rate, ready for multichannel encoding in AC3, DTS, etc formats.

III. Stereo to 6-Channel AC3 Using ffdshow (ffmpeg's ac3enc)
You can not go to directly ac3 as of *yet*. That is why you must first create a 6ch wav, then run it through an AC3 encoder such as BeSweet (ac3enc from ffmpeg).
Quote:
Originally posted by Milan Cutka at 2004-10-13 21:46
I added a possibilty to connect ffdshow output directly to file writer and store data to a file. I tested it with ac3 and it produced a valid file.

However, it's still not it 20041012 version. [It will be available] in the next version, which should be ready within a month, or earlier if some serious bug will be found in current build..
IV. Other Useful Information
  • WinDVD's filter: InterVideo Processor Fx (using the DPLII upmix) mutes the first ~1.5-2 seconds. A temporary fix would be to add ~1.5+ seconds of black to your video and ~1.5+ seconds of silence to the beginning of your audio (must be an equal amount). This way it will allow the filter to mute the first ~1.5 seconds-- which is silence anyway. [Brainstorming another solution]
  • If you do not want WinDVD on your system, but want the filters to remain (InterVideo Processor Fx), then ahgc has a valid solution:
    Quote:
    Originally posted by Antonio at 2004-10-25 17:46
    Just keep graphedit window opened (using "Intervideo Audio Processor FX" filter) and perform normal uninstall of windvd. This way it will not remove the filter (c:\program files\intervideo\common\bin\*). [You will also need to regsvr32 each file.]
    [Update]: I've done this for you, download full 1.54 MB or required only 182 KB above for only the filters and run "register.bat".
  • Antonio (ahgc) also has another interesting comment:
    Quote:
    Originally posted by Antonio at 2004-10-23 03:12
    1. There is in fact some limitating factor concerning file size (destination), [around 4 GB]. I believe it has to do either with WavDest filter or File Writer filter.
    1.1. My solution was to split the source WAV into 2 and run them through graphedit separately. Then join them back toghether. Worked perfectly.
  • UrsaMtl pointed out as well:
    Quote:
    Originally posted by ursamtl at 2004-10-25 19:36
    For those of you upmixing music, you might want to switch to Music mode because the default DPLII Movie mode is optimized (especially in terms of its steering logic) for movie soundtracks with centered dialog. According to Dolby documentation, this may inadvertently center vocals that are intentionally off-center, etc. The other settings such as Panorama, Dimension, Center width control, Autobalance, etc.

    For more information on these settings, you can check out Dolby Surround Pro Logic II Decoder Principles of Operation. The Dolby Technical Library has several other informative articles.
__________________________________

Of course you can modify ffdshow settings to your liking as well as upmixing methods with Dolby Prologic II in InterVideo Audio Processor Fx such as Movie Mode and Music Mode as UrsaMtl pointed out. Sometimes I like to check "Sample Rate" and change the samplerate from 44100 Khz to 48000 Khz.
Troubleshooting: If you have *already* gone through this guide and are having problems with setting WAVE_EXT, bit-rate, etc. Make sure the settings in ffdshow are your desired ones and then clear your Graph and create a new one. Sometimes it will take clearing your graph and starting over again to get the graph to work properly.

Regards,
Josh

Last edited by joshbm; 29th October 2004 at 04:19.
joshbm is offline   Reply With Quote
Old 6th October 2004, 20:00   #2  |  Link
Sycho
This Is How It Goes
 
Sycho's Avatar
 
Join Date: Mar 2003
Location: Ontario Canada
Posts: 235
will the chnnels still be in the wrong order?
Sycho is offline   Reply With Quote
Old 7th October 2004, 01:27   #3  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
No, the order has been corrected. [edited for readability]

[edit]
Guide modified to use ffdshow instead of AC3Filter for easier channel switching.


Regards,
Josh

Last edited by joshbm; 26th October 2004 at 04:09.
joshbm is offline   Reply With Quote
Old 7th October 2004, 03:22   #4  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
[post deleted for readability sake]

Last edited by joshbm; 26th October 2004 at 04:09.
joshbm is offline   Reply With Quote
Old 8th October 2004, 00:34   #5  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
If you are encoding for BeSweet with ac3enc the current method above *should* be perfect because of its naming convention:

Channel 1->"FL"
Channel 2->"FR"
Channel 3->"C"
Channel 4->"LFE"
Channel 5->"SL"
Channel 6->"SR"

[Found to be incorrect, guide updated with proper channel swapping for BeSweet]

Otherwise use Channel Swapping in ffdshow [removed useless guide].

P.S. - Where's the cake and ice cream? It's my 150th POST!

Regards,
Josh

[Edited for correct readability]

Last edited by joshbm; 25th October 2004 at 20:40.
joshbm is offline   Reply With Quote
Old 8th October 2004, 21:18   #6  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
The new ffdshow now supports channel switching... it is a faster method than the matrix method I posted above. Give ffdshow a try, I am currently in the process of talking over the new features (WAVE_EX as optional) with a ffdshow developer.

Regards,
Josh
joshbm is offline   Reply With Quote
Old 12th October 2004, 03:21   #7  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
Updated!
joshbm is offline   Reply With Quote
Old 12th October 2004, 20:38   #8  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
* New version of ffdshow 20041012.

Watch for a new ffdshow version with a Direct Show Real-time AC3 encoder ! So instead of having a wave output file first (1.1MB/sec, 6ch, 32-bit float, 48000 Khz ~3.9 GB/hr wave!) then plugging that file into BeSweet, encode directly from your original stereo file to Dolby Digital 5.1 DPLII upmixed .

Last edited by joshbm; 13th October 2004 at 00:29.
joshbm is offline   Reply With Quote
Old 13th October 2004, 21:21   #9  |  Link
Sycho
This Is How It Goes
 
Sycho's Avatar
 
Join Date: Mar 2003
Location: Ontario Canada
Posts: 235
channel coupling or not?
Sycho is offline   Reply With Quote
Old 15th October 2004, 03:57   #10  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
Channel coupling? Elaborate for this newbie please .

Regards,
joshbm
joshbm is offline   Reply With Quote
Old 15th October 2004, 14:23   #11  |  Link
KpeX
Registered User
 
KpeX's Avatar
 
Join Date: Jun 2003
Location: Great Lakes, USA
Posts: 1,433
Quote:
Originally posted by Sycho
channel coupling or not?
Probably not, since ffdshow most likely uses the ffmpeg ac3 encoder, so you can expect the same results/features as besweet's ac3enc.
__________________
KpeX
Audio FAQs: General | BeSweet | SVCD/MP2 | MP3 | Vorbis | AC3 | DTS | AAC
Linux Audio/Video FAQ
KpeX is offline   Reply With Quote
Old 16th October 2004, 01:27   #12  |  Link
Sycho
This Is How It Goes
 
Sycho's Avatar
 
Join Date: Mar 2003
Location: Ontario Canada
Posts: 235
Quote:
Originally posted by KpeX
Probably not, since ffdshow most likely uses the ffmpeg ac3 encoder, so you can expect the same results/features as besweet's ac3enc.
i was under the impression that it could be implemented
Sycho is offline   Reply With Quote
Old 18th October 2004, 17:22   #13  |  Link
ahgc
Registered User
 
Join Date: Jan 2004
Location: Portugal
Posts: 21
I found this method to be quite simple so I gave it a go (well many many goes). I can get the 6ch wav correctly but when I try to go directly to the AC3 file (using the switch on ffdshow) I get a "mute" file. Correct length and size but no output. Thx in advance for your help.
Regds,

Antonio
ahgc is offline   Reply With Quote
Old 18th October 2004, 20:27   #14  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
You can not go to directly ac3 as of *yet*. That is why you must first create a 6ch wav, then run it through an AC3 encoder such as BeSweet (ac3enc from ffmpeg).

Quote:
Originally posted by Milan Cutka at 2004-10-13 21:46
I added a possibilty to connect ffdshow output directly to file writer and store data to a file. I tested it with ac3 and it produced a valid file.

However, it's still not it 20041012 version. [It will be available] in the next version, which should be ready within a month, or earlier if some serious bug will be found in current build..
[edited guide to reflect this]

Last edited by joshbm; 18th October 2004 at 20:40.
joshbm is offline   Reply With Quote
Old 20th October 2004, 12:41   #15  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
joshbm: you say the original method was perfect for encoding with BeSweet, is this one not good for it? Also, when ffdshow gets its realtime AC3 encoder, could this guide have the two methods (i.é: encoding with ffdshow and encoding with BeSweet)?
Chainmax is offline   Reply With Quote
Old 20th October 2004, 20:41   #16  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
Chainmax:

I am not saying the new method is not perfect for encoding BeSweet. What I was saying is that if you follow this method the channel order should be perfect for BeSweet encoding-- no Channel Swapping necessary. On the other hand, other encoders have different channel mapping and would indeed require modification (Channel Swapping in ffdshow). So to get to the point: the old method *and* this new method are identical, other than the newly added features, like added LFE etc. and they are both ready for BeSweet encoding.

For your second question: I am not sure if I would divide it up to use BeSweet AND ffdshow. I may, but that would be a little strange to do so, since BeSweet and ffdshow both use the same exact AC3 encoding method from ffmpeg's ac3enc.

Regards,
Josh
joshbm is offline   Reply With Quote
Old 20th October 2004, 23:22   #17  |  Link
ahgc
Registered User
 
Join Date: Jan 2004
Location: Portugal
Posts: 21
Okay I've got a problem here.. Every wav I run through this process the 6ch wav output gets cut at 62m08s (obviously for sources bigger than that). If I don't use ffdshow in between, that is, connect intervideo directly to wavdest I get the full wav 1XXm:XXs. Tried many settings on ffdshow and also uninstall/install.
Any ideas why this is happening. Thx in advance,

Antonio

PS: The "cut" file goes around 3,99GB and the "full" file is around 3.53GB (?)
ahgc is offline   Reply With Quote
Old 21st October 2004, 00:55   #18  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
Hmmm... I will look into it. I am unsure of this problem. If it appears to be ffdshow, I'll have to ask Milan and see if this is a problem and if he can fix it.

I have not done an example with a timecode larger than about 20 minutes.

Regards,
Josh
joshbm is offline   Reply With Quote
Old 21st October 2004, 01:48   #19  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
About the BeSweet and FFDShow question, what I actually meant was if the FFDShow encoding section could be written so that FFDShow could be replaced by other AC3 encoders (like Surcode).

Last edited by Chainmax; 21st October 2004 at 01:52.
Chainmax is offline   Reply With Quote
Old 21st October 2004, 02:08   #20  |  Link
ahgc
Registered User
 
Join Date: Jan 2004
Location: Portugal
Posts: 21
@joshbm

Thank you for your patience and quick reply. Tried with numerous movies' audio and same result. Meanwile I am using ac3filter instead of ffdshow (for channel swapping and SW) and wav files come out ok. Using them directly on besweet. Thanks
ahgc is offline   Reply With Quote
Reply

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 12:54.


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