arthenica / ffmpeg-kit

FFmpeg Kit for applications. Supports Android, Flutter, iOS, Linux, macOS, React Native and tvOS. Supersedes MobileFFmpeg, flutter_ffmpeg and react-native-ffmpeg.
https://arthenica.github.io/ffmpeg-kit
GNU Lesser General Public License v3.0
4.29k stars 579 forks source link

drawtext filter not found #770

Closed himanshudeveloper closed 9 months ago

himanshudeveloper commented 1 year ago

Description A clear and concise description of what the bug is.

Expected behavior What you expected to happen.

Current behavior What happened.

To Reproduce Steps to reproduce the behaviour.

Screenshots If applicable, add screenshots to help explain your problem.

Logs Post logs here or paste them to Ghostbin and insert the link here.

Environment

Other Add any other context about the problem here.

TheMelody commented 1 year ago

Please give the smallest available example

himanshudeveloper commented 1 year ago

[AVFilterGraph @ 0xab401f80] No such filter: 'drawtext' Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while processing the decoded data for stream #0:0 [aac @ 0xaabc8d00] Qavg: 3434.781 [aac @ 0xaabc8d00] 2 frames left in the queue on closing Conversion failed!

Dhawan7 commented 1 year ago

[AVFilterGraph @ 0x6e36d7dbd0] No such filter: '“drawtext' Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while processing the decoded data for stream #0:0 Conversion failed!

mathieu-aubin commented 1 year ago

That's not an example, show your command.

mathieu-aubin commented 1 year ago

https://ffmpeg.org/ffmpeg-filters.html#drawtext-1

To enable compilation of this filter, you need to configure FFmpeg with --enable-libfreetype. To enable default font fallback and the font option you need to configure FFmpeg with --enable-libfontconfig. To enable the text_shaping option, you need to configure FFmpeg with --enable-libfribidi.

rajyuva1000 commented 11 months ago

i am also facing same issue

LOG [AVFilterGraph @ 0xb4ad7700] No such filter: 'drawtext' LOG Error reinitializing filters! LOG Failed to inject frame into filter network: Invalid argument LOG Error while processing the decoded data for stream #0:0 LOG Conversion failed!

my code is:

const addTextOverlay = async (inputVideoPath: any, outputVideoPath: string, text: string, x: number, y: number, fontSize: number, fontColor: string) => { try {

  const escapedText = text.replace(/"/g, '\\"'); // Escape double quotes in the text
  const ffmpegCommand = `-i "${inputVideoPath}" -vf drawtext=text="${escapedText}":x=${x}:y=${y}:fontsize=${fontSize}:fontcolor=${fontColor} -codec:a copy -y "${outputVideoPath}"`;

  // const ffmpegCommand =  `-i ${inputVideoPath} -vf "drawtext=text='My text starting at 640x360':x=640:y=360:fontsize=24:fontcolor=white" -c:a copy ${outputVideoPath}`
  const result = await FFmpegKit.executeAsync(ffmpegCommand);
  console.log(outputVideoPath, 'outputVideoPath');

  return outputVideoPath;
} catch (error) {
  console.error('Error adding text overlay:', error);
  throw error;
}

}; anyone help one this.

tanersener commented 11 months ago

To enable compilation of this filter, you need to configure FFmpeg with --enable-libfreetype. To enable default font fallback and the font option you need to configure FFmpeg with --enable-libfontconfig. To enable the text_shaping option, you need to configure FFmpeg with --enable-libfribidi.

This message from @mathieu-aubin explains which libraries are needed for drawtext. Make sure you use an ffmpeg-kit package that includes those libraries.

github-actions[bot] commented 9 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 9 months ago

This issue was closed because it has been stalled for 7 days with no activity.