ffmpegwasm / ffmpegwasm/ffmpeg.wasm

No such filter: 'Fontsize', 'Fontcolor'

Open
#808 1 comment 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

Error: [AVFilterGraph @ 0x61b14c0] No such filter: 'Fontsize'

Can someone help me, When I take out Font Size and Color, subtitle shows but basic.

```
"dependencies": {
"@ffmpeg/core": "^0.12.8",
"@ffmpeg/ffmpeg": "^0.12.13",
"@ffmpeg/util": "^0.12.1",
"face-api.js": "^0.22.2",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},

//Load
const baseURL = "https://unpkg.com/@ffmpeg/core-mt@0.12.6/dist/esm";
await ffmpeg.load({
coreURL: await toBlobURL(`${baseURL}/ffmpeg-core.js`, "text/javascript"),
wasmURL: await toBlobURL(
`${baseURL}/ffmpeg-core.wasm`,
"application/wasm"
),
workerURL: await toBlobURL(
`${baseURL}/ffmpeg-core.worker.js`,
"text/javascript"
),
});

const font_name = "arial";
const primary_colour = "&H8ffffff";
const font_size = "48";

// Execute subtitle
await ffmpeg.exec([
"-i",
"input", // input video
"-i",
subtitleFile,
"-vf",
`subtitles=${subtitleFile}:fontsdir=/tmp:force_style="Fontname=${font_name},Fontsize=${font_size},Fontcolor=${primary_colour}"`,
"-c:v",
"libx264", // video codec
"-c:s",
"mov_text", // subtitle codec
"-preset",
"ultrafast", // encoding speed
"output.mp4", // output video
]);
```

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.