debian 12 编译 vlc/libvlc 支持 rtsp
debian 官方从11开始,不再提供支持 rtsp 的 VLC deb 包,通过 libvlc 播放 rtsp 也无法实现,因此需要自己编译。
# 安装编译环境,编译依赖库以及 contrib 第三方工具
1 2 3 | sudo apt install git g++ make libtool automake autopoint pkg-config flex bison lua5.2 sudo apt build-dep vlc sudo apt install subversion yasm cvs cmake ragel |
建议添加阿里云的镜像源
1 2 3 4 5 6 7 8 9 10 11 | sudo nano /etc/apt/sources .list.d /aliyun .list # 添加 debian 阿里云源到 /etc/apt/sources.list deb https: //mirrors .aliyun.com /debian/ bookworm main non- free non- free -firmware contrib deb-src https: //mirrors .aliyun.com /debian/ bookworm main non- free non- free -firmware contrib deb https: //mirrors .aliyun.com /debian-security/ bookworm-security main deb-src https: //mirrors .aliyun.com /debian-security/ bookworm-security main deb https: //mirrors .aliyun.com /debian/ bookworm-updates main non- free non- free -firmware contrib deb-src https: //mirrors .aliyun.com /debian/ bookworm-updates main non- free non- free -firmware contrib deb https: //mirrors .aliyun.com /debian/ bookworm-backports main non- free non- free -firmware contrib deb-src https: //mirrors .aliyun.com /debian/ bookworm-backports main non- free non- free -firmware contrib<br><br> sudo apt update |
# 下载 vlc 源代码,解压
1 2 3 | wget http: //download .videolan.org /pub/videolan/vlc/3 .0.21 /vlc-3 .0.21. tar .xz tar xvJf vlc-3.0.21. tar .xz cd vlc-3.0.21 |
# 创建编译目录
1 2 3 | cd contrib mkdir native && cd native .. /bootstrap |
# 下载 live555 源代码并编译,注意不是 live555 的最新版本,而是 videolan 提供的特定版本
1 2 | wget http: //downloads .videolan.org /pub/contrib/live555/live .2016.11.28. tar .gz -O .. /contrib/tarballs/live .2016.11.28. tar .gz make .live555 |
# 配置 vlc 的编译参数,关键是指定安装位置,以及启用 rtsp,其他可选参数还有 --disable-alsa --disable-chromaprint --enable-shared 等, 开始编译
1 2 | ../.. /configure --prefix= /usr -- enable -realrtsp -- enable -live555 make |
# 编译完成后,查看是否已支持 live555
1 | . /vlc --list | grep live555 |
# 安装
1 | make install |
# 如果未安装在 /usr 下,想引用 libvlc 需要自己添加环境变量。也可以修改 /etc/ld.so.conf 或添加 /etc/ld.so.conf.d/libvlc.conf,填写"自定义的安装目录/lib",然后执行
1 | sudo ldconfig |
# 本文参考
https://wiki.videolan.org/UnixCompile/
https://wiki.videolan.org/Configure/
https://blog.csdn.net/x740073529/article/details/133711117
https://blog.csdn.net/m0_37554445/article/details/122986059
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南