FFMPEG命令记录

2019-12-18 23:26:00

1、拼接两个音频

方法1:

ffmpeg -i "concat:1.mp3|2.mp3" -c copy 4.mp3

如果是android调用命令的话,不需要双引号:ffmpeg -i concat:1.mp3|2.mp3 -c copy 4.mp3

方法2:

ffmpeg -f concat -i file.txt -c copy output.wav

file.txt文本的内容:

file '1.mp3'
file '2.mp3'

2、剪切音频片段

ffmpeg -ss 00:01:00 -t 00:00:30 -i huangwu.mp3 2.mp3

3、多个音频混音

两个:

ffmpeg -i 1.mp3 -i 2.mp3 -filter_complex amix=inputs=2:duration=first:dropout_transition=2  12.mp3

三个:

ffmpeg -i 1.mp3 -i 2.mp3 -i 3.mp3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3  123.mp3

4、剪切一段MP4并转换成gif

ffmpeg -ss 0 -t 4 -i menu.mp4 -s 360*640 -f gif -r 1 bb.gif

5、改变音量大小

ffmpeg -i input.wav -af volume=-3dB output.wav

6、音频淡入淡出

博客:http://www.mamicode.com/info-detail-1208970.html

ffmpeg -i 12.mp3 -filter afade=t=in:ss=5:d=3 tttt111t.wav //从5秒开始淡入3秒,淡入开始前都是最低音量

ffmpeg -i 12.mp3 -filter afade=t=out:st=5.3:d=5 danchu.mp3//5.3秒开始淡出5秒,淡出后面变成静音,无论是否已经完成

6、音频格式处理

ffmpeg -i 13.aac -filter aformat=sample_fmts=s16 -filter aresample=44100 8888.mp3//强制16位  44100

其他常用命令

http://www.cnblogs.com/wainiwann/p/4128154.html


  • 2020-02-19 23:08:56

    Laravel 用户认证 Auth(精华)

    很多应用是需要登陆后才能操作,Laravel 提供了一个 auth 工具来实现用户的认证功能。并且有一个 config/auth.php 来配置 auth 工具。大概看一下 auth 工具的常用方法

  • 2020-02-19 23:12:44

    Laravel 从 $request 到 $response 的过程解析二(必读)

    laravel 的请求会组装成 $request 对象,然后会依次经过中间件(前置部分),最终到达 url 指向的控制器方法,然后把返回数据组装为 $response 对象返回,再依次经过中间件 (后置部分),最终返回。

  • 2020-02-19 23:15:24

    PHP 闭包(Closure)

    闭包(Closure)又叫做匿名函数,也就是没有定义名字的函数。比如下面的例子:

  • 2020-02-19 23:26:58

    php array_pop 删除数组最后一个元素实例

    php array_pop函数将数组最后一个单元弹出(出栈),即删除数组的最后一个元素。本文章通过php实例向大家讲解array_pop函数的使用方法。