Skip to main content

Topic: need a wma cli encoder (Read 9853 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • tripex
  • [*]
need a wma cli encoder
I used to convert my music files (wav, mpc, mp3) to other formats with a set of batch files, awk files and cli programs (Win32). Only for wma I haven't found a cli encoder yet. Therefore I have to do it with a Winamp-Plugin, but this method sucks because of missing flexibility and automation. I read something about wma8eutil.exe but could not find it to download. And I'm not sure if it is the last compatible WMA non Pro encoder anyway. But with my understanding it can be only a shell around the installed WMA codec. So I also wonder, how I can manually upgrade my system only to the last WMA non Pro codec without Installing Windows Media Player or something else.

CU
Andy

  • TrNSZ
  • [*][*][*][*][*]
  • Developer
need a wma cli encoder
Reply #1
[deleted]
  • Last Edit: 27 August, 2015, 02:40:20 PM by TrNSZ

  • Synthetic Soul
  • [*][*][*][*][*]
  • Global Moderator
need a wma cli encoder
Reply #2
Here's a couple of threads on the subject of encoding with Windows Media Encoder on the command line:

http://www.hydrogenaudio.org/forums/index....showtopic=50415

http://www.hydrogenaudio.org/forums/index....showtopic=47759
I'm on a horse.

  • tripex
  • [*]
need a wma cli encoder
Reply #3
Hmm, now I had time to check it out.

After extracting the files and typing cscript wmcmd.vbs /? I got this message:

WScript.CreateObject: Could not locate automation class named "WMEncEng.WMEncoder".

Obviously you need to install the full WMEncoder package properly before it works at all. But I need/want a portable version. I don't mind to copy some (dll) files from the package somewhere but I don't want touched the registry. I also don't mind to have the last/best wma encoder anymore. The already present one is sufficient.

Any other options I have left?

CU
Andy

  • Mangix
  • [*][*][*][*][*]
need a wma cli encoder
Reply #4

  • Woodinville
  • [*][*][*][*][*]
need a wma cli encoder
Reply #5
ffmpeg


Better to get the latest XP encoder, which also does more than WMA 8 format.
-----
J. D. (jj) Johnston

  • Mangix
  • [*][*][*][*][*]
need a wma cli encoder
Reply #6
nevertheless, ffmpeg is an option

  • tripex
  • [*]
need a wma cli encoder
Reply #7
Why did nobody point me to Windows Media 8 Encoding Utility from Microsoft?
That's all I need. I just didn't know that this is the same than wm8eutil.exe.

CU
Andy

  • Synthetic Soul
  • [*][*][*][*][*]
  • Global Moderator
need a wma cli encoder
Reply #8
I didn't realise that you could use it on the command line.

Perhaps you could share your method?
I'm on a horse.

need a wma cli encoder
Reply #9
Why did nobody point me to Windows Media 8 Encoding Utility from Microsoft?
That's all I need. I just didn't know that this is the same than wm8eutil.exe.

CU
Andy

Windows Media 8 Encoding Utility
http://www.microsoft.com/downloads/details...;DisplayLang=en

  • xmixahlx
  • [*][*][*][*][*]
need a wma cli encoder
Reply #10
LOL

you are assuming a lot of people here use a CLI WMA encoder which is just silly thing to assume...


later

  • kwanbis
  • [*][*][*][*][*]
  • Developer (Donating)
need a wma cli encoder
Reply #11
Why did nobody point me to Windows Media 8 Encoding Utility from Microsoft?
Maybe
1) nobody knew
2) nobody cares
3) both

need a wma cli encoder
Reply #12

Why did nobody point me to Windows Media 8 Encoding Utility from Microsoft?
That's all I need. I just didn't know that this is the same than wm8eutil.exe.

CU
Andy

Windows Media 8 Encoding Utility
http://www.microsoft.com/downloads/details...;DisplayLang=en

Bah.. they have their 'validation' BS going there.

