Reputation: 53
I have been searching for the packages or any method for the particular problem, i googled but i didn't find any solution , So my issue is , i want functionality like ticktock App , user can select any music audio and they can play according to that user can do action, with sync of both audio and video i want output file as video. how can i achieve this , is there any method or any packages are avalibale in flutter . i have done selecting audio and video recording feature but i ma stuck with the merging both , if FFmpeg package we can use means , how to use that packages .. please explain me guys.
Upvotes: 5
Views: 3786
Reputation: 1141
In FFmpeg You can do it by playing the audio, recording video and then merging two files like
final FlutterFFmpeg _ffMpeg = FlutterFFmpeg();
_ffMpeg.execute("-i video.mp4 -i audio.mp4 -c copy output.mp4")
.then((return_code) => print("Return code $return_code"));
With FFmpeg You need to find the command that suits You the best.
But... Personally I think FFmpeg isn't a good choice:
What I suggest
You can record video and have audio file and video with Flutter. Then use platform specific code.
Even if you don't have experience in specific language I found those two libraries that could help:
iOS: https://github.com/dev-labs-bg/swift-video-generator (does exactly what You need).
Android: https://github.com/israel-fl/bitmap2video (I'm not sure if works with videos, but it accepts bitmaps)
Upvotes: 2