本帖最后由 pendave 于 2015-1-28 17:18 编辑
研究了下,这个代码可以用了- @echo off
-
- set outputext=128kbs
- for %%i in (*.mp3) do "C:\Program Files (x86)\FormatFactory\FFModules\Encoder\ffmpeg.exe" -i "%%i" -acodec libmp3lame -ab 128k "%%~ni.%outputext%.mp3"
-
- PAUSE
复制代码 但是这个会把所有mp3都转换一遍,有的128kbs的也被重复转成128kbs的, 怎么判断一下呢,只想要bitrate 大于等于192kbs 的mp3文件才转换!
求高手!谢谢
这里看到 .bat .vbs 配合获取mp3信息的代码
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/Q_27077456.html
Batch File Read File Attributes advanced.bat- @echo off
- setlocal
- set FileName=C:\test.mp3
- for /F "tokens=1* delims==" %%A in ('cscript getinfo.vbs "%FileName%"') do set _prop_%%A=%%B
- set _prop
复制代码 getinfo.vbs- if (WScript.Arguments.Count > 0) Then
- strFile = WScript.Arguments(0)
- Else
- WScript.Echo "ERROR : No input filename specified."
- WScript.Quit -1
- End If
-
- Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
-
- If Not objFSO.FileExists(strFile) then
- WScript.Echo "ERROR : Input filename specified does not exist."
- WScript.Quit -1
- End If
-
- Set objFile = objFSO.GetFile(strFile)
- strFolder = objFile.ParentFolder
-
- Dim strAttrName(300)
-
- Set objShell = CreateObject("Shell.Application")
- Set objFolder = objShell.NameSpace(strFolder)
-
- for N = 0 To 300
- strAttrName(N) = Replace(objFolder.GetDetailsOf(Nothing, N), " ", "_")
- Next
-
- Set objFileItem = objFolder.ParseName(objFile.Name)
-
- For i = 0 To 300
- if objFolder.GetDetailsOf(objFileItem, i) <> "" Then
- If Instr("objFolder.GetDetailsOf(objFileItem, i)", Chr(63)) then Wscript.Echo "FOUND"
- WScript.Echo strAttrName(i) & "=" & Replace(objFolder.GetDetailsOf(objFileItem, i), Chr(63), "")
- End If
- Next
-
- Wscript.Quit 0
复制代码
|