Record Duet Video like Tiktok/Smule in flutter

145

Solution 1

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]")

Solution 2

you can achive that with filter_complex hstack Example:

ffmpeg -i 1.mp4 -i 2.mp4 -filter_complex hstack duet.mp4
Share:
145
Mukund Jogi
Author by

Mukund Jogi

I am android developer for a product named VastraApp. Working on the product since 3 years. Hands on Kotlin, Android SDK, Jetpack Lib, MQTT, Sqlite, Java, Firebase, Room, MVVM architecture.

Updated on December 07, 2022

Comments

  • Mukund Jogi
    Mukund Jogi over 1 year

    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?