ubuntu14.04下安装ffmpeg
ubuntu14.04下安装ffmpeg
一、安装各种依赖包
1、yasm(libx264需要依赖yasm)
sudo apt-get install yasm
2、libx264
sudo apt-get install libx264-dev
3、libfaac
sudo apt-get install libfaac-dev
4、libmp3lame
sudo apt-get install libmp3lame-dev
5、libtheora
sudo apt-get install libtheora-dev
6、libvorbis
sudo apt-get install libvorbis-dev
7、libxvid
sudo apt-get install libxvidcore-dev
8、libxext
sudo apt-get install libxext-dev
9、libxfixes
sudo apt-get install libxfixes-dev
二、下载FFmpeg安装包
官网下载最新版本的FFmpeg配置的时候不成功,最终使用的是FFmpeg 2.4.13 "Fresnel",下载网址:http://www.ffmpeg.org/olddownload.html
1、解压
tar -xjvf ffmpeg-2.4.13.tar.bz2
2、配置
cd ffmpeg-2.4.13/
./configure --prefix=/usr/local/ffmpeg --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab --enable-libvorbis
3、编译安装
sudo make
sudo make install
4、将ffmpeg-2.4.13文件夹下生成的ffmpeg可执行文件拷贝到/usr/bin/目录下
sudo cp ffmpeg /usr/bin/
三、运行
运行格式:ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}
1.如要将yuv文件转换为png,则
ffmpeg -pix_fmt nv12 -s 1280x720 -i srcPic.yuv -y desPic.png
2.如果将.mp4文件转换为.h264文件
ffmpeg -i aa.mp4 -codec copy -bsf: h264_mp4toannexb -f h264 bb.264
说明:
-i aa.mp4 :是输入的MP4文件
-codec copy:从MP4封装中进行拷贝
-bsf: h264_mp4toannexb:从MP4拷贝到annexB封装
-f h264:采用h.264格式
bb.264:输出的文件名称
3.调整视频大小(resize)是改变视频的宽度和高度。
使用-s参数实现,语法:ffmpeg -i input_file -s wxh output_file (wxh是宽x高,比如320x240)
eg:格式转换并且缩放
ffmpeg -i input.mpg -s 320x240 output.mp4
ffmpeg -i input.mpg -vf scale=320:240 output.mp4
4.裁剪:
eg:ffmpeg -i intput.avi -vf crop=iw/2:ih/2 output.avi
需要指定裁剪时长,使用 -t 参数,比如 -t 10 表示只裁剪10秒钟
参考:
https://blog.csdn.net/leezha/article/details/77849286
https://www.cnblogs.com/yongfengnice/p/7095846.html
ubuntu14.04下安装ffmpeg的更多相关文章
- Ubuntu14.04下安装Hadoop2.5.1 (单机模式)
本文地址:http://www.cnblogs.com/archimedes/p/hadoop-standalone-mode.html,转载请注明源地址. 欢迎关注我的个人博客:www.wuyudo ...
- 二、Ubuntu14.04下安装Hadoop2.4.0 (伪分布模式)
在Ubuntu14.04下安装Hadoop2.4.0 (单机模式)基础上配置 一.配置core-site.xml /usr/local/hadoop/etc/hadoop/core-site.xml ...
- Ubuntu14.04下安装Flash Player
Ubuntu14.04下安装Flash Player youhaidong@youhaidong:~$ sudo apt-get install flashplugin-nonfree [sudo] ...
- Ubuntu14.04下 安装p4c
参考: Github p4c README Ubuntu14.04下 安装p4c 这里提供一个直接安装p4c的脚本:install_p4c.sh. 1.git clone下来p4c: $ git cl ...
- Ubuntu14.04下安装Libsvm,并使用Libsvm
(1)Ubuntu14.04下安装Libsvm 转载:https://blog.csdn.net/katrinawj/article/details/78915874 一.下载: 网址:http:// ...
- ubuntu14.04下安装cudnn5.1.3,opencv3.0,编译caffe及配置matlab和python接口过程记录
已有条件: ubuntu14.04+cuda7.5+anaconda2(即python2.7)+matlabR2014a 上述已经装好了,开始搭建caffe环境. 1. 装cudnn5.1.3,参照: ...
- 在Ubuntu14.04下安装Docker CE(1) - repository篇
从2017年3月开始,Docker开始分为社区版本和企业版,也就是Docker CE和Docker EE, 原来Ubuntu14.04下,通过sudo apt-get install docker.i ...
- ubuntu14.04下安装爬虫工具scrapy
scrapy是目前准备要学习的爬虫框架,其在ubuntu14.04下的安装过程如下: ubuntu14.04下默认安装了2.7的python以及setuptools,若未安装,可通过下面指令安装: s ...
- ubuntu14.04 下安装有道词典
安装步骤 1.ubuntu14.04.1版本下是不能直接安装有道词典的,首先需要把14.04.版升级为14.04.2版. 在终端窗口中输入以下命令: sudo apt-get update sudo ...
随机推荐
- 12月7日,几个错误,拼写错误,遗漏符号:,记忆有误,max-width的作用。gem mini_magick, simple_form
❌: 1. /Users/chentianwei/jdstore3/jdstore/config/routes.rb:6:in `block in <top (required)>': u ...
- Python基础--数据类型
一.数据类型是什么鬼? 计算机顾名思义就是可以做数学计算的机器,因此,计算机程序理所当然地可以处理各种数值.但是,计算机能处理的远不止数值,还可以处理文本.图形.音频.视频.网页等各种各样的数据,不同 ...
- python-day7--%s与%d的使用,python2中的input及raw_input
#coding:utf-8 #utf-8格式打开#%s %d# name='egon'# age=18# print('my name is',name)# print('my name is my ...
- 秒杀多线程第七篇 经典线程同步 互斥量Mutex
本文转载于:http://blog.csdn.net/morewindows/article/details/7470936 前面介绍了关键段CS.事件Event在经典线程同步问题中的使用.本篇介绍用 ...
- 使用SAE(VAE)检测信用卡欺诈——感觉误报率还是比较高啊 70%+误报 蛋疼
from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScale ...
- 最新的ES 5.0路由算法底层实现
http://www.cnblogs.com/bonelee/p/6078947.html 里分析了ES bulk实现,其中路由代码: ShardId shardId = clusterService ...
- spring cloud学习(三)使用Ribbon实现客户端负载均衡
使用Ribbon实现客户端的负载均衡 * 个人博客空间 : https://zggdczfr.cn/ * Ribbon Spring Cloud Netflix Ribbon 是一个客户端负载均衡的组 ...
- ubuntu下安装go语言;sublime+gocode搭建;go的卸载和环境变量配个人.bashrc;2空位3个网
https://blog.csdn.net/needkane/article/details/36891949 https://www.jianshu.com/p/4f79ae4f081c http: ...
- 根据id来实现小程序tab切换,
本例根据绑定id来实现tab切换,但本例仍有缺陷,用for循环数据,无法实现切换.如有大神能够有更好方法,欢迎留言更正 WXML: <view class="tab"> ...
- stringBuild置空方法
参看连接:http://blog.csdn.net/roserose0002/article/details/6972391