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-12-18 17:15:29

    coTurn stun服务器搭建,禁用turn

    https://github.com/coturn/coturn 在这里git clone 下来然后编译安装,一切默认即可。编译后,也可以不用安装。在编译目录下bin文件夹下有turnserver turnutils_stunclient turnutils_uclient 这三个等一下会用到的软件。

  • 2020-12-18 17:26:25

    coturn配置文件详细解释

    Coturn 是webrtc,p2p视频通话必不少的,主要包含2个主要功能stun服务, turn服务 Coturn 的githup地址为 https://github.com/coturn/coturn/

  • 2020-12-21 06:26:16

    为UIView添加点击事件

    最近经常碰到要将UIImageView和UILabel看成整体的情况,我于是就将他俩用UIView包起来,那么怎么给一个UIView添加点击事件,可以这么实现:

  • 2020-12-21 09:00:20

    Window.matchMedia() 方法详解

    matchMedia() 返回一个新的 MediaQueryList 对象,表示指定的媒体查询字符串解析后的结果。 matchMedia() 方法的值可以是任何一个 CSS @media 规则 的特性, 如 min-height, min-width, orientation 等。 MediaQueryList 对象有以下两个属性:

  • 2020-12-21 09:42:42

    iframe.contentWindow 操作iframe

    注:iframe.contentWindow这里,返回的是iframe的window对象,所以后面可以接着调用document方法,再接着调用getElementByTagName。那么就可以对iframe里面的元素进行操作了。

  • 2020-12-21 14:00:19

    iframe + postMessage跨域通信

    在实际项目开发中可能会碰到在 a.com 页面中嵌套 b.com 页面,这时第一反应是使用 iframe,但是产品又提出在 a.com 中操作,b.com 中进行显示,或者相反。