日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

Ubuntu/Debian交叉编译安装ARM平台版本的ffmpeg

發布時間:2023/12/18 Ubuntu 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Ubuntu/Debian交叉编译安装ARM平台版本的ffmpeg 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1 準備工作

(1)libmp3lame庫

下載:????wget?http://downloads.sourceforge.net/lame/lame-3.99.tar.gz

解壓

編譯:./configure --prefix=/usr/local/arm --host=arm-none-linux-gnueabi

????????????make

????????????make install

編譯ok。

?

(2)libxvid庫(x264庫)

支持xvid x264,現在最流行的兩種高質量的壓縮格式,下載地址是:

http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz

解壓后參考其readme文件,打開xvidcore/doc/INSTALL文件
基本上還是通常的三步曲,只不過configure文件換了個目錄,在build\generic路徑下
我們也看到庫支持vs2008編譯

./configure --prefix=/usr/local/arm --host=arm-none-linux-gnueabi

make

sudo make install

?(3)FAAC庫的編譯安裝(貌似不需要)
從網上下載的源碼是faad2-2.0.tar,在Ubuntu上解壓后,由于是DOS格式的,執行下面語句會出錯
./bootstrap

我的執行步驟是
chmod +x bootstrap

dos2unix bootstrap

./bootstrap

報錯:

# ./bootstrap

configure.in:38: warning: underquoted definition of MY_CHECK_TYPEDEF_FROM_INCLUDE
configure.in:38:?? run info '(automake)Extending aclocal'
configure.in:38:?? or see?http://www.gnu.org/software/automake/manual/automake.html#Extending-aclocal
./bootstrap: 5: ./bootstrap: libtoolize: not found
#?
# apt-get install -y libtoolize

======================

./configure --prefix=/usr/local/arm --host=arm-none-linux-gnueabi

make

make install

?

?2 配置及編譯安裝相關的選項有
?--cross-prefix=PREFIX???use PREFIX for compilation tools []
?--enable-cross-compile??assume a cross-compiler is used
?
?--disable-ffserver??????disable ffserver build
?--disable-postproc??????disable libpostproc build
?--disable-ffplay????????disable ffplay build

?--arch=ARCH?????????????select architecture []
?--cpu=CPU???????????????select the minimum required CPU (affects
??????????????????????????instruction selection, may crash on older CPUs)
?--target-os=OS??????????compiler targets OS []??????????????????????????

?--enable-libfaac????????enable FAAC support via libfaac [no]
?--enable-libmp3lame?????enable MP3 encoding via libmp3lame [no]
?--enable-libxvid????????enable Xvid encoding via xvidcore,
?????????????????????????native MPEG-4/Xvid encoder exists [no]

?--host-cc=HOSTCC????????use host C compiler HOSTCC
?--host-cflags=HCFLAGS???use HCFLAGS when compiling for host
?--host-ldflags=HLDFLAGS?use HLDFLAGS when linking for host
?--host-libs=HLIBS???????use libs HLIBS when linking for host
?
?--extra-cflags=ECFLAGS??add ECFLAGS to CFLAGS []
?--extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS []
?--extra-libs=ELIBS??????add ELIBS []
?
?--sysroot=PATH??????????root of cross-build tree
?--sysinclude=PATH???????location of cross-build system headers?

實際的配置參數為:

./configure --prefix=/usr/local/arm \
--cross-prefix=arm-none-linux-gnueabi- --enable-cross-compile \
--target-os=linux --arch=armv6j \
--disable-ffserver --disable-postproc --disable-ffplay \
--enable-libmp3lame --enable-libxvid \
--sysinclude=/usr/local/arm/include \
--extra-cflags=-I/usr/local/arm/include \
--extra-ldflags=-L/usr/local/arm/lib \
--enable-gpl

其中要注意--cross-prefix的設置最后要有符號- , --arch選項要根據自己的GCC的選項加,我的編譯的選項有-march=armv6j,不清楚就不要加.
最后加--enable-gpl是因為--enable-libxvid選項,這造成了與--enable-libfaac選項沖突。

然后
make

以root身份運行
make install

?

3 測試
將安裝目錄中的ffmpeg程序拷貝到設備上,測試從視頻中截取一張圖片
ffmpeg -i 12.mp4 -y -f image2 -ss 10.010 -t 0.001 -s 320x240 test.jpg

成功執行,說明ffmpeg交叉編譯順利完成。

轉載于:https://www.cnblogs.com/prettyshuang/p/5552300.html

總結

以上是生活随笔為你收集整理的Ubuntu/Debian交叉编译安装ARM平台版本的ffmpeg的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。