I got the wm8 CLI encoder from the dbpoweramp wma8 plugin, I forget which one of them comes with it (probably the CLI one). http://www.dbpoweramp.com/legacy/codec-central-wma.htm  It might take you a bit more effort if you don't have dbpoweramp installed, but it is one non-invasive way to get the encoder.
Vorbis-q0-lowpass99
lame3.93.1-q5-V9-k-nspsytune

  • Synthetic Soul
  • [*][*][*][*][*]
  • Global Moderator
need a wma cli encoder
Reply #13
 I don't quite see why asking you to prove that your Windows is licensed is "invasive".

I admit that it can be a pain in the butt.  I'm not sure I've ever got it to work without having to run the CheckGenuine.exe (or whatever it's called) app.
  • Last Edit: 02 March, 2007, 03:15:10 PM by Synthetic Soul
I'm on a horse.

  • spoon
  • [*][*][*][*][*]
  • Administrator
need a wma cli encoder
Reply #14
I have had laptops, which come with XP Pro - brand new and they fail the WGA, there is no advantage to it, just an irritation (they are not illegal copies as I do not see Panasonic or Sony supplying illegal copies...).

  • tripex
  • [*]
need a wma cli encoder
Reply #15
Well, the most sites or links are outdated, but this one works (no genuine validation).

<http://fileforum.betanews.com/download/Windows_Media_8_Encoding_Utility/976950031/1>

@Synthetic Soul: Basically this tool is only cli based.

If you are interested in my general method, I can post my scripts later.

@xmixahlx: Your assumtion is wrong, like the most...

CU
Andy

  • tripex
  • [*]
need a wma cli encoder
Reply #16
My method is to convert any audio files in a dir via context menu from the dir. Therefore I need a registry entry like this:

REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\audio\command]
@="cmd /c cd \"%1\" && audio \"%1\""

Then you need the audio.bat in the PATH so it is accessible from everywhere:

@echo off

:2wma
jnfrage -w 10 convert to wma?
if errorlevel 1 goto 2mp3mono
dir /b /o *.mp3 *.mpc *.wav > filelist.tmp
awk -f C:\archive\dos\2wma.awk filelist.tmp > filelist.bat
del  filelist.tmp
call filelist.bat
del  filelist.bat
goto end

:2mp3mono
jnfrage -w 10 convert to mp3 (mono)?
if errorlevel 1 goto 2mp3low
dir /b /o *.ac3 *.mp3 *.mpc *.wav > filelist.tmp
awk -f C:\archive\dos\2mp3mono.awk filelist.tmp > filelist.bat
del  filelist.tmp
call filelist.bat
del  filelist.bat
goto end

:2mp3low
jnfrage -w 10 convert to mp3 (low quality)?
if errorlevel 1 goto 2mp3high
dir /b /o *.ac3 *.mp3 *.mpc *.wav > filelist.tmp
awk -f C:\archive\dos\2mp3low.awk filelist.tmp > filelist.bat
del  filelist.tmp
call filelist.bat
del  filelist.bat
goto end

:2mp3high
jnfrage -w 10 convert to mp3 (high quality)?
if errorlevel 1 goto 2mpc
dir /b /o *.ac3 *.mp3 *.mpc *.wav > filelist.tmp
awk -f C:\archive\dos\2mp3high.awk filelist.tmp > filelist.bat
del  filelist.tmp
call filelist.bat
del  filelist.bat
if exist crc.txt del crc.txt
goto end

:2mpc
jnfrage -w 10 convert to mpc?
if errorlevel 1 goto 2wav
dir /b /o *.wav > filelist.tmp
awk -f C:\archive\dos\2mpc.awk filelist.tmp > filelist.bat
del  filelist.tmp
call filelist.bat
del  filelist.bat
if exist crc.txt del crc.txt
goto end

:2wav
jnfrage -w 10 convert to wav?
if errorlevel 1 goto end
dir /b /o *.mp3 *.mpc > filelist.tmp
awk -f C:\archive\dos\2wav.awk filelist.tmp > filelist.bat
del  filelist.tmp
call filelist.bat
del  filelist.bat
if exist crc.txt del crc.txt
goto end

