ffmpeg是一个开源的跨平台音视频处理工具,它可以对音视频进行格式转换、压缩、采集、裁剪、剪辑等操作。ffmpeg能够处理的音视频格式很多,包括常见的mp4、avi、mov等格式,也包括一些不那么常见的格式。
ffmpeg最初是由法国程序员Fabrice Bellard编写的,现在已经成为了流行的音视频处理工具。ffmpeg支持命令行操作,也可以通过API集成到其他应用程序中使用。因为经过多年的发展,ffmpeg的性能和稳定性都非常高,被广泛应用于音视频处理领域,例如视频编辑软件、转码工具、流媒体服务器等。
按照指定时间对音频进行拆分
public static void split(String firstFragmentPath,
String targetPath, String startTime, String continuousTime) {
try {
String command="ffmpeg -i "+firstFragmentPath+" -ss "+startTime+" -t "+continuousTime+" "+targetPath+" -y";
Runtime.getRuntime().exec(new String[]{"sh", "-c", command});
} catch (IOException e) {
e.printStackTrace();
}
}
音频拼接
public static Boolean concat(String concatFilePath,String destFile){
try {
final String command = String.format("ff

最低0.47元/天 解锁文章
4636

被折叠的 条评论
为什么被折叠?



