HydrogenAudio

Lossy Audio Compression => Ogg Vorbis => Ogg Vorbis - General => Topic started by: sonytp50 on 2007-05-29 09:09:31

Title: Wanted: Mono capable windows command line mp3/mp2 -> ogg converter
Post by: sonytp50 on 2007-05-29 09:09:31
Hi,

I'm looking for a simple mp3/mp2 -> ogg encoder recommendation for windows that
does not require installation and can encode a single file (or folder). The resulting ogg
file should be mono, to get it as small as possible.

I know that normally mp3->ogg conversions are a big No-No due to the loss of quality.

In my usage scenario this is not an issue: I want to convert radio (speech) programs so
that I can get as much as possible on a 2GB Ipod Nano (Rockbox) and don't mind if the
quality suffers a lot. I'll delete the files after listening to them anyway.
I plan to keep the encoder on the Ipod - to run without installation whenever needed.

The conversion has to be directly from mp3/mp2 to ogg - I normally do not have the 2GB
free hard disc space required to unpack the radio shows to WAV before encoding them.

The best thing I have so far is ffmpeg, called like this:
ffmpeg -i input.mp3 -acodec vorbis -aq 20 -ar 22050  output.ogg

Alas it only seems to do ogg in stereo, not mono.

Any recommendations?
Title: Wanted: Mono capable windows command line mp3/mp2 -> ogg converter
Post by: david_dl on 2007-05-29 10:09:51
You could lame to decode with a pipe, ie.
Code: [Select]
LAME -m mono --decode input.mp3 - | oggenc -whateveroptionsyouwant -input - -output file.ogg

Note that i made up the parameters for oggenc, cos i've never used it, so find out what options you need to do mono encoding with stdin as the input file (usually done by specifying '-' as the file name), Also I don't know if the -m mono switch works for decoding, but that shouldnt matter if you can get oggenc to do the mono conversion, or if the input mp3 is already mono.
Title: Wanted: Mono capable windows command line mp3/mp2 -> ogg converter
Post by: sonytp50 on 2007-05-29 11:21:43
You could lame to decode with a pipe, ie.
Code: [Select]
LAME -m mono --decode input.mp3 - | oggenc -whateveroptionsyouwant -input - -output file.ogg

Note that i made up the parameters for oggenc, cos i've never used it, so find out what options you need to do mono encoding with stdin as the input file (usually done by specifying '-' as the file name), Also I don't know if the -m mono switch works for decoding, but that shouldnt matter if you can get oggenc to do the mono conversion, or if the input mp3 is already mono.


Thank for replying. I'm using this on Windows XP and I don't know if the pipe it working.
Whatever oggenc - parameters I use, I always end up with a 1.mp3.wav file on my harddisc
(for which I do not have the harddisc space in real life)

The lame help also specifies the "--decode" option as
" --decode        input=mp3 file, output=wav"

Code: [Select]
C:\Temp\3>lame -m mono --decode 1.mp3 | oggenc2 -input -  --output=file.ogg
ID3v2 found. Be aware that the ID3 tag is currently lost when transcoding.
input:  1.mp3  (44.1 kHz, 2 channels, MPEG-1 Layer III)
output: 1.mp3.wav  (16 bit, Microsoft WAVE)
skipping initial 1105 samples (encoder+decoder delay)
Frame#    12/10694  192 kbps   MS    oggenc2: invalid option -- i
Frame#    13/10694  160 kbpsWARNING: Unknown option specified, ignoring->
Frame# 10694/10694   32 kbps   MS
ERROR: Input file "(stdin)" is not a supported format
Title: Wanted: Mono capable windows command line mp3/mp2 -> ogg converter
Post by: john33 on 2007-05-29 11:57:35
Hi,

I'm looking for a simple mp3/mp2 -> ogg encoder recommendation for windows that
does not require installation and can encode a single file (or folder). The resulting ogg
file should be mono, to get it as small as possible.

I know that normally mp3->ogg conversions are a big No-No due to the loss of quality.

In my usage scenario this is not an issue: I want to convert radio (speech) programs so
that I can get as much as possible on a 2GB Ipod Nano (Rockbox) and don't mind if the
quality suffers a lot. I'll delete the files after listening to them anyway.
I plan to keep the encoder on the Ipod - to run without installation whenever needed.

The conversion has to be directly from mp3/mp2 to ogg - I normally do not have the 2GB
free hard disc space required to unpack the radio shows to WAV before encoding them.

The best thing I have so far is ffmpeg, called like this:
ffmpeg -i input.mp3 -acodec vorbis -aq 20 -ar 22050  output.ogg

Alas it only seems to do ogg in stereo, not mono.

Any recommendations?

You could try my xcLAME command line program. It will encode wav -> mp3, wav -> ogg, mp3 -> ogg and ogg -> mp3. It's based on LAME3.92 and the 1.0 release of ogg vorbis. I've not kept it fully up to date as there was never great interest in it. I did it for fun, but it does work. Since you say quality is no big issue, this should do the job and it's a bit 'cleaner' than messing with pipes.

You can d/l from: http://homepage.ntlworld.com/jfe1205/LAME/xcLAME.zip (http://homepage.ntlworld.com/jfe1205/LAME/xcLAME.zip) 
Title: Wanted: Mono capable windows command line mp3/mp2 -> ogg converter
Post by: gameplaya15143 on 2007-05-29 22:15:49
Code: [Select]
C:\Temp\3>lame -m mono --decode 1.mp3 | oggenc2 -input -  --output=file.ogg

You are missing the stdout "-" for LAME's output and -input is not a parameter for oggenc2

Use:
lame --help
and
oggenc2 --help
and reference the options (I'd tell you myself, but I don't remember off the top of my head)
Title: Wanted: Mono capable windows command line mp3/mp2 -> ogg converter
Post by: sonytp50 on 2007-05-29 22:55:21

Code: [Select]
C:\Temp\3>lame -m mono --decode 1.mp3 | oggenc2 -input -  --output=file.ogg

You are missing the stdout "-" for LAME's output and -input is not a parameter for oggenc2



I got it to work - with both mp3 and mp2 source files.

it now looks like this for a 48000 kHz radio file:
Code: [Select]
lame --decode input.mp2 - | oggenc2 - --downmix -q -2 --resample 24000 --output=output.ogg


The resulting file plays fine on an Ipod Nano with Rockbox.

Thanks. (Also thanks to john33 for the other suggestion)
Title: Wanted: Mono capable windows command line mp3/mp2 -> ogg converter
Post by: sonytp50 on 2007-05-30 22:52:38
(Original follow up question removed)

I asked as a follow-up how to do this using ffmpeg.

This is how:
Code: [Select]
ffmpeg.exe -i input.ts -acodec pcm_s16le -f wav - | oggenc2 - --raw --output =output.ogg