Code: Select all
--sout="#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:duplicate{dst=http{mux=ffmpeg{mux=flv},dst=:8080/}", :no-sout-all :sout-keep
Code: Select all
--sout="#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:duplicate{dst=http{mux=ffmpeg{mux=flv},dst=:8080/}",
Code: Select all
import vlc
import time
inst = vlc.Instance()
url = "https://rockthecradle.stream.publicradio.org/rockthecradle-tunein.mp3"
param=[url, "--sout=#transcode{acodec=flac}:std{access=http,mux=flac,dst=10.0.0.6:8080}"]
m = inst.media_new(*param)
player = m.player_new_from_media()
player.play()
while True:
time.sleep(0.2)
Code: Select all
vlc --sout=#transcode{acodec=flac}:std{access=http,mux=flac,dst=10.0.0.6:8080} "https://rockthecradle.stream.publicradio.org/rockthecradle-tunein.mp3"
Code: Select all
vlc --sout=#transcode{acodec=flac}:std{access=http,mux=flac,dst=10.0.0.6:8080} "https://rockthecradle.stream.publicradio.org/rockthecradle-tunein.mp3"
Actually Rémi's right, --sout won't work on any recent libvlc version (sort of since renderer API in libvlc).Hmm, the second post in this thread is saying that it works
OK, I understand that --sout options will not work in Instance class but should work in Media class. I'm just wondering why my example which is using Media doesn't work? Is it just because now is exactly that time which you mentioned - "and might break some time"?Actually Rémi's right, --sout won't work on any recent libvlc version (sort of since renderer API in libvlc).
A media option will work though, by passing the option to `media_new`, because it's no different than what VLC does, but as always it's not "public supported API" and might break some time. But you can still pass :sout-keep (or :no-sout-keep to destroy the sout) and still pass sout option in a more flexible way than when passing the option to the instance.
Code: Select all
import vlc
import time
inst = vlc.Instance()
url = "https://rockthecradle.stream.publicradio.org/rockthecradle-tunein.mp3"
param=[url, "sout=#transcode{acodec=flac}:std{access=http,mux=flac,dst=:8080}"]
m = inst.media_new(*param)
player = m.player_new_from_media()
player.play()
while True:
time.sleep(0.2)
Return to “Development around libVLC”
Users browsing this forum: No registered users and 14 guests