Command line convert from .ogg vorbis file to .mp3

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
bullyellis
New Cone
New Cone
Posts: 7
Joined: 18 Jan 2011 22:20

Command line convert from .ogg vorbis file to .mp3

Postby bullyellis » 04 Jan 2012 17:30

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)

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

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

Postby VLC_help » 05 Jan 2012 19:25

Remove samplerate part.

bullyellis
New Cone
New Cone
Posts: 7
Joined: 18 Jan 2011 22:20

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

Postby bullyellis » 29 Feb 2012 23:03

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 ?

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

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

Postby VLC_help » 01 Mar 2012 19:42

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).

dhdurgee
Cone that earned his stripes
Cone that earned his stripes
Posts: 117
Joined: 23 Apr 2015 02:37

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

Postby dhdurgee » 31 Jan 2023 17:08

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

Alaric
Developer
Developer
Posts: 36
Joined: 27 Apr 2022 18:37

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

Postby Alaric » 31 Jan 2023 17:39

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

dhdurgee
Cone that earned his stripes
Cone that earned his stripes
Posts: 117
Joined: 23 Apr 2015 02:37

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

Postby dhdurgee » 31 Jan 2023 18:27

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

dhdurgee
Cone that earned his stripes
Cone that earned his stripes
Posts: 117
Joined: 23 Apr 2015 02:37

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

Postby dhdurgee » 31 Jan 2023 20:41

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"


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 21 guests