Whilst Cruncher is designed to do the whole "compression" thing, it is only a script file which joins together a series of other tools.
If you have a look at the
RPGMCruncher-x64-0.4.1.bat
file, it's only a (somewhat complex) DOS batch file.
Taking it apart, if you pick
2. Audio Files
, it jumps to a label called
:audio
.
From there, it processes certain types of file using a program called
ffmpeg.exe
using very specific parameters.
In order:
"mp3"
... ffmpeg.exe -i "%%a" -map_metadata -1 -codec:a libmp3lame -qscale:a 7 -vn "%%~dpa%%~na".temp."
"wav"
... ffmpeg.exe -i "%%a" -map_metadata -1 -codec:a libmp3lame -qscale:a 7 -vn "%%~dpa%%~na".temp."
"ogg"
... ffmpeg.exe -i "%%a" -codec:a libvorbis -qscale:a 3 "%%~dpa%%~na".temp."
Then it does some clever stuff, I can't really follow that goes looking for any matching filenames and runs
ffmpeg
with the command line options of it's choice. I'm sure some of it is creating some temporary file which is now a
.ogg
file - and then deletes the original
.mp3
,
.wav
or
.ogg
file before renaming the temporary file to be the old name.
So....
A couple of things...
Firstly, if you can follow the DOS batch file language with a little more patience than I have right now - you can probably get it to rename the newly created temporary file to be
.ogg
rather than it's original name.
Secondly... all those ffmpeg parameters could be changed.
A quick google search, and I found :
You must be registered to see the links
... which shows alternative command lines like :
ffmpeg -i input.wav -codec:a libmp3lame -qscale:a 2 output.mp3
... and then a table which explains that
-qscale:a 7
is the equivalent of perhaps 80-120 kbit/s. But by changing that 7 to a 4 or 3... the bitrate (and I presume quality) goes up to nearer 140-195 kbit/s.
My point is that because the batch file is just a plain text script file... you can alter it. Find those ffmpeg lines and swap those 7's to 4's
(and the libmp3lame to libvorbis)... and you'll end up with better output quality audio files.
Or you could forget the script file and enter
ffmpeg
commands yourself, with different parameters.
It doesn't look like there's an easy way to NOT rename files. You could alter the line:
ren "%%~dpa%%~na".temp.%filetype% "%%~na.%filetype%"
... to be...
ren "%%~dpa%%~na".temp.%filetype% "%%~na.ogg"
instead.
But since the
:process
is a common label used all over the place, it would break things for the processing of video or images. I'm sure there's a way around it... but I'm officially making that "not my problem".
Edit: Now I look back at the website I linked... it seems that
-codec:a libmp3lame
is actually recoding all the mp3 and wav files into
.mp3
and the
.ogg
files to 112 kb/s
.ogg
files. For
.ogg
you'd need an
ffmpeg
command with the parameters to use either the
vorbis
or
libvorbis
codec libraries.
I just tested this :
ffmpeg -i testfile.mp3 -c:a libvorbis -q:a 3 -vn d:\testfile.ogg
and it converted a 256kb/s MP3 to a 112kb/s OGG file.
(-q:a 3 was 112kb/s, -q:a 4 was 128kb/s, -q:a 5 was 160kb/s and -q:a 2 was 96kb/s,).
From what I can see,
-map_metadata -1
is pretty much "remove the mp3 metadata"... which isn't relevant if you're recoding to vorbis anyway.