'Flutter ffmpeg_kit_flutter: get FFmpegKit.executeAsync error
I have prepared a test program to run FFMPEG command and it successfully run -i "/data/user/0/com.example.test/cache/file_picker/test.mp4" -c:v mpeg4 "/data/user/0/com.example.test/cache/test-1639310478143.mp4"
command. This is just to ensure that ffmpeg_kit_flutter was loaded properly and all permissions has been obtained.
But, I have problem executing -i "source.mp4" -vf fps=30 "thumb%03d.jpg" -hide_banner
command. The command itself is working well when I run it on windows, for example:
md frame1
ffmpeg -i "test.mp4" -vf fps=30 frame1/thumb%%04d.jpg -hide_banner
(note: double % is to escape the % in windows batch file)
This is what I do in flutter on android:
- Create temporary folder.
- Execute:
String command = '-i "/data/user/0/com.example.test/cache/file_picker/test.mp4" -vf fps=30 "/data/user/0/com.example.test/cache/tmp-1639309602536/thumb%03d.jpg" -hide_banner';
FFmpegKit.executeAsync(command, (session) async {
final returnCode = await session.getReturnCode();
if (ReturnCode.isSuccess(returnCode)) {
//ok
} else if (ReturnCode.isCancel(returnCode)) {
//cancelled
} else {
//error
}
});
The proses is not working (always going to the error part). My questions are:
- What is the difference between running that command on windows and android? Why it works on windows but not working on android?
- How can I get the explanation about any FFMPEG error? In my case, I only know that wasn't working, but I have no clue why.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|