[Exchange and share] 自编译ffmpeg6.1
Tofloor
poster avatar
qq4945286
deepin
2023-11-16 06:22
Author

这是FFmpeg 6.1 “Heaviside”更新了以下的内容

截图_选择区域_20231115215502.png

如果前面已经安装过了ffmpeg的,第一步就是先删除系统中的ffmpeg

终端输入sudo apt purge ffmpeg

下面就说一下,在deepin v23上进行编译

1:到这里下载,源码包https://ffmpeg.org/download.html#releases

截图_选择区域_20231115215810.png

2:到下载目录解压

截图_选择区域_20231115220109.png

3:进入解压目录

cd Downloads/ffmpeg-6.1/

截图_选择区域_20231115220434.png

4:接着在终端输入

./configure --prefix=/usr/local/ffmpeg --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --disable-x86asm --extra-cflags=-I/usr/local/ffmpeg/include/ --extra-ldflags=-L/usr/local/ffmpeg/lib

5:编译和安装

编译:sudo make

安装编译:sudo make install

6:现在虽然是安装好了,但现在还不能用。到/usr/local/在这目录下就有一个ffmpeg目录

截图_选择区域_20231115221008.png

在ffmpeg目录下有一个lib目录,这是ffmpeg的动态库,我们要把添加到/etc/ld.so.conf

在终端用命令的方式加入

sudo vim /etc/ld.so.conf(我这里用的是vim你也可以用别的)

然后把这个/usr/local/ffmpeg/lib粘贴进去,保存退出。

把着在终端输入sudo /sbin/ldconfig

7:创建一个连接

sudo ln -s /usr/local/ffmpeg/bin/ffmpeg /usr/bin/ffmpeg

到这里就完成了,在终端输入ffmpeg如图

截图_选择区域_20231115221757.png

如果你的还不行

就在终端输入

sudo echo 'export PATH=/usr/local/ffmpeg/bin:$PATH' >>~/.bashrc

source ~/.bashrc

如果前面编译没有出错,这样就好了。

最好进入到ffmpeg的解压目录,鼠标右键选择打开终端,输入

make clean删除编译

Reply Favorite View the author
All Replies
f@deepin
deepin
2023-11-16 06:29
#1

感谢分享

Reply View the author
qq4945286
deepin
2023-11-16 06:35
#2

如果前面已经安装过了ffmpeg的,第一步就是先删除系统中的ffmpeg

终端输入sudo apt purge ffmpeg

Reply View the author
Ziggy
deepin
2023-11-16 07:35
#3

no

将自己后期单独编译的内容路径设置在全局环境变量中看起来风险太高了,很多程序都是认ffmpeg版本的,像deepin-movie这种系统级组件一般在编译开发时会基于系统内置的ffmpeg来链接,如果自己后期编译的ffmpeg缺乏了某个encoder/decoder又恰好优先被应用引用了,很大可能会导致功能异常

如果是普通应用要引用更新的三方库,不妨试试在启动脚本中使用PATH+LD_LIBRARY_PATH变量

现在商店里的OBS Studio就是单独编译的,编译内容和启动文件后续会开源,如果是对编译感兴趣的可以关注"deepin-shared-libs"SIG:

https://github.com/deepin-community/SIG/tree/master/sig/deepin-shared-libs

后续也会不断分享更多library、application的编译文档,很期待能和大家交流

Reply View the author
dreamcast
deepin
2023-11-16 09:41
#4
這個版本支持DVD的chapter嗎?如果不支持,是否可以patch到支持呢?
Reply View the author
dreamcast
deepin
2023-11-16 09:41
#5
It has been deleted!
神末shenmo
deepin
Spark-App
2023-11-16 18:36
#6

你这里缺了好多的编码器支持呀

给你试试这个?

https://cdn.d.store.deepinos.org.cn/aarch64-store/video/ffmpeg-spark/

Reply View the author
魔法师
deepin
2023-11-16 23:27
#7

从来不安装到系统,我自有 $HOME/deploy 目录 all in 所有工具与环境
applaud

Reply View the author
babyfengfjx
Super Moderator
CQA
2023-11-16 23:34
#8

牛皮plus 虽然暂时还用不到这个新版本tail

Reply View the author