ffmpegwasm / ffmpegwasm/ffmpeg.wasm

How to pass fontfile to drawtext?

Open
#163 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
17.8k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
How could you add fontfile to drawtext?
Tried
```
import BOLDFONT from './OpenSans-Bold.woff'
// OR
const BOLDFONT = './OpenSans-Bold.woff'

drawtext='
fontfile=${BOLDFONT}:
text=My text:
fontcolor=white:
fontsize=16:
x=60:
y=(h-th)/2',
```
Throws Error:
```
[fferr] [Parsed_drawtext_1 @ 0x1a38d40] Could not load font "/_nuxt/fonts/OpenSans-Bold.woff": cannot open resource
log.js?908e:15 [fferr] [AVFilterGraph @ 0x1a387c0] Error initializing filter 'drawtext' with args '
log.js?908e:15 [fferr] fontfile=/_nuxt/fonts/OpenSans-Bold.woff:
log.js?908e:15 [fferr] text=My text:
log.js?908e:15 [fferr] fontcolor=white:
log.js?908e:15 [fferr] fontsize=16:
log.js?908e:15 [fferr] x=60:
log.js?908e:15 [fferr] y=(h-th)/2'
log.js?908e:15 [fferr] Error initializing complex filters.
log.js?908e:15 [fferr] Invalid argument
log.js?908e:15 [ffout] FFMPEG_END
```

Please help!

Note: App running on NUXT.js

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.