schollz / broadcast-server

A simple Go server that broadcasts any data/stream.
https://schollz.com/blog/radio
MIT License
69 stars 15 forks source link

How to use cvlc instead of ffmpeg? #3

Open huapox opened 2 years ago

huapox commented 2 years ago

First, thx for the amazing tool!

ffmpeg -y -nostdin -f pulse -i default  -f mp3 - | \
    curl -s -k -H "Transfer-Encoding: chunked" -X POST -T - \
    "http://localhost:9222/pulse.mp3?stream=true&advertise=true"

cvlc t2.mp3 ':sout=#transcode{acodec=mp2,ab=128,channels=2}:duplicate{dst=rtp{mux=ts,dst=127.0.0.1,port=1234}}'

how could we use cvlc to send stream to broadcast-server?

huapox commented 2 years ago

Tested ok with:

':sout=#transcode{acodec=mp3,ab=52,channels=2}:standard{access=file,mux=mp3,dst=-}'

cvlc t2.mp3 ':sout=#transcode{acodec=mp3,ab=52,channels=2}:standard{access=file,mux=mp3,dst=-}'  | curl -k -H "Transfer-Encoding: chunked" -X POST -T -  'localhost:9222/cvlc01.mp3?stream=true&advertise=true'
schollz commented 2 years ago

so cool! would you like to make a PR with that snippet in the readme?

huapox commented 2 years ago

so cool! would you like to make a PR with that snippet in the readme?

Sure, I'll with a PR latter.