View Full Version : directshow and audiochannels
hellgauss
21st June 2006, 20:36
I have a wmv file.
If i open it using windows media player and go to properties, it says that the audio stream is a
Windows Media Audio 9 Professional
384 kbps, 48 kHz, 5.1 channel 24 bit (A/V) 2-pass CBR
If i open it in virtualdubmod, via avisynth using:
directshowsource("...\myfile.wmv")
virtualdub says that it is a
2 channel 48000hz, 16bit pcm 1536kbps
I know that avisynth decompress audio and it becomens pcm uncompressed (like avisynth video), but is normal that it becomes 2 channel?
I use avisynth 2.56, oct 28 2005 18:44:09
Thanks and sorry for bad English
HG
actionman133
22nd June 2006, 00:21
I have the same issue, also. Just attaching myself to this thread so I can also hear the solution...
IanB
22nd June 2006, 01:11
Yes. I will just attach myself and wait for an answer to this one as well. :D
My guess is this is some crappy DRM issue and I need to poke some magic incantation (probably a key) into the graph to make the Windows Media Audio Codec offer a 6 channel output.
hellgauss
22nd June 2006, 05:48
Well.... i have never seen such two answer in a forum...... :D
I think i have asked something i should not ask :D
However thanks for the suggestion about drm.
I don't know if this file is drm-ed. I think not, because i can open it via avisynth.
I have also a file i named 'alexander_trailer_720.wmv', about 90MB. The one who give me says it is drm. However i can see it with mediaplayerclassic, but i cannot open it using avisynth.
The one who gives me alexander has a lot of no-drm video, i will take one and do some test when i'll back home from work.
Thanks
HG
IanB
22nd June 2006, 08:43
Note DRM is insideous! Worst case it prevents you from accessing media if you don't have the right key (i.e. MediaPlay/Alex...wmv). Softest case it only allows limited access without a key (i.e. 5.1 downmixed to 2.0 or a SD downsize of HD content).
Note I am only guessing about the 5.1 downmix being a DRM issue. I have done a medium amount of research on this issue and found nothing. If someone want to do more research on the problem I am quite happy to implement any resultant code required to make 5.1 available in DirectShowSource(). I'm just not prepared to do the research as well.
hanfrunz
22nd June 2006, 15:57
In directshow to filters are connected automatically by the system. So if you have a source with 5.1 sound you need a input-pin on the next filter that takes 5.1 input. I think (please correct me, if i'm wrong) that directshowinput has a normal stereo input pin. So the directshow graphbuilder builds a graph to connect a 5.1 pin to a 2.0 pin by using some downmix filter. So we would need a version of directshowsource with a 5.1 input pin.
@hellgauss: could you please open your wmv with graphedit and and send us a screengrab of the filtergraph?
hellgauss
22nd June 2006, 16:53
I take another (no drm) video from microsoft. It's the same thing. Windows MP say it is 5 channels, avisynth 2.
I uninstalled avsynth 2.56 and installed 2.57 but it is the same.
This Graphedit Output (I never used graphedit, i think you need this)
http://img476.imageshack.us/img476/3154/clipboard025sw.th.jpg (http://img476.imageshack.us/my.php?image=clipboard025sw.jpg)
[edit]
if i right click the last audio box in graphedit it says is a 2 channel 48khz 16bit
Isochroma
24th June 2006, 19:19
I had fun with Mr. Zambelli over this one already:
WMA 5.1ch. in WMV only decodes to stereo? (http://forum.doom9.org/showthread.php?p=820259#post820259)
hellgauss
24th June 2006, 21:37
Thanks.... a very interesting thread.
I tryed to do some other tests with 5+1 audio. I made a dvd-rip to xvid+ac3 5+1 (avi). I installed the ac3filters. I wasn't able to open the file in virtualdubmod using avisynth, but i can open the avi file directly in VDM. It was 6 channels.
I also installed another ac3 filter (AC3-ACM), and with this acm i can open the avi file with directshowsource, and it is a 6 channels uncompressed (like it should be).
I really think that wmv audiostream that becomes 2 channels isn't an avisynth or directshowsource problem, but a M$ problem about 'unhauthorized' listening!
PS
I open this avifile with graphedit. The audio was rendered by ac3filters. It says that the ac3filters out was two channel. But i can right click on the ac3 filter and with properties i configured it, and now graphedit says me that ac3filters out is 6channels.
If i do the same with the WMV file, and i try to configure the WMA decoder, it says that the operation is not allowed!!!
Isochroma
24th June 2006, 21:44
WMP has its own builtin audio and video decoders for windows media formats (wmv1/2/3, wma2/3). The builtin wma decoder is multichannel enabled, but the system directshow decoder outputs stereo only.
Of course, this is used to herd the cattle into using M$'s WMP. The tactics of a monopolist, to be sure; and another good reason to choose open formats for encoding and containerization, such as MPEG-4 ASP/AVC, Vorbis/AAC/AC3, and MKC/OGM respectively.
zambelli
25th June 2006, 00:24
WMP has its own builtin audio and video decoders for windows media formats (wmv1/2/3, wma2/3). The builtin wma decoder is multichannel enabled, but the system directshow decoder outputs stereo only.
Of course, this is used to herd the cattle into using M$'s WMP. The tactics of a monopolist, to be sure; and another good reason to choose open formats for encoding and containerization, such as MPEG-4 ASP/AVC, Vorbis/AAC/AC3, and MKC/OGM respectively.
Isochroma, we've been over this. I've explained to you already that your wild assumptions are not correct and this has been confirmed by other users. Please stop spreading FUD.
As you've kindly linked the other thread, I will also point that you already closed the other thread with these words:
I guess I should wrap up this thread by thanking you for your time providing the info. Clearly I'm just too paranoid for my own good I am stubborn. Maybe someday I'll be a lawyer?
This smells a lot like trolling.
Wilbert
25th June 2006, 00:28
Zambelli reported this in the linked thread:
As for your 5.1 decoding problem... Have you made sure your speakers are set to 5.1 in the Control Panel? The codec checks that in order to know whether to output 5.1 or mix down to 2.0.
Does that solve the problem?
Isochroma
25th June 2006, 01:17
Indeed, my sound system is correctly configured. All other >2 channel files play just fine. At this time, the problem is unresolved. Since neither I nor anyone else has reported problems getting multichannel from non-wmv containers/codecs, then I will use them for future encodes.
It is my recommendation that others do so as well. For whatever reason, getting multichannel from wmv with directshowsource() and/or non-WMP software has been impossible for myself and several others. Our experience is warning enough.
For those who have the issue, it may be possible using GraphEdit to demux the wma stream from the wmv and save to a file. Adobe Audition & Cool Edit have an input filter for wma; whether it will read multichannel or not is anyone's guess.
WinAmp also has a plugin for wma, but it doesn't work for multichannel or pro files. The workaround is to add WMA to the list of file extensions in the Nullsoft DirectShow Decoder input plugin, and disable or remove any other plugins that take wma input.
Also, software may be available to record the audio from the system mixer, so playback in WMP would allow successful recovery of such streams to raw, which could then be recompressed as desired.
The ffdshow audio decoder can be set to accept all raw formats for input, and has an option to "Allow direct-to-file-output", although it only works in GraphEdit and involves lossy AC3 recompression.
Some sound cards have digital SPDIF output, which can be loopbacked or sent to another machine. Finally, analog outputs can be loopbacked or send to another machine for recording, with D-A-D losses.
IanB
25th June 2006, 03:40
And this is where I got to last time I researched this issue at which point I lost interest and moved on.Isochroma, we've been over this. I've explained to you already that your wild assumptions are not correct and this has been confirmed by other users. Please stop spreading FUD.On a fine technicallity, it may well be FUD. But practically and functionally it is NOT!
Thru directshow WMAudio Decoder DMO will not offer MEDIATYPE_Audio/MEDIASUBTYPE_PCM/WAVE_FORMAT_* output in anything other than 1 or 2 channels. It does however offer other MEDIASUBTYPE's.....
zambelli
25th June 2006, 03:52
Every XP machine I ever tried WMA Pro 6ch playback on with Media Player Classic (entirely a DirectShow player) played all 6 discrete channels back, as verified by looking at the DirectSound renderer properties.
So the options are:
a) I'm lying because I know I'm the only person in the world with 5.1 WMA Pro content and a Windows XP operating system.
b) The WMA decoder has been designed to decode all 6 channels only when it detects the presence of a Microsoft employee within a 10m radius. Otherwise it downmixes to 2 channels, or to only 1 channel if you've been known to use Linux.
c) MPC is secretly developed by Microsoft and thus has access to Microsoft's super secret APIs.
d) Something is not correctly configured in your setup.
;)
mrcorbo
25th June 2006, 05:32
Every XP machine I ever tried WMA Pro 6ch playback on with Media Player Classic (entirely a DirectShow player) played all 6 discrete channels back, as verified by looking at the DirectSound renderer properties.
Working here as well. And in Zoomplayer.
Also confirmed, though, that playing the same file back in GraphEdit folds the audio down to 2Channels, as does playing it back in Mplayer. Why is this? What exactly is it that determines the number of channels that the WMAudio DMO outputs?
hellgauss
25th June 2006, 09:30
I'm doing these tests on my laptop, with a stereo yamaha soundcard. I don't want to listen to the audio. I want to rip it on a 6 channels wav file. But i thought that it should be possible (and maybe easy....?) to grab 6 channels wav from wma. It is not.
However i confirm that mediaplayerclassic recognize 6 channels wm audio.
With directshowsource i can only output 2 (or i don't know how to output 6)
@zambelli
Please do this test:
open a new avs file, write in it
directshowsource("....\6channelfile.wmv")
and drag and drop it in VDM.
Go to file information..... is it 6 channels?
Wilbert
25th June 2006, 13:26
@zambelli,
Forgive me my ignorance. Let me first say i'm running W2K and I never know what is supposed to work on W2K or XP.
Q1) Is it possible to download the WMA9Pro (or WMA10Pro) codec separately, or do i need to install WMP9/WMP10?
Q2) As I understand it WMA9Pro doesn't work with WMP6.4 (which is still my default player). With "work" I mean it doesn't downmix anything. If Isochroma's statement is FUD, why doesn't WMA9Pro work with WMP6.4?
Q3) http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmencode/htm/featurerequirements.asp claims I need XP for WMA9Pro. Does that mean that W2K isn't supported?
mrcorbo
26th June 2006, 00:42
I posted a link to the relevant MSDN docs in the other thread. (http://forum.doom9.org/showthread.php?p=845139#post845139)
zambelli
26th June 2006, 08:01
Q1) Is it possible to download the WMA9Pro (or WMA10Pro) codec separately, or do i need to install WMP9/WMP10?
You will need WM Format SDK runtime, since it includes both the codecs and the DMO wrappers necessary to use DMO filters in DirectShow. The latest WMF SDK available for W2K is v9. You can either get it with the full SDK download (https://wmlicense.smdisp.net/ei0u439/91ac29746/download.asp) (includes docs and samples and such) or with WMP9 (http://www.microsoft.com/windows/windowsmedia/player/9series/default.aspx).
Q2) As I understand it WMA9Pro doesn't work with WMP6.4 (which is still my default player). With "work" I mean it doesn't downmix anything. If Isochroma's statement is FUD, why doesn't WMA9Pro work with WMP6.4?
Well, I think what's happening here is that a particular flag needs to be set on the DirectShow graph when trying to get multichannel audio from the WMA decoder DMO. As WMP6.4 predates WMA Pro, it doesn't know anything about it so it just builds the default graph - with 2 channels.
Q3) http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmencode/htm/featurerequirements.asp claims I need XP for WMA9Pro. Does that mean that W2K isn't supported?
Not quite. WMA Pro encoding/decoding should work just fine on W2K. However, XP is a requirement for multichannel decoding, according to the docs. I'm not sure if it's a technical limitation or a business decision.
hellgauss
27th June 2006, 07:04
I read the other thread....
If i understand well to resolve this issue avisynth programmer should set a flag directly in the c++ code of avisynht directshow filter .... right?
zambelli
27th June 2006, 07:39
I read the other thread....
If i understand well to resolve this issue avisynth programmer should set a flag directly in the c++ code of avisynht directshow filter .... right?
That is my understanding too. Perhaps that'd be a good feature request for Avisynth 2.6?
IanB
11th August 2006, 14:57
Okay Guys rejoice, I have just commited to CVS the changes needed to poke the magic property "_HIRESOUTPUT" into the "WMAudio Decode DMO" codec. Get a your pre-compiled copy here (http://avisynth2.sourceforge.net/directshowsource.zip). Note this has only had minimal testing. Please report bugs and problems in the Development Forum.
zambelli
12th August 2006, 00:30
Okay Guys rejoice, I have just commited to CVS the changes needed to poke the magic property "_HIRESOUTPUT" into the "WMAudio Decode DMO" codec. Get a your pre-compiled copy here (http://avisynth2.sourceforge.net/directshowsource.zip). Note this has only had minimal testing. Please report bugs and problems in the Development Forum.
Let me be the first one to say: well done! :)
I tried it with a WMV video containing 6ch WMA Pro and it correctly returned 6 channels, as verified in VirtualDub.
I haven't done extensive testing to make sure there are no regressions in other functionality, but I can confirm that the intended change is functional.
Wilbert
12th November 2006, 13:42
It doesn't work for me. I've WMF SDK v9 (yes i've W2K) installed (and v2.57 rc1), but
v = BlankClip()
a = DirectShowSource("F:\TestStreams\Audio\6chan.wma", logfile="F:\TestStreams\Audio\6chan.txt")
AudioDub(v,a)
Info
returns stereo. MPC info of the wma file shows: "Audio: Windows Media Audio 44100Hz 6ch 192Kbps [Raw Audio 0]". logfile is attached.
zambelli
12th November 2006, 14:01
It doesn't work for me. I've WMF SDK v9 (yes i've W2K) installed (and v2.57 rc1), but
returns stereo. MPC info of the wma file shows: "Audio: Windows Media Audio 44100Hz 6ch 192Kbps [Raw Audio 0]". logfile is attached.
Multichannel WMA will only work on WinXP or better. Sorry.
Wilbert
12th November 2006, 14:21
Multichannel WMA will only work on WinXP or better. Sorry.
I recall that we talked about this once, but i can't find the discussion anymore. I guess it (ie MPC returns the full 6 channels on my system, but this AviSynth "tweak" doesn't) has something to do with this:
1) The only requirement for 5.1 WMA Pro playback is Windows XP. The feature is not reserved for WMP only. The only difference is that WMP uses WM Format SDK for all WMV/WMA playback, whereas MPC and most other apps use DirectShow. However, even DirectShow can decode the full 8 channels of WMA Pro when using the WMA decoder DMO. I just verified that myself using MPC, so clearly I'm not making this up.
but i don't understand this completely. I thought that WMP6.4 also uses DirectShow to play stuff? Or has it something to do with those DMO filters?
I have just commited to CVS the changes needed to poke the magic property "_HIRESOUTPUT" into the "WMAudio Decode DMO" codec (...)
Or does that tweak require WMF SDK v9.5 or higher?
zambelli
12th November 2006, 23:41
but i don't understand this completely. I thought that WMP6.4 also uses DirectShow to play stuff? Or has it something to do with those DMO filters?
When WMP9 was released - the last player to be released for Win98SE, Win2K and WinXP simultaneously - multichannel audio was considered an XP-only feature because, IIRC, getting multichannel audio to work in Win98 requried some major jumping through hoops. So I think there's literally code in the WMA decoder that checks if it's running at least XP before it offers up multichannel audio as an output pin.
Or does that tweak require WMF SDK v9.5 or higher?
IIRC, it's not a Format SDK requirement, but an OS requirement.
IanB's code change is definitely the right thing to do, but alas, it will only work in XP due to WMA decoder's own restrictions. Sorry about that, Win2K folks.
IanB
12th November 2006, 23:46
@Wilbert,
You need a "WMAudio Decode DMO" that will swallow and act apon "_HIRESOUTPUT" i.e. the one that gets installed on XP and 2K3 :devil:
What is really gaulling is the lesser "WMAudio Decode DMO" gloats that the file is 6 channel yet won't/can't do anything about it.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.