Search code examples
iosflutterdartffmpegvideo-processing

Flutter ffmpeg_kit_flutter not able to DrawText over video


I am Trying to overlay text over the Video using ffmpeg dependency. i have tried many options, but my most recent commands are as follows,

await FFmpegKit.execute(
        '-i $path -vf "drawtext="fontfile=TiktokFont.ttf:text=\'Stack Overflow\':fontcolor=white:fontsize=24:box=1:[email protected]:boxborderw=5:x=(w-text_w)/2:y=(h-text_h)/2"" -codec:a copy  "$outputPath"')

My pubspec Dependency:

ffmpeg_kit_flutter: ^4.5.1

But the result is always like this.

Error : No such filter: 'drawtext'

Solutions Tried:

  • Changed the Font.tff
  • Set Font in the configuration file for ffmpeg
  • changed the command, removed the box
  • replaced -vf with -filter_complex

All of them give me same result as follows screenshot. [Logs]

enter image description here


Solution

  • ffmpeg_kit_flutter installs the https package by default. Try using the full package instead.

    dependencies:
      ffmpeg_kit_flutter_full: ^4.5.1
    

    You can see all the available packages here and detailed installation instructions here.