:end

In addition you would need all the tools I use within the audio.bat and other bat scripts in the PATH as well, like jnfrage, lame, wm8eutil.exe...
But the most important tool is awk (Berkeley utilities), which allows me to "convert" the filelist created by dir to a new batch script.

Finally I have for each conversation type (2wma, 2mp3mono, 2mp3low, ...) one awk and one bat script, which are quite similar to each other. Here is the example of 2mp3high.

2mp3high.awk:

BEGIN {OFS=""} {print "call 2mp3high \"", substr($0,0,length($0)-4), "\""}

2mp3high.bat:

@echo off

if exist %1.ac3 goto decode_ac3
if exist %1.mp3 goto decode_mp3
if exist %1.mpc goto decode_mpc
if exist %1.wav goto encode_mp3_high
goto end

:decode_ac3
azid --maximize -cnormal -L-3db %1.ac3 %1.wav
if errorlevel 0 del %1.ac3
goto encode_mp3_high

:decode_mp3
lame --decode %1.mp3 %1.wav
if errorlevel 0 del %1.mp3
goto encode_mp3_high

:decode_mpc
mppdec %1.mpc %1.wav
if errorlevel 0 del %1.mpc
goto encode_mp3_high

:encode_mp3_high
lame --r3mix %1.wav tmp.mp3
if errorlevel 0 del %1.wav
ren tmp.mp3 %1.mp3
goto end

:end

That's all. Maybe there is a generally much simpler method, but it works for me and is highly editable and portable as well. It works with WinXP and Win2k and I don't need to install anything but the registry entry for the context menu.

CU
Andy

  • Synthetic Soul
  • [*][*][*][*][*]
  • Global Moderator
need a wma cli encoder
Reply #17
Thanks for sharing.

In retrospect I suppose the VBS script is normally recommended to make use of the later codec.  WM8EUTIL.exe is really outdated - it's coming up for its six birthday, and that's a long time in audio development.  The VBS script also works with both Win2K and XP (and I don't have a problem using it).

xmixahlx is certainly correct for this board, and I suspect the general populous. Windows Media is not popular here, and most WMA users will use WMP or other GUIs to encode, not a CLI application.

At least we now have another thread to point users to, if this question is asked again.  Thanks.
  • Last Edit: 03 March, 2007, 01:59:37 AM by Synthetic Soul
I'm on a horse.

  • tripex
  • [*]
need a wma cli encoder
Reply #18
Because I use wma only to accommodate more music on my mp3/wma stick (for conservation I use mpc) I don't care too much about the quality advantages of the newest wma codec around 48kbps (32kHz). I assume they are minimal and probably not worth too mess up my system(s) more than necessary. And it makes no difference in quality compared to my former method via Winamp plugin. Both are only shells, regardless how old they are.

CU
Andy

  • The_Doctor
  • [*]
need a wma cli encoder
Reply #19
.
.
.
:decode_mp3
lame --decode %1.mp3 %1.wav
if errorlevel 0 del %1.mp3
goto encode_mp3_high
.
.
.


That errorlevel bit won't work in W98 (yes, I use it, never mind..), and possibly only appears to work right even in WNT or WXP. The way ERRORLEVEL works, (or worked) is such that if error level 4 was set, any test for a lower value will return true! That includes testing for level 0, which LAME returns on success. Which in turn means you can lose a file that way even if there was an error with that code above; in W98 and maybe the later OS's, you'll still lose that file even though you likely want it safe to try something else with.

The way round that is to use IF NOT ERRORLEVEL 1 DEL %1.MP3 because an error code of => 1 returns true, so negating that returned state makes sure than ONLY a value less than 1, i.e. 0, returns true, so that LAME's success can allow deleting of the old file. DOS is weird but there is method in the madness.

I still use batch scripts, they let me see and sort stuff more easily. But I use Lua to build them now, if they're for large tasks. Lua could bypass them outright but I still prefer the console reporting and the chance to review the prepared script.
  • Last Edit: 06 June, 2010, 12:45:50 PM by The_Doctor