Linux下安装视频转换工具ffmpeg
ffmpeg下载地址:http://ffmpeg.org/releases/
1.首先需要安装解码器集合(包含安装ffmpeg用到的所有解码器)下载地址:
链接:https://pan.baidu.com/s/1gxtRLmx20jhvBDHn3qBffA提取码: pwja
因为我的项目中使用x264的解码方式,所有我只安装该解码器。
代码地址:https://www.cnblogs.com/lemon2019/p/14106794.html
tar -xvf x264-master.tar.bz2
cd /usr/local/src/ffmpeg/x264-master/
./configure --prefix=/usr --enable-shared
make
make install
2.ffmpeg安装
tar -vxf ffmpeg-4.3.tar.bz2
./configure --prefix=/usr/local/ffmpeg2 --enable-libx264 --enable-gpl
make
make install
error while loading shared libraries: libavdevice.so.53: cannot open shared object file: No such file or director
错误,是因为共享库文件安装到了/usr/local/ffmpeg2/lib目录下, 那么把新共享库目录加入到共享库配置文件/etc/ld.so.conf中, 如下:
# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
# echo "/usr/local/ffmpeg2/lib" >> /etc/ld.so.conf
# ldconfig
再次执行 /usr/local/ffmpeg2/bin/./ffmpeg
如果出现如下版本信息则安装成功:
[root@xa-server150 ffmpeg]# /usr/local/ffmpeg2/bin/./ffmpeg
ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-36)
configuration: --prefix=/usr/local/ffmpeg2 --enable-libx264 --enable-gpl
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... Use -h to get full help or, even better, run 'man ffmpeg'
3.验证视频格式转码:
[root@xa-server150 ffmpeg]# /usr/local/ffmpeg2/bin/./ffmpeg -i /usr/local/src/ffmpeg/upload/111111.avi -c:v libx264 -mbd 0 -c:a aac -strict -2 -pix_fmt yuv420p -movflags faststart /usr/local/src/ffmpeg/upload/5552226.mp4
ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-36)
configuration: --prefix=/usr/local/ffmpeg2 --enable-libx264 --enable-gpl
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/usr/local/src/ffmpeg/upload/111111.avi':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : www.aliyun.com - Media Transcoding
Duration: 00:00:15.05, start: 0.000000, bitrate: 3875 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x360 [SAR 1:1 DAR 16:9], 3785 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x340e680] using SAR=1/1
[libx264 @ 0x340e680] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x340e680] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 0x340e680] 264 - core 161 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=24 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/usr/local/src/ffmpeg/upload/5552226.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 24 fps, 12288 tbn, 24 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc58.91.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc58.91.100 aac
[mp4 @ 0x34119c0] Starting second pass: moving the moov atom to the beginning of the file.46x
frame= 360 fps= 57 q=-1.0 Lsize= 5128kB time=00:00:15.00 bitrate=2800.6kbits/s speed= 2.4x
video:4910kB audio:206kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.225184%
[libx264 @ 0x340e680] frame I:6 Avg QP:24.93 size: 27753
[libx264 @ 0x340e680] frame P:203 Avg QP:25.50 size: 13056
[libx264 @ 0x340e680] frame B:151 Avg QP:29.45 size: 14641
[libx264 @ 0x340e680] consecutive B-frames: 41.7% 4.4% 8.3% 45.6%
[libx264 @ 0x340e680] mb I I16..4: 15.4% 22.3% 62.2%
[libx264 @ 0x340e680] mb P I16..4: 3.2% 6.1% 14.8% P16..4: 28.4% 15.5% 12.8% 0.0% 0.0% skip:19.2%
[libx264 @ 0x340e680] mb B I16..4: 3.4% 4.5% 18.0% B16..8: 25.5% 18.4% 8.0% direct: 8.4% skip:13.8% L0:36.0% L1:29.3% BI:34.7%
[libx264 @ 0x340e680] 8x8 transform intra:21.8% inter:36.4%
[libx264 @ 0x340e680] coded y,uvDC,uvAC intra: 79.8% 76.4% 48.3% inter: 37.0% 31.5% 6.7%
[libx264 @ 0x340e680] i16 v,h,dc,p: 33% 20% 20% 26%
[libx264 @ 0x340e680] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 20% 23% 5% 6% 4% 7% 4% 8%
[libx264 @ 0x340e680] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 33% 19% 14% 5% 6% 4% 7% 4% 6%
[libx264 @ 0x340e680] i8c dc,h,v,p: 47% 20% 22% 11%
[libx264 @ 0x340e680] Weighted P-Frames: Y:16.3% UV:15.3%
[libx264 @ 0x340e680] ref P L0: 66.7% 20.3% 9.3% 3.3% 0.4%
[libx264 @ 0x340e680] ref B L0: 93.6% 5.2% 1.2%
[libx264 @ 0x340e680] ref B L1: 98.3% 1.7%
[libx264 @ 0x340e680] kb/s:2681.41
[aac @ 0x3443cc0] Qavg: 9249.240

到此转码已经完成!
如果需要安装多个解码器参考下面文章:
https://blog.csdn.net/wmt1432/article/details/51998164
Linux下安装视频转换工具ffmpeg的更多相关文章
- Linux下安装MySQL管理工具MySQL Administrator和MySQL Query Browser(转载)
文章来源:http://blog.csdn.net/sunrier/article/details/7572299 Linux下MySQL Administrator和MySQL Query Brow ...
- Linux下 安装VMware Tools工具
Linux下需要安装VMware Tools工具 Linux下需要安装VMware Tools工具来实现主机和虚拟机直接文件复制粘贴功能,安装方法如下: ①点击虚拟机VM菜单栏--虚拟机--安装VMw ...
- 视频转换工具ffmpeg
安装ffmpeg ffmpeg官网下载地址点击此处. 如果使用mac也可用homebrew下载安装:brew install ffmpeg 使用ffmpeg 命令如下:ffmpeg -i input. ...
- Linux下安装nmap扫描工具
NMAP是一款流行的网络扫描和嗅探工具,被广泛应用在黑客领域做漏洞探测以及安全扫描,更多的nmap是一个好用的网络工具,在生产和开发中也经常用到,主要做端口开放性检测和局域网信息的查看收集等,不同Li ...
- linux下安装NPM管理工具
根据”挖一下“开发需要,选择nodejs实现异步IO,目的是为了解决服务器卡死导致无法处理后续的http请求.看了花瓣的架构视频讲座,才决定这么做的,挺有道理的. 安装nodejs很顺利,下载源码包, ...
- linux下安装jdk 详细步骤(一条命令即可安装)
转载:https://blog.csdn.net/luochangchen/article/details/72804426 作为Java开发人员,在Linux下安装一些开发工具是必备技能,本文以安装 ...
- Linux下安装jdk8步骤详述
作为Java开发人员,在Linux下安装一些开发工具是必备技能,本文以安装jdk为例,详细记录了每一步的操作命令,以供参考. 0.下载jdk8 登录网址:http://www.oracle.com/t ...
- Linux下安装jdk8步骤详述(转载)
Linux下安装jdk8步骤详述 原文地址:http://www.cnblogs.com/shihaiming/p/5809553.html 作为Java开发人员,在Linux下安装一些开发工具是必备 ...
- Linux下安装jdk8步骤
作为Java开发人员,在Linux下安装一些开发工具是必备技能,本文以安装jdk为例,详细记录了每一步的操作命令,以供参考. 下载jdk8 登录网址:http://www.oracle.com/tec ...
随机推荐
- tcp 客户端 synack的接收 以及 相互connect
接收入口 tcp_v4_rcv |--> tcp_v4_do_rcv |-> tcp_rcv_state_process ...
- windows10 vs2017编译opencv_contrib3.4.7的小坑及编译好的资源
1.注意要用正斜杠 / 不要用 \ https://github.com/opencv/opencv/issues/11655 CMake Error at cmake/OpenCVModu ...
- c++与c
const char* c_str ( ) const; Get C string equivalent Generates a null-terminated sequence of charact ...
- rpm命令介绍
rpm安装不能指定安装位置. 查看系统安装了哪些软件:rpm -qa rpm -qa |grep keyword (q:query a 是all) 查看软件是否安装: rpm -q ...
- 关于backfill参数建议
前言 在做一个比较满的集群的扩容的时候,遇到了一些问题,在这里做下总结,一般来说很难遇到,扩容要趁早,不然出的问题都是稀奇古怪的一些问题 建议 环境一般来说在70%左右就需要考虑扩容了,这个时候的扩容 ...
- Python 调用Get接口
import requests,jsonurl = 'http://localhost:30627/api/jobs/GetNuberId?id=2'req = requests.get(url)re ...
- yum 方式安装mysql (完整记录)
2016-04-07 学习笔记,源代码安装比较麻烦,还是要尝试一下yum安装和rpm方式安装 一.检查系统是否安装老版本,有的话干掉 #yum list installed | grep mysqlm ...
- tp5 删除图片以及文件
控制器调用 /** * [delimg 删除单张图片] * @return [type] [description] */ public function delimg(){ if (request( ...
- vector删除特定元素
删除vector中小于20的元素,注意要使迭代器失效,不能简单的删除. #include <iostream>#include <vector>using namespace ...
- 公司人员组织架构图用思维导图软件MindManager怎么做
有朋友一直不太明白组织架构图怎么做,其实组织架构图就是组织结构图.小编今天就在这里以一个公司为例,来给大家演示一番人员组织结构图怎么做. 老规矩,先说一下小编使用的软件跟电脑系统,这里用的是MindM ...