使用 libvlc 将 mp3 流式传输到网络
如何使用 libvlc 获取 MP3 文件(或实际上任何音频文件)并将其流式传输到网络,以便我可以连接 iTunes 或其他设备并像网络广播一样收听?
尽管任何语言都可以,但 C API 示例是首选。
How can I use libvlc to take an MP3 file (or really any audio file) and stream it to the network so I can connect with iTunes or something and listen like internet radio?
C API example is preferred, though any language is fine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
libvlc_vlm_add_broadcast
接受一个sout
字符串,所以这似乎可以解决问题:libvlc_vlm_add_broadcast
accepts ansout
string, so this seems to do the trick:文档对此足够清楚,您创建一个媒体(我记得是 vlc_media_new ),将 libvlc 的实例与其关联。然后,您从媒体(vlc_player_from_media 或类似的东西)创建一个播放器,然后开始播放。
我无法帮助您处理流媒体部分,因为我目前也在尝试解决它,但一旦我意识到如何完成工作,我就会帮助您:)
the documentation is clear enough for this, you create a media (vlc_media_new as I recall), associating an instance of the libvlc to it. Then you create a player from media (vlc_player_from_media or something like that) and then you start playing.
I can't help you for the streaming part because I'm currently trying to figure it out too, but I'll give you a hand as soon as I realize how to get the job done :)