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


  • 2019-10-14 21:18:57

    Comparable 的 使用

    要做这个呢,我们也是用到了Arrays.sort 这个排序的方法!但不同的是,我们之前用的是int数组,现在我们用的是这个UserBean数组。如果你想对这个UserBean数组进行排序,你要多做一件事,就是让这个 UserBean类去 实现Comparable 的接口,并重写 里面  comparaTo 的方法。注意,这个接口是可以提供泛型的 ———————————————— 版权声明:本文为CSDN博主「sdn_bt496」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明

  • 2019-10-15 05:53:20

    xUtils 里的DbUtils使用心得

    使用xUtils做Android数据库开发非常简便和得心应手,而且它本身还支持很多查询功能,比如一对多,select count和自定义sql查询等,并且支持事务(默认关闭) 下面是官方sample给的代码和我的一些使用心得 首先是两个实体类,对应两张表,这两张表中有一对多的关系

  • 2019-10-15 09:18:48

    腾讯 Android 面试笔试总结

    Activity中的几种启动模式 Android消息机制 IntentService 事件分发 Android性能优化、内存优化 内存优化 View的绘制 Eventbus原理 Rxjava的操作符有哪些,说说他们的作用 线程锁 锁方法和类对象啥的有啥区别 AsyncTask原理 说说MVP和MVVM的特点 Android中用到的观察者模式有哪些地方 说说google新出的Lifecycle框架 okhttp原理 Retrofit原理 RecyclerView源码、缓存分析 Binder机制 Android Jetpack Kotlin Activity中的几种启动模式

  • 2019-10-15 09:20:49

    SpringBoot注解梳理

    @SpringBootApplication:包含了@ComponentScan、@Configuration和@EnableAutoConfiguration注解。其中@ComponentScan让spring Boot扫描到Configuration类并把它加入到程序上下文。 @Configuration 等同于spring的XML配置文件;使用Java代码可以检查类型安全。 @EnableAutoConfiguration 自动配置。 @ComponentScan 组件扫描,可自动发现和装配一些Bean。 @Component可配合CommandLineRunner使用,在程序启动后执行一些基础任务。 @RestController注解是@Controller和@ResponseBody的合集,表示这是个控制器bean,并且是将函数的返回值直 接填入HTTP响应体中,是REST风格的控制器。 @Autowired自动导入。 @PathVariable获取参数。 @JsonBackReference解决嵌套外链问题。 @RepositoryRestResourcepublic配合spring-boot-starter-data-rest使用。