fluttervideoffmpegvideo-processingvideo-recording

Record Duet Video like Tiktok/Smule in flutter


I am a newbie in Flutter. I am working on applications like Instagram/TikTok in which I am stuck with one issue that is Duet Video

I have created Video Recording functionality using Img.ly SDK.

I am also using FFmpeg library to give my own audio file to recorded video. But now I want to create functionality of Duet Video same as TikTok.

Anyone can suggest a way to do it in Flutter?


Solution

  • I did achieve it using:

    final filter =
            " [0:v]scale=480:640,setsar=1[l];[1:v]scale=480:640,setsar=1[r];[l][r]hstack;[0][1]amix -vsync 0 ";
    
    FlutterFFmpeg().execute(" -y -i " +
                    "[YOUR_LEFT_VIDEO_FILE_PATH]" +
                    " -i " +
                    "[YOUR_RIGHT_VIDEO_FILE_PATH]" +
                    " -filter_complex" +
                    filter +
                   "[YOUR_OUTPUT_VIDEO_FILE_PATH]")