I'm using the latest version of WritingMinds/ffmpeg-android-java library.
I've tried single/double quoting the path with no success.
I Logged my command after execution, please look to the input path where a subDirectory contains whiteSpace, a comma has been added between the space:
ffmpeg, -i, "storage/emulated/0/Telegram/Telegram, Video/4_5828137322067002802.mp4", -vf...
I split and run my command like this:
String crop = "-ss " + skipTimeForCrop + " -noautorotate -i " + newPath + " -vframes 10 -vf cropdetect=24:16:0 -f null -";
String[] cropCommand = crop.trim().split(" ");
execFFmpegForCrop(cropCommand);
storage/emulated/0/Telegram/Telegram: No such file or directory
Any idea on this?
Because you use command
String[] cropCommand = crop.trim().split(" ");
This will cut the file name contains whitespace " " and the input file will be failtry to use double backslashes before the space:
"storage/emulated/0/Telegram/Telegram,\\ Video/4_5828137322067002802.mp4"
I believe adding commands as
List
and then converting it to array will solve this problem,This way the commas should only add to the end of every single commands. I'll show you how:
And this will be the output:
first replace whitespace of filepath with some creepy string, then while running ffmpeg.execute() replace that creepy string with space.
like: