tanersener / react-native-ffmpeg

FFmpeg for react-native. Not maintained anymore. Superseded by FFmpegKit.
GNU General Public License v3.0
400 stars 51 forks source link

Cannot find a valid font for the family Sans #233

Closed m-tbox closed 3 years ago

m-tbox commented 3 years ago

Description I am trying to add text on image, currently I am working on Android and I have used following command

RNFFmpeg .execute(`-y -i ${input} -vf "drawtext=text='Hello World':fontcolor=white:fontsize=75:x=0:y=0" ${output}`);

but I get this error: Cannot find a valid font for the family Sans Error initializing filter 'drawtext' with args 'text=Hello World:fontcolor=white:fontsize=75:x=0:y=0'

I am not using any custom font but still get this error.

Expected behavior text should be added on image

Current behavior I get the following error:

Cannot find a valid font for the family Sans Error initializing filter 'drawtext' with args 'text=Hello World:fontcolor=white:fontsize=75:x=0:y=0'

Logs [Parsed_drawtext_0 @ 0x7f87a1ce40] Cannot find a valid font for the family Sans

index.js:115 [AVFilterGraph @ 0x7f6765e760] Error initializing filter 'drawtext' index.js:115 [AVFilterGraph @ 0x7f6765e760] with args 'text=Hello World:fontcolor=white:fontsize=75:x=0:y=0' index.js:115 [AVFilterGraph @ 0x7f6765e760]

index.js:115 Error reinitializing filters!

index.js:115 Failed to inject frame into filter network: No such file or directory

index.js:115 Error while processing the decoded data for stream #0:0

Environment

Other I also tried using a custom font but not able to do it. When I use RNFFmpegConfig.setFontDirectory('../../assets/fonts') function and with it the following code to add text on image RNFFmpeg .execute(-y -i ${input} -vf "drawtext=text='Hello World':fontfile='../../assets/fonts/MyFont.ttf':fontcolor=white:fontsize=75:x=0:y=0" ${output});

It gives me the same error.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.