Re: [mpg123-users] how to use control interface with streaming input
Brought to you by:
sobukus
|
From: Thomas O. <tho...@or...> - 2010-06-15 16:58:58
|
Am Tue, 15 Jun 2010 00:32:24 +0100 schrieb zonyi besk <zo...@gm...>: > cat foo.mp3 | pv -L 176400 - | mpg123 -s -R -E like.eq --fifo "cmd.txt" - | > lame -x - outp.mp3 > > Is there a way using the control interface with that stream input. Yes;-) I'm trying that now (using 32 bit signed integers to minimize quality loss a bit). shell$ cat foo.mp3 | mpg123 -R --fifo /dev/shm/mpg123 --remote-err -s -e s32 | lame -r -s 44.1 --bitwidth 32 --signed -m j - outp.mp3 Another terminal... shell$ echo silence > /dev/shm/mpg123 shell$ echo load /dev/stdin > /dev/shm/mpg123 shell$ echo quit > /dev/shm/mpg123 That's how the initial terminal output should look: @R MPG123 (ThOr) v6 @silence @I stdin @P 2 @S 1.0 3 44100 Joint-Stereo 2 104 2 0 0 0 32 0 1 Assuming raw pcm input file LAME 3.98.2 64bits (http://www.mp3dev.org/) Using polyphase lowpass filter, transition band: 16538 Hz - 17071 Hz Encoding <stdin> to outp.mp3 Encoding as 44.1 kHz j-stereo MPEG-1 Layer III (11x) 128 kbps qval=3 We got a valid output file: shell$ mpg123 outp.mp3 High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3 version 1.12.1; written and copyright by Michael Hipp and others free software (LGPL/GPL) without any warranty but with best wishes Playing MPEG stream 1 of 1: outp.mp3 ... MPEG 1.0 layer III, 128 kbit/s, 44100 Hz joint-stereo ^C [0:07] Decoding of outp.mp3 finished. I'm not sure what your problem is... I see that file name "cmd.txt"... are you trying to feed a prepared script into mpg123? You'd need to do that via shell1$ mpg123 -R --fifo mpg123-command shell2$ cat cmd.txt > mpg123-command Also, when feeding mpg123's standard output via -s, don't forget --remote-err. Alrighty then, Thomas. PS: It should be possible to skip the RAW format settings in the lame command by making mpg123 write WAV to stdout: mpg123 -w /dev/stdout that adds a header that makes lame see the correct bit width and sampling rate ... but: I see a strange effect there. I can do mpg123 -w /dev/stdout file.mp3 | lame - test.mp3 just fine, the resulting test.mp3 is good. But doing mpg123 -e s32 -w /dev/stdout file.mp3 | lame - test.mp3 is not funny, static noise. It gets really funny when observing that this replacement process works again: shell$ mpg123 -e s32 -w /dev/stdout > testpipe.wav shell$ cat testpipe.wav | lame - test.mp3 I fail to see how that should do anything different. I suspect a funny bug, not sure where. |