I am using ffmpeg executeAsyncWithArguments to overlay a single image into a video from start to end, the filterParams I used do work as you can see in the logs. However, it seems that the execution of the command is stuck after the overlaying process, sort of hanging and no logs is happening there after. Btw I used the sample code in pub.dev documentation and non of the print statement is being printed. Can anyone shed light on this? Will really appreciate your help, same with the code, I am stuck on how to proceed. Thanks in advance.
//printed filterParams
filterParams: [
-i, video_clip.mp4,
-i, image.png,
- filter_complex,
[1:v]scale=1920:1080[img];
[0:v][img]overlay=W-w-10:H-h-10[out]
-map, [out],
-c:a, copy,
-y, output_video.mp4]
The two execute commands (async and sync).
final FlutterFFmpeg _flutterFFmpeg = FlutterFFmpeg();
_flutterFFmpeg.executeAsyncWithArguments(filterParams,
(CompletedFFmpegExecution execution) {
print("executionID: ${execution.executionId} exited with rc
${ execution.returnCode}");
}).then((executionId) => print("Async FFmpeg process started with
executionId $executionId."));
//result from async command, the logs end empty
I/flutter (29780): Async FFmpeg process started with executionId 3001.
........
I/mobile-ffmpeg(29780): frame= 129 fps= 31 q=31.0 size= 1024kB time=00:00:04.32 bitrate=1940.3kbits/s dup=1 drop=0 speed=1.03x
I/mobile-ffmpeg(29780): frame= 135 fps= 31 q=31.0 Lsize= 1294kB time=00:00:04.52 bitrate=2341.8kbits/s dup=1 drop=0 speed=1.03x
I/mobile-ffmpeg(29780): video:1292kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead:
I/mobile-ffmpeg(29780): 0.110388%
I/mobile-ffmpeg(29780):
I tried to run the same filterParams using _ffmpeg.executeWithArguments(filterParams) and it runs fine. The logs ended with FFmpeg exited with rc: 0
FlutterFFmpeg _flutterFFmpeg = new FlutterFFmpeg();
_flutterFFmpeg.executeWithArguments(filterParams);
//using flutter_ffmpeg executeWithArguments(filterParams)
I/mobile-ffmpeg( 2199): frame= 89 fps= 30 q=31.0 Lsize= 784kB time=00:00:02.97 bitrate=2159.4kbits/s dup=2 drop=0 speed=1.02x
I/mobile-ffmpeg( 2199): video:782kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead:
I/mobile-ffmpeg( 2199): 0.155912%
I/mobile-ffmpeg( 2199):
D/flutter-ffmpeg( 2199): FFmpeg exited with rc: 0
My ultimate goal for this project, is to use the async method because the video I am planning to overlay varies from 5sec to 1 minute. I wish to utilize the async to free up the UI.