【发布时间】:2019-09-18 03:09:48
【问题描述】:
在 Windows 上,我可以使用 ffmpeg.exe 使用以下代码剪切视频
无法在 android 中使用 ffmpeg。 我使用 gradle 在我的应用中抓取 ffmpeg。
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.github.hiteshsondhi88.libffmpeg:FFmpegAndroid:0.2.5'
}
我的方法中有这些行
VideoIn = getInternalDirectoryPath() + "/Download/Ab.mp4";
VideoOut = getInternalDirectoryPath() + "/Download/Ab1.mp4";
try {
ffmpeg.execute("ffmpeg -i " + VideoIn + " -ss 00:00:03 -c:v libx264 -crf 17 -t 00:00:5 " + VideoOut + " -y",null);
}
catch (FFmpegCommandAlreadyRunningException e) {
e.printStackTrace();
}
显示此错误:运行 exec() 时出错。命令:[/data/data/com.videoeditor.myname.myapp/files/ffmpeg,ffmpeg,-i,/storage/emulated/0/Download/Ab.mp4,-ss,00:00:03,-c: v, libx264, -crf, 17, -t, 00:00:5, /storage/emulated/0/Download/Ab1.mp4, -y] 工作目录:null 环境:null
这种方法有什么问题?感谢您的帮助
【问题讨论】: