mp3/wma/... from stdin; 2x16x44.1 raw to stdout

Just have a drink and chat
_FrnchFrgg_

mp3/wma/... from stdin; 2x16x44.1 raw to stdout

Postby _FrnchFrgg_ » 20 Jan 2005 13:59

How can I use vlc as a transcoder in a pipe, as could be done with mpg123 ?

I could then burn easily .wma and every audio format undersood by vlc -- and they are numerous -- without the need to have a LOT of tiny converters I do not use for another purpose.


Thank you in advance, and thank you for this great piece of software.

_FrnchFrgg_

Sigmund
Big Cone-huna
Big Cone-huna
Posts: 893
Joined: 26 Nov 2003 09:38

Postby Sigmund » 20 Jan 2005 14:47

The following incarnation should work:

Code: Select all

vlc ~/musikk/Track\ 07.ogg --sout "#transcode{acodec=s16l,channels=2,rate=44100}:std{access=file,mux=raw,url=-}" -q --intf dummy vlc:qui
however the rate part is not implemented yet, so output rate will be whatever the input rate is.

Alternatively you can use this:

Code: Select all

vlc ~/musikk/Track\ 07.ogg -A file -q --audiofile-channels=2 --audiofile-format=s16 --aout-rate=44100 --audiofile-file - vlc:quit --intf dummy
however this may result in short dropouts, and will only work in real-time.

_FrnchFrgg_

Thanks

Postby _FrnchFrgg_ » 25 Jan 2005 22:15

Thanks a lot.

_FrnchFrgg_

_Frnchfrgg_

Nota

Postby _Frnchfrgg_ » 25 Jan 2005 22:23

Though it would be easier and nicer to get VLC to convert even rates, it is not really necessary since I can pipe the output through another converter (provided I output from VLC a format indicating the rate).

My main goal was indeed to gain access to a lot of different format/encapsulations, even the most rare, and it is achieved, reducing a whole bench of converters to at most two (and only one when VLC will "transrate").

Thanks again.

_FrnchFrgg_

_FrnchFrgg_

Strange error ?

Postby _FrnchFrgg_ » 26 Jan 2005 14:49

I replaced the name of the file by '-' because I needed to input from a file and changed the encapsulation to 'wav'; let denote by cmd the resulting command:

Code: Select all

vlc - --sout "#transcode{acodec=s16l,channels=2,rate=44100}:std{access=file,mux=wav,url=-}" -q --intf dummy vlc:quit
I works very well, aka when I do 'cat <some audio file> | cmd | vlc -, for example, I get what I want, i.e. vlc playing a wave from stin.

But when I pipe it though sox, sox assumes (or reads, I don't know) the lenght is 0 and thus does nothing, that is outputs an empty file and quits...

So I decided to try the command without sox in my cdrecord gui (namely gtoaster) and it stuck when I tried to use the conversion, as it was unable to read vlc's output.

There is no output problem since another VLC can read the pipe and play it, but as VLC can read nearly any combination of MUX/CODEC, the error may come from an attempt to output non-standard wave format (but I always thought waves were only raw data in a container indicating rates... might I have been wrong for so long ?).

This problem isn't to much to bother with since I can still use VLC to convert my file, and then use sox througn pipes as gtoaster seems to like, but my first goal was to provide gtoaster with a full and transparent management of audio files.

_FrnchFrgg_[/code]

_FrnchFrgg_

Amusing

Postby _FrnchFrgg_ » 26 Jan 2005 14:53

phpBB is completely lost when using a button to insert the opening of a BBcode area, and closing 'by hand'.

It added a last [/code] token that logically isn't parsed.

Funny.

_FrnchFrgg_

P.S.: Sorry for the spam, I tend to speak too much.

_FrnchFrgg_

Correction

Postby _FrnchFrgg_ » 26 Jan 2005 17:39

I have no idea of why, but now the direct connection of vlc's stdout to gtoaster's stdin seems to work.

Reading sox's man page, I saw that it expects Microsoft RIFF WAV, so it may be the explanation.

_FrnchFrgg_

_FrnchFrgg_

By the way...

Postby _FrnchFrgg_ » 26 Jan 2005 20:26

By the way, I found a post asking whether it was possible to get media duration from command line, and the answer was NO.

I thought there was a text-only interface ? Couldn't we grep on it's output ?

The main problem is probably to be able to get information from the media and quit as soon as it's gotten ; it seems (but I may be wrong) the way VLC functions permits only to get information while the stream is being read...

I think I could, with time and a bit of study of the code, write sort of a 'info' interface, that would simply output info on stdout (or stderr), and quit...
The way I see it it is not a extra interface, but really an interface; because we can (apart from sending the info to stdout) already do that by hand with the wxwindow interface, I am sure my project is easily feasible.

Could you tell me what you think about that ?

_FrnchFrgg_


Return to “Coffee Corner”

Who is online

Users browsing this forum: No registered users and 26 guests