本篇內(nèi)容介紹了“l(fā)inux安裝ffmpeg的詳細(xì)步驟”的有關(guān)知識(shí),在實(shí)際案例的操作過(guò)程中,不少人都會(huì)遇到這樣的困境,接下來(lái)就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!
大渡口網(wǎng)站制作公司哪家好,找創(chuàng)新互聯(lián)!從網(wǎng)頁(yè)設(shè)計(jì)、網(wǎng)站建設(shè)、微信開(kāi)發(fā)、APP開(kāi)發(fā)、成都響應(yīng)式網(wǎng)站建設(shè)等網(wǎng)站項(xiàng)目制作,到程序開(kāi)發(fā),運(yùn)營(yíng)維護(hù)。創(chuàng)新互聯(lián)從2013年開(kāi)始到現(xiàn)在10年的時(shí)間,我們擁有了豐富的建站經(jīng)驗(yàn)和運(yùn)維經(jīng)驗(yàn),來(lái)保證我們的工作的順利進(jìn)行。專注于網(wǎng)站建設(shè)就選創(chuàng)新互聯(lián)。
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
sudo apt-get -y install build-essential checkinstall git libfaac-dev libgpac-dev \
libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev librtmp-dev libtheora-dev \
libvorbis-dev pkg-config texi2html yasm zlib1g-dev
# Install x264
sudo apt-get -y install libx264-dev
cd
git clone --depth 1 git://git.videolan.org/x264
cd x264
./configure --enable-static
make
sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | \
awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \
--fstrans=no --default
# Install AAC audio decoder
cd
wget http://downloads.sourceforge.net/opencore-amr/fdk-aac-0.1.0.tar.gz
tar xzvf fdk-aac-0.1.0.tar.gz
cd fdk-aac-0.1.0
./configure
make
sudo checkinstall --pkgname=fdk-aac --pkgversion="0.1.0" --backup=no \
--deldoc=yes --fstrans=no --default
# Install VP8 video encoder and decoder.
cd
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx
cd libvpx
./configure
make
sudo checkinstall --pkgname=libvpx --pkgversion="1:$(date +%Y%m%d%H%M)-git" --backup=no \
--deldoc=yes --fstrans=no --default
# Add lavf support to x264
# This allows x264 to accept just about any input that FFmpeg can handle and is useful if you want to use x264 directly. See a more detailed explanation of what this means.
cd ~/x264
make distclean
./configure --enable-static
make
sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | \
awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \
--fstrans=no --default
#downloaded rtmpdump
http://rtmpdump.mplayerhq.hu/
git clone git://git.ffmpeg.org/rtmpdump
cd rtmpdump
為了得到調(diào)試信息,這里簡(jiǎn)單修改一下文件夾rtmpdump和librtmp的Makefile文件,添加-g參數(shù),注意去掉優(yōu)化參數(shù)-O2那項(xiàng)
在rtmpdump的Makefile中的
OPT=-O2
CFLAGS=-Wall -g $(XCFLAGS) $(INC) $(DEF) $(OPT)
在librtmp的Makefile中的
CFLAGS=-Wall .... -g
2.安裝相關(guān)依賴類
需要用到的依賴庫(kù)是zlib, openssl庫(kù),使用如下命令安裝
sudo apt-get install openssl
sudo apt-get install libssl-dev
sudo apt-get install zlib1g-dev
可以先查看可用的安裝包
sudo apt-cache search openssl
通過(guò)閱讀Makefile文件,我發(fā)現(xiàn)rtmpdump需要引用的動(dòng)態(tài)庫(kù)如下
-lz -lssl -lcrypto -lrtmp -lpthread
make后會(huì)生成4個(gè)可執(zhí)行文件, 分別是rtmpdump,rtmpsvr, rtmpsuck, rtmpgw, 其中pthread直會(huì)在rtmpsvr, rtmpsuck, rtmpgw這3個(gè)程序中用到.
3.編譯安裝
make
sudo make install
首先要保證相關(guān)庫(kù)已經(jīng)成功安裝到/usr/local/lib下面
再要保證/usr/local/lib在/etc/ld.so.conf配置文件中,然后
sudo ldconfig
來(lái)更新動(dòng)態(tài)庫(kù)緩存
檢查rtmpdump所有依賴庫(kù)是否都引用成功
ldd rtmpdump
#downloaded libogg
wget https://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.xz
Installation of libogg
Install libogg by running the following commands:
./configure --prefix=/usr \
--disable-static \
--docdir=/usr/share/doc/libogg-1.3.2 &&
make
To test the results, issue: make check.
Now, as the root user:
make install
#downloaded libvorbis-1.3.5
wget https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.xz
Installation of libvorbis
Optionally fix installation of the package when --enable-docs is added to the configure switches:
sed -i '/components.png \\/{n;d}' doc/Makefile.in
Install libvorbis by running the following commands:
./configure --prefix=/usr --disable-static &&
make
To test the results, issue: make LIBS=-lm check.
Now, as the root user:
make install &&
install -v -m644 doc/Vorbis* /usr/share/doc/libvorbis-1.3.5
#downloaded libtheora
wget https://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.xz
Installation of libtheora
Install libtheora by running the following commands:
sed -i 's/png_\(sizeof\)/\1/g' examples/png2theora.c &&
./configure --prefix=/usr --disable-static &&
make
If you wish to run the tests, issue: make check.
Now, as the root user:
make install
# Installing FFmpeg
cd
git clone --depth 1 git://source.ffmpeg.org/ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-libfdk-aac --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp
--enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264
--enable-nonfree --enable-version3
make
sudo checkinstall --pkgname=ffmpeg --pkgversion="5:$(date +%Y%m%d%H%M)-git" --backup=no \
--deldoc=yes --fstrans=no --default
hash x264 ffmpeg ffplay ffprobe
# Optional: install qt-faststart
# This is a useful tool if you're showing your H.264 in MP4 videos on the web. It relocates some data in the video to allow playback to begin before the file is completely downloaded. Usage: qt-faststart input.mp4 output.mp4.
cd ~/ffmpeg
make tools/qt-faststart
sudo checkinstall --pkgname=qt-faststart --pkgversion="$(date +%Y%m%d%H%M)-git" --backup=no \
--deldoc=yes --fstrans=no --default install -Dm755 tools/qt-faststart \
/usr/local/bin/qt-faststart
我用一段轉(zhuǎn)碼測(cè)試了一下
#ffmpeg -i file.avi output.flv
發(fā)現(xiàn)報(bào)了一個(gè)庫(kù)找不到的錯(cuò)
去搜索了一下相關(guān)問(wèn)題
于是乎我就
軟鏈接了一下,再次測(cè)試就通過(guò)了
“l(fā)inux安裝ffmpeg的詳細(xì)步驟”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí)可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!
當(dāng)前標(biāo)題:linux安裝ffmpeg的詳細(xì)步驟
標(biāo)題URL:http://www.rwnh.cn/article24/jishje.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供關(guān)鍵詞優(yōu)化、定制網(wǎng)站、定制開(kāi)發(fā)、響應(yīng)式網(wǎng)站、網(wǎng)站收錄、ChatGPT
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)