Skip to content

Conversation

@touchao123
Copy link

When attempting to add Chinese subtitles to videos using the /v1/video/caption endpoint, I've discovered that specifying "font_family": "HarmonyOS Sans SC" within the JSON request results in the subtitles failing to render.
Two issues are present:

  1. parameter transmission,
  2. the download of captions is failing to utilize the correct encoding, leading to libass being unable to parse them and consequently falling back to Arial.ttf.
  3. This patch rectifies these issues.

@HarrisonFisher
Copy link
Collaborator

@touchao123 The other changes you made, besides changing the encoding, do not appear to be needed

@touchao123 touchao123 force-pushed the fix/caption-handle-cn-fonts branch 2 times, most recently from b6b1a94 to 800dc78 Compare September 4, 2025 01:46
@touchao123 touchao123 force-pushed the fix/caption-handle-cn-fonts branch from 800dc78 to 93cb0ed Compare September 4, 2025 01:46
@touchao123
Copy link
Author

@touchao123 The other changes you made, besides changing the encoding, do not appear to be needed
Correct, I've removed unnecessary lines. In the meantime, the practical running logs are attached here:

[Parsed_subtitles_0 @ 0x7336400024c0] Using font provider fontconfig
[Parsed_subtitles_0 @ 0x7336400024c0] fontselect: (HarmonyOS Sans SC, 400, 0) -> /usr/share/fonts/custom/HarmonyOS_Sans_SC_Regular.ttf, 0, HarmonyOS_Sans_SC
[libx264 @ 0x6246205bbb80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants