使用ffmpeg.exe进行转码参数说明
使用ffmpeg.exe进行转码参数说明
摘自:https://blog.csdn.net/coloriy/article/details/47337641
本文主要介绍如何使用ffmpeg.exe进行转码。编译好的ffmpeg可以从下面目录下载:
http://ffmpeg.org/download.html
首先,可以使用-formats命令,查看ffmpeg支持的封装格式。
下面截取一段:(D、E分别表示解复用和复用)
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
File formats: D. = Demuxing supported .E = Muxing supported -- E 3g2 3GP2 (3GPP2 file format) E 3gp 3GP (3GPP file format) D 4xm 4X Technologies E a64 a64 - video for Commodore 64 D aac raw ADTS AAC (Advanced Audio Coding) DE ac3 raw AC-3 D act ACT Voice file format D adf Artworx Data Format D adp ADP E adts ADTS AAC (Advanced Audio Coding) DE adx CRI ADX D aea MD STUDIO audio D afc AFC DE aiff Audio IFF DE alaw PCM A-law D alias_pix Alias/Wavefront PIX image DE amr 3GPP AMR D anm Deluxe Paint Animation D apc CRYO APC D ape Monkey's Audio D apng Animated Portable Network Graphics D aqtitle AQTitle subtitles DE asf ASF (Advanced / Active Streaming Format) E asf_stream ASF (Advanced / Active Streaming Format) DE ass SSA (SubStation Alpha) subtitle DE ast AST (Audio Stream) |
可以使用-codecs命令,查看ffmpeg支持的编解码器,
ffmpeg输出格式如下:(D、E表示的解码器、编码器)
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
Codecs: D..... = Decoding supported .E.... = Encoding supported ..V... = Video codec ..A... = Audio codec ..S... = Subtitle codec ...I.. = Intra frame-only codec ....L. = Lossy compression .....S = Lossless compression ------- D.VI.. 012v Uncompressed 4:2:2 10-bit D.V.L. 4xm 4X Movie D.VI.S 8bps QuickTime 8BPS video .EVIL. a64_multi Multicolor charset for Commodore 64 (encoders: a64multi ) .EVIL. a64_multi5 Multicolor charset for Commodore 64, extended with 5th color (colram) (encoders: a64multi5 ) D.V..S aasc Autodesk RLE D.VIL. aic Apple Intermediate Codec DEVI.S alias_pix Alias/Wavefront PIX image DEVIL. amv AMV Video D.V.L. anm Deluxe Paint Animation D.V.L. ansi ASCII/ANSI art D.V..S apng APNG (Animated Portable Network Graphics) image DEVIL. asv1 ASUS V1 DEVIL. asv2 ASUS V2 D.VIL. aura Auravision AURA D.VIL. aura2 Auravision Aura 2 D.V... avrn Avid AVI Codec DEVI.. avrp Avid 1:1 10-bit RGB Packer D.V.L. avs AVS (Audio Video Standard) video DEVI.. avui Avid Meridien Uncompressed DEVI.. ayuv Uncompressed packed MS 4:4:4:4 |
ffmpeg命令通常格式如下:
ffmpeg -i xxx out_file
常用的转换格式命令如下:
1. mpeg audio转pcm原始数据
ffmpeg -i cctv2_4101.mpa -f s16le -ar 48000 -acodec pcm_s16le cctv2-4101-Normal.pcm
2. jpg转yuv
jpeg -> yuv420
ffmpeg.exe -i input_file.jpg -pix_fmt yuv420p -y output_file.yuv -v 0
yuv -> jpeg
将大小为720x576的input_file.yuv原始数据另存为jpg格式
ffmpeg.exe -y -s 720x576 -i input_file.yuv -vcodec mjpeg output_file.jpg
3. 不同封装格式转换
3gp to avi
ffmpeg -i source.3gp -f avi -vcodec xvid -acodec mp3 -ar
22050 destination.avi
flv to 3gp
ffmpeg -i source.flv -s 176×144 -vcodec h263 -r 25 -b 200
-ab 64 -acodec mp3 -ac 1 -ar 8000 destination.3gp
flv to mp4
ffmpeg -i source.flv -vcodec h264 -r 25 -b 200 -ab 128
-acodec mp3 -ac 2 -ar 44100 destination.mp3
avi to mp4
ffmpeg -i source.avi -f psp -r 29.97 -b 768k -ar 24000 -ab
64k -s 320×240 destination.mp4
mp4 to 3gp
ffmpeg -i source.mp4 -s 176×144 -vcodec h263 -r 25 -b 12200
-ab 12200 -ac 1 -ar 8000 destination.3gp
avi to 3gp
ffmpeg -i source.avi-s qcif -vcodec h263 -acodec mp3 -ac 1
-ar 8000 -r 25 -ab 32 -y destination.3gp
mpg to 3gp
ffmpeg -i source.mpg -s qcif -vcodec h263 -acodec mp3 -ac 1
-ar 8000 -ab 32 -y destination.3gp
4. yuv转h264 raw/TS
ffmpeg.exe -s 352x288 -pix_fmt yuv420p -i test_352x288.yuv -vcodec libx264 out.h264
(若输出文件改为out.ts,即可实现yuv转ts)
以下简单总结下ffmpeg命令参数:
-i 指定要转换视频的源文件
-s 视频转换后视频的分辨率
-vcodec 视频转换时使用的编解码器(-codecs)
-r 视频转换换的桢率(默认25桢每秒)
-b 视频转换换的bit率
-ab 音频转换后的bit率(默认64k)
-acodec 制度音频使用的编码器(-codecs)
-ac 制定转换后音频的声道
-ar 音频转换后的采样率
使用ffmpeg.exe进行转码参数说明的更多相关文章
- .net 使用ffmpeg.exe进行音频转码
#region 音频转换 private int AudioIntervalTime = 100, iAudio = 0; private string strPath = "D:\\web ...
- 编译:ffmpeg,精简ffmpeg.exe
网上下载的各种 ffmpeg.exe ,最少都有11M+ 而我只需要处理 mp4 和 mp3,在网上搜索了一下精简ffmpeg的文章,折腾一天,也没有完全搞定,但多少有些收获,记录一下: 从 www. ...
- C# 使用 ffmpeg 进行音频转码
先放一下 ffmpeg 的官方文档以及下载地址: 官方文档:http://ffmpeg.org/ffmpeg.html 下载地址:http://ffmpeg.org/download.html 用 f ...
- Java Web 中使用ffmpeg实现视频转码、视频截图
Java Web 中使用ffmpeg实现视频转码.视频截图 转载自:[ http://www.cnblogs.com/dennisit/archive/2013/02/16/2913287.html ...
- C++调用ffmpeg.exe提取视频帧
有时候,我们获得一段视频,需要将其中的每一帧都提取出来,来进行一些相关的处理,这时候我们就可以需要用到ffmpeg.exe来进行视频帧的提取. ffmpeg简介:FFmpeg是一套可以用来记录.转换数 ...
- ffmpeg.exe dos下怎么用 放在哪里
系统:windows 7 1.先看dos界面,win7下这里输入cmd, 看路径 2.把下载的ffmpeg.exe复制到这个路径下 3.这就可以用命令了 1.mp4说明这个文件是跟ffmpeg.ex ...
- C# 使用ffmpeg.exe进行音频转换完整demo-asp.net转换代码
C# 使用ffmpeg.exe进行音频转换完整demo-asp.net转换代码 上一篇说了在winform下进行调用cmd.exe执行ffmpeg.exe进行音频转换完整demo.后来我又需要移植这个 ...
- [原]通过配合ffmpeg.exe获取视频文件时长
import subprocess import os import time def getTime(flvpath,fid): #file_str = '1.flv' file_str = flv ...
- C# 使用ffmpeg.exe进行音频转换完整demo
今天在处理微信的开发接口时候,发现微信多媒体上传接口中返回的音频格式是amr.坑人的是现在大部分的web 播放器,不支持amr的格式播放.试了很多方法都不行. 没办法,只要找一个妥协的解决方案:将am ...
随机推荐
- K-means: 多次random initialization来避免bad局部最优
K-means algorithm initialize K-means算法中有一步为随机初始化cluster centroids,这步如何进行,我们将介绍一种运行比较好的方法,这种方法比其它初始化的 ...
- VS - Paginated
BootstrapPagination.cshtml @model PaginationModel <div class="pagination"> <ul> ...
- 2019/12/5BJFirstDay--scrum后台+cpp项目前台环境跑起来!!!
1.配置服务器: 2.进入cd C:\java\25.beijing\06.vuejs\cpp201911221829\cpp 3.运行的命令是:npm run dev 4.先启动 5.然后再启动cp ...
- 数据库(以MySQL为例)
一.数据库简介 数据库就是数据的仓库,用来按照特定的结构去组织和管理数据,有了数据库可以更加方便.便捷的操作需要保存的数据 不管是什么数据库,最终都是将数据保存到硬盘中,只是存储的格式不同于文本文件 ...
- 10分钟手把手教你运用Python实现简单的人脸识别
欲直接下载代码文件,关注我们的公众号哦!查看历史消息即可! 前言:让我的电脑认识我 我的电脑只有认识我,才配称之为我的电脑! 今天,我们用Python实现高大上的人脸识别技术! Python里,简单的 ...
- 时间模块-datetime精确到微妙级
1.标准转换格式符号说明 %a 本地星期的短名称 如:Sun, Mon, ..., Sat (en_US); So, Mo, ..., Sa (de_DE) %A 本地星期全名称 如 :Sunday, ...
- eclipse快捷键及设置【转】
1.Eclipse设置新建菜单初始项 windows-->Perspective-->Customize Perspective--> 2.Eclipse快捷键 1. ctrl+sh ...
- TCP粘包拆包问题分析及应对方案
粘包拆包问题是处于网络比较底层的问题,在数据链路层.网络层以及传输层都有可能发生.我们日常的网络应用开发大都在传输层进行,由于UDP有消息保护边界,不会发生粘包拆包问题,因此粘包拆包问题只发生在TCP ...
- html5中time元素详解
html5中time元素详解 一.总结 一句话总结: time的使用的话主要是将时间放在datetime属性里面:<time datetime="2015-10-22"> ...
- ArcGIS Python人门到精通目录基于ArcGIS10.2,100以上案例15章42个视频806分钟,51GIS网站上线
ArcGIS Python人门到精通目录 闫老师 QQ:276529800 微信13108507190 1. ArcGIS Python基础 1.1 ArcGIS为什么学习Python 1.2 A ...