Page 1 of 1

A Couple of Rookie Questions

Posted: 03 Apr 2021 20:47
by jogl
I have written a script to write an MP3 stream to a file:

Code: Select all

cvlc "http://cbcmp3.ic.llnwd.net/stream/cbcmp3_cbc_r2_tor" --sout file/mp3:/home/jogl/audio/"$(date +%Y-%m-%d_CBC_%H:%M:%S).mp3" --run-time=3240 vlc://quit
It works fine, so far, outputs a file with name

Code: Select all

2021-04-03_CBC_15:06:01.mp3
but I don't understand why.

If I change it to:

Code: Select all

cvlc "http://cbcmp3.ic.llnwd.net/stream/cbcmp3_cbc_r2_tor" --sout file/mp3:/home/jogl/audio/"$(%Y-%m-%d_CBC_%H:%M:%S).mp3" --run-time=3240 vlc://quit
I get a file called:

Code: Select all

.mp3
Why does it only work with the "date +" in the sout file name?


Q2:
How can I send the stream to the speakers while it is recording? Using the built in line out via PulseAudio Volume Control I believe. It is on a Debian 10 system with an XFCE desktop.

Thanks,
JP.

Re: A Couple of Rookie Questions

Posted: 03 Apr 2021 21:04
by jogl
Well, cancel Q2, this, mostly stolen from another thread here, is working.

Code: Select all

cvlc "http://cbcmp3.ic.llnwd.net/stream/cbcmp3_cbc_r2_tor" --sout "#duplicate{dst=display,dst=std{access=file,mux=mp3,dst=/home/jogl/audio/"$(date +%Y-%m-%d_%H%M%S).mp3"}}" --run-time=10 vlc://quit
If somebody could explain the command to me I would be grateful.

Thanks again,
JP.

Re: A Couple of Rookie Questions

Posted: 03 Apr 2021 21:09
by jogl
Oops, one more thing, I am getting this "prefettch stream error", what does it mean?

Code: Select all

jogl@gateD10:~/audio$ cvlc "http://cbcmp3.ic.llnwd.net/stream/cbcmp3_cbc_r2_tor" --sout "#duplicate{dst=display,dst=std{access=file,mux=mp3,dst=/home/jogl/audio/"$(date +%Y-%m-%d_%H%M%S).mp3"}}" --run-time=10 vlc://quit VLC media player 3.0.12 Vetinari (revision 3.0.12-1-0-gd147bb5e7e) [00005647bf8e9a00] dummy interface: using the dummy interface module... [00007f56ac004b40] dummy mux: Open [00007f56ac007fb0] prefetch stream error: unimplemented query (264) in control [00007f56ac0056d0] idummy demux: command `quit' jogl@gateD10:~/audio$
JP.

Re: A Couple of Rookie Questions

Posted: 04 Apr 2021 08:40
by RĂ©mi Denis-Courmont
Your shell expands $(...) to nothing, that's all (and that's expected).

Re: A Couple of Rookie Questions

Posted: 27 Oct 2024 13:06
by jogl
Reviving this old thread since the subject is basically the same.

I am using the command above:

Code: Select all

cvlc "http://cbcmp3.ic.llnwd.net/stream/cbcmp3_cbc_r2_tor" --sout "#duplicate{dst=display,dst=std{access=file,mux=mp3,dst=/home/jogl/audio/"$(date +%Y-%m-%d_%H%M%S).mp3"}}" --run-time=10 vlc://quit
to record audio streams.

Is there a way to separate the songs and save them to separate files?

Thanks,
JP