Skip to main content

Topic: Command-line WMA encoder (Read 50969 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • xorsyst
  • [*]
Command-line WMA encoder
Reply #25
This is great, thanks.  Any chance of adding a --scale option to scale the input source, as lame and oggenc2 support?

  • bernhold
  • [*]
Command-line WMA encoder
Reply #26
I have made a small wrapper command line tool for the new Microsoft Expression Encoder WMA Encoder, which supports WMA 9 and WMA Professional 10.

You can use it like:

wmaenc -i input.wav -o output.wma

It requires the Microsoft Expression Encoder to be installed, otherwise it won't work. Do a google search on where to download it. Also, please note this is not a polished piece of software, merely a quick and dirty tool, so there may be errors and quirks. But it does the job for me.

I also attached the source code (c# visual studio) in case you want to see how it's basically done, you may want to write your own version.
  • Last Edit: 23 March, 2013, 04:41:29 PM by bernhold

  • emte
  • [*][*]
Command-line WMA encoder
Reply #27
Hi,

Could you give me exact line I should give foobar to convert a file to wma pro q50?

  • lvqcl
  • [*][*][*][*][*]
  • Developer
Command-line WMA encoder
Reply #28
Code: [Select]
--codec pro --quality 50 - %d

  • eahm
  • [*][*][*][*][*]
Command-line WMA encoder
Reply #29
EZ CD Audio Converter supports WMA 11. It that version worse than 9 and 10?

http://www.poikosoft.com/help/encoder_versions.html

  • bernhold
  • [*]
Command-line WMA encoder
Reply #30
EZ CD Audio Converter supports WMA 11. It that version worse than 9 and 10?

http://www.poikosoft.com/help/encoder_versions.html


It says Windows Media Format 11, not WMA 11. WMF is not an audio codec.

http://msdn.microsoft.com/en-us/library/wi...8(v=vs.85).aspx

At least that's how I understood it, I'm not that familiar with Windows Media Format.

WMA 9 and WMA 10 Professional are the newest codecs currently available.
  • Last Edit: 10 April, 2013, 05:40:01 PM by bernhold

  • eahm
  • [*][*][*][*][*]
Command-line WMA encoder
Reply #31
bernhold, thanks for that.

lvqcl, wha do I need to install to use "-c voice"? I keep getting "Requested encoder not found".

  • eahm
  • [*][*][*][*][*]
Command-line WMA encoder
Reply #32
My bad I was using the wrong command, everything works perfectly. Thanks.

  • temp1
  • [*]
Command-line WMA encoder
Reply #33
thank u,lvqcl
love it.
fb2k+windows 8 pro
works perfect

  • lixtary
  • [*]
Command-line WMA encoder
Reply #34
Hi!lvqcl ,thank you very much ,your encode is just what i want to find.this time i can convert music to .wma more conveniently.I'm very glad to see your achievement!!!

  • Kreisch
  • [*]
Command-line WMA encoder
Reply #35
Thank you for making this handy tool available. I can't seem to get stereo to mono downmix working, though. Here's what I've tried:

Code: [Select]
input file as per ffmpeg:
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s

wmaencode --out-channels 1 "links, rechts.wav"

output file as per ffmpeg:
Stream #0:0(ger): Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, stereo, fltp, 128 kb/s

And it is stereo indeed, verified using my ears. What am I missing?

  • lvqcl
  • [*][*][*][*][*]
  • Developer
Command-line WMA encoder
Reply #36
a) WMAencode doesn't downmix itself. It asks Windows Media Runtime to do this (the same is true for --out-samplerate and --out-bitdepth options)
b) 128 kbps mono wma files aren't supported by WM Runtime, so it ignores downmix request.

Try to create 48 kbps WMA file and you'll see that --out-channels 1 works in this case.

  • Kreisch
  • [*]
Command-line WMA encoder
Reply #37
Thank you for your prompt reply. It works as you're saying.

So, knowing that the Windows Media Runtime does not blindly support any random combination of encoding parameters but only specific ones, the user can find clues about what the combinations are and what parameters to supply by reading wmaencode --print-formats.

Command-line WMA encoder
Reply #38
lvqcl, I just wanted to say thank you for putting this app together. Years ago, while I was working at Microsoft, I had made modifications to the original WMCmd.vbs (http://citizeninsomniac.com/WMV/#WMCmd) that allowed a lot of advanced functionality for VC-1 and WMA encoding, but I'm glad somebody just skipped the entire WME9 SDK altogether and did a native implementation based on the WM Format SDK (or Media Foundation, whichever one you used). That's definitely the best way to go.



Command-line WMA encoder
Reply #39
I have a feature suggestion too:

It'd be really nice if the tool was able to:

1) print to screen the DLL version of the WMA encoder DMO (wmadmoe.dll) installed on the system

2) embed the WMA encoder DLL version into the "WM/ToolVersion" or "WM/EncodingSettings" ASF attribute, so it's documented which WMA codec version was used


 


  • lvqcl
  • [*][*][*][*][*]
  • Developer
Command-line WMA encoder
Reply #40
2) embed the WMA encoder DLL version into the "WM/ToolVersion" or "WM/EncodingSettings" ASF attribute, so it's documented which WMA codec version was used

When I open .wma file in Winamp, I can see in its properties:
Code: [Select]
WMFSDKVersion      12.0.7601.17514

so it's sort of documented already.

Command-line WMA encoder
Reply #41
When I open .wma file in Winamp, I can see in its properties: WMFSDKVersion     12.0.7601.17514 so it's sort of documented already.


Oh, good call. I was only checking with MediaInfo, which probably only registers a subset of ASF attributes. When I checked with ASF Viewer, I was able to see the attribute you mentioned. Thanks!
  • Last Edit: 16 January, 2015, 07:00:39 PM by CitizenInsomniac

Command-line WMA encoder
Reply #42
lvqcl, I have another question:

Do you know which encoder complexity value (MFPKEY_ENCCOMPLEXITY) you're using for WMA Lossless?

Looks like the default value changed from 100 (worst performance, best efficiency) to 0 (best performance, worst efficiency) between Vista and Win7, which is probably something most people are unaware of. https://msdn.microsoft.com/en-us/library/wi...9(v=vs.85).aspx



  • lvqcl
  • [*][*][*][*][*]
  • Developer
Command-line WMA encoder
Reply #43
This program uses Windows Media Format SDK, not Media Foundation. So I have no idea and I'm not sure that this property is applicable to WMF SDK.

Command-line WMA encoder
Reply #44
This program uses Windows Media Format SDK, not Media Foundation. So I have no idea and I'm not sure that this property is applicable to WMF SDK.


It's been a while since I've used them, but I believe every MFT property is also exposed as a DMO property and configurable via the IPropertyBag interface.  I'm not sure if the property names are the same or if you have to query the interface first for a complete list, but you should be able to get to them one way or another. https://msdn.microsoft.com/en-us/library/wi...8(v=vs.85).aspx might shed more light on the matter.


  • lvqcl
  • [*][*][*][*][*]
  • Developer
Command-line WMA encoder
Reply #45
According to https://technet.microsoft.com/en-US/ff819329
Quote
Available only by using IPropertyStore.

So, no luck.

Command-line WMA encoder
Reply #46
Available only by using IPropertyStore.

So, no luck.
 

  Is there a way to query IPropertyBag for a list of available properties?

I don't remember specifically for WMA encode, but I do remember for WMV9 (VC-1) encoder that there was a 1:1 mapping between DMO and MFT properties.

Consider that most of these codecs were developed before Media Foundation was introduced in Vista, so it would make sense that their properties were primarily exposed via the DMO interface and then later supplemented via the MFT interface. I'd be very surprised if the DMO property bag was completely disabled.


  • lvqcl
  • [*][*][*][*][*]
  • Developer
Command-line WMA encoder
Reply #47
Is there a way to query IPropertyBag for a list of available properties?

I have no idea. I'm not very familiar with COM, interfaces, and so on.