我正在使用最新版本的writingMinds/ffmpeg-android-java库。
我尝试过单/双引用路径但没有成功。
我在执行后记录了我的命令,请查看子目录包含空格的输入路径,空格之间添加了逗号:
ffmpeg, -i, "storage/emulated/0/Telegram/Telegram, Video/4_5828137322067002802.mp4", -vf...
Run Code Online (Sandbox Code Playgroud)
我像这样分割并运行我的命令:
String crop = "-ss " + skipTimeForCrop + " -noautorotate -i " + newPath + " -vframes 10 -vf cropdetect=24:16:0 -f null -";
String[] cropCommand = crop.trim().split(" ");
execFFmpegForCrop(cropCommand);
Run Code Online (Sandbox Code Playgroud)
storage/emulated/0/Telegram/Telegram:没有这样的文件或目录
对此有什么想法吗?
我相信添加命令 asList然后将其转换为数组可以解决这个问题,
这样逗号只能添加到每个命令的末尾。我将向您展示如何:
List<String> commandList = new LinkedList<>();
commandList.add("-ss");
commandList.add("00:00:00");
commandList.add("-noautorotate");
commandList.add("-i");
commandList.add("storage/emulated/0/Telegram/Telegram Video/4_5828137322067002802.mp4");
commandList.add("-vframes");
commandList.add("10");
commandList.add("-vf");
commandList.add("-cropdetect=24:16:0");
.
.
.
String[] cropCommand = commandList.toArray(new String[commandList.size()]);
execFFmpegForCrop(cropCommand);
Run Code Online (Sandbox Code Playgroud)
这将是输出:
"[-ss, 00:00:00, -noautorotate, -i, storage/emulated/0/Telegram/Telegram Video/4_5828137322067002802.mp4, -vframes, 10, -vf, -cropdetect=24:16:0, ...]";
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2087 次 |
| 最近记录: |