Page 1 of 1

Command line convert from .ogg vorbis file to .mp3

Posted: 04 Jan 2012 17:30
by bullyellis
Hello,

I am trying to do a command line convert from a .ogg file to a .mp3 file. Here is my command line:
vlc -I dummy 0.ogg --sout=#transcode{acodec=mp3,channels=2,samplerate=44100}:standard{access=file,mux=raw,dst=0.mp3}
I am getting the following error:
main stream out error: Failed to create audio filter
stream_out_transcode stream out error: Failed to find conversion filter for resampling
stream_out_transcode stream out error: cannot create audio chain
main decoder error: cannot create packetizer output (vorb)

Re: Command line convert from .ogg vorbis file to .mp3

Posted: 05 Jan 2012 19:25
by VLC_help
Remove samplerate part.

Re: Command line convert from .ogg vorbis file to .mp3

Posted: 29 Feb 2012 23:03
by bullyellis
Hey VLC_help,

That worked! Is there a way to know which arguments (channels, samplerate) are available to each "acodec" ?

For example, which arguments are available if I choose acodec=s161, acodec=mp3?

Or are the same arguments available to each one, regardless of acodec ?

Re: Command line convert from .ogg vorbis file to .mp3

Posted: 01 Mar 2012 19:42
by VLC_help
Samplerate and channels should work with all output codecs, but not all values of them will work (and some files might be unresampable <-- I don't know if that is a valid English word).

Re: Command line convert from .ogg vorbis file to .mp3

Posted: 31 Jan 2023 17:08
by dhdurgee
I am attempting to do this and encountering an error:

Code: Select all

dhdurgee@z560:~/Music/Petra$ vlc -I dummy The_Ultimate_Collection.ogg --sout=#transcode{acodec=mp3,channels=2}:standard{access=file,mux=raw,dst=The_Ultimate_Collection.mp3} VLC media player 3.0.18 Vetinari (revision 3.0.13-8-g41878ff4f2) [0000560bb8f3a6b0] [http] lua interface: Lua HTTP interface [0000560bb8f46f70] dummy interface: using the dummy interface module... [00007f998cc1b2c0] main stream output error: stream chain failed for `transcodechannels=2:standarddst=The_Ultimate_Collection.mp3' [00007f9978000990] main input error: cannot start stream output instance, aborting ^Cdhdurgee@z560:~/Music/Petra$
What am I doing wrong? Did something change?

Dave

Re: Command line convert from .ogg vorbis file to .mp3

Posted: 31 Jan 2023 17:39
by Alaric
Hi Dave,

Add quotation marks to the transcode chain descriptor so you shell is not confused on how to interpret it. You also might want to change the `raw` muxer to `mp3` to have a proper mpeg container and add `vlc://quit` as a second input to automatically close vlc when the transcoding is done:

Code: Select all

vlc -I dummy The_Ultimate_Collection.ogg --sout="#transcode{acodec=mp3,channels=2}:standard{access=file,mux=mp3,dst=The_Ultimate_Collection.mp3}" vlc://quit

Re: Command line convert from .ogg vorbis file to .mp3

Posted: 31 Jan 2023 18:27
by dhdurgee
Hi Dave,

Add quotation marks to the transcode chain descriptor so you shell is not confused on how to interpret it. You also might want to change the `raw` muxer to `mp3` to have a proper mpeg container and add `vlc://quit` as a second input to automatically close vlc when the transcoding is done:

Code: Select all

vlc -I dummy The_Ultimate_Collection.ogg --sout="#transcode{acodec=mp3,channels=2}:standard{access=file,mux=mp3,dst=The_Ultimate_Collection.mp3}" vlc://quit
Thank you for the speedy reply. I am running this as I reply.

How smart is the transcode from ogg to mp3? I would hope that it is doing a VBR CD quality transcode to match the ogg input.

Dave

Re: Command line convert from .ogg vorbis file to .mp3

Posted: 31 Jan 2023 20:41
by dhdurgee
Follow up to above. I did a little further checking and found the following:
Note: If you try to create mp3 files it probably won't use the best compression techniques! A better alternative is to use the LAME MP3 encoder.

I have lame available, so I would like to pipe the output from vlc to lame for better encoding. How can I accomplish this? It is not as simple as:

cvlc %input_file% | lame -V 2 -Y -b 96 - %output_file%

I tried this and the input file started to play via the speakers on my laptop.

Dave

PS: I tried adding --sout="#std{access=file,mux=wav,dst=-}" and had to ^C an endless repetition of "file access out error: cannot write: Resource temporarily unavailable"