Bug 504129 - Subject: Incorrect Text Rendering for Hindi/Devanagari Subtitles in Kdenlive (Character Reordering Issue)
Summary: Subject: Incorrect Text Rendering for Hindi/Devanagari Subtitles in Kdenlive ...
Status: CONFIRMED
Alias: None
Product: kdenlive
Classification: Applications
Component: Title Clips & Subtitles (other bugs)
Version First Reported In: 25.04.1
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-13 03:15 UTC by Viker41751
Modified: 2025-05-21 16:28 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
This is the .srt file which imported as a subtitle in Kdenlive, but not visible correctly in Project Monitor. (9.18 KB, application/octet-stream)
2025-05-13 03:15 UTC, Viker41751
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Viker41751 2025-05-13 03:15:13 UTC
Created attachment 181231 [details]
This is the .srt file which imported as a subtitle in Kdenlive, but not visible correctly in Project Monitor.

Description:
When using Hindi (Devanagari script) subtitles in Kdenlive, certain words are rendered with incorrect character order, despite selecting a Devanagari-compatible font and writing system. For example:

Correct Word: जिसने → Rendered as जसिने

Correct Word: कोशिश → Rendered as कोशशि

The same .srt file works perfectly in other video editors like Shotcut, DaVinci Resolve, and Premiere Pro, indicating the issue is specific to Kdenlive’s subtitle rendering engine.

Steps to Reproduce:

Create an .srt file with Hindi text (UTF-8 encoding).

In Kdenlive, import the subtitle and open the Subtitle Style Editor.

Select a Devanagari font (e.g., Aparajita, Baloo, Hind, Kokila, Mangal, Nirmala UI, Sanskrit Text, Utsaah, etc .) and set Writing System to "Devanagari".

Observe incorrect character order in the preview/timeline.

Expected Result:
Text should render correctly, matching the original .srt file.

Actual Result:
Characters are reordered incorrectly, breaking word formation.

Environment:

Kdenlive Version: [Version 25.04.1]

Operating System: [Windows 11 Pro Version 24H2]

Fonts Tested: [Aparajita, Baloo, Hind, Kokila, Mangal, Nirmala UI, Sanskrit Text, Utsaah, etc .]

Qt Status: [Qt: Using 6.8.3 and built against 6.8.3]

KDE Frameworks Status: [6.13.0]

MLT Status: [7.32.0]

Additional Notes:

The issue persists even after reinstalling Kdenlive.

Workarounds like using pre-rendered subtitles (images) temporarily fix the problem but are not ideal.
Comment 1 Ron 2025-05-21 16:13:12 UTC
Ok, this is an interesting one.  It would be nice to have a minimal subtitle file with *only* some examples of text
that is rendered wrongly, for those of us who don't read Devanagari and can't immediately see what is wrong.

The first text I could spot that looked off was this one:
00:00:02,850 --> 00:00:03,150
किरणें

We we convert, apparently correctly, to:
Dialogue: 0,00:00:02.84,00:00:03.14,Default,,0,0,0,,किरणें

before passing it to MLT for rendering.

It looks ok in the subtitle editor widget text box, and looks ok rendered in vlc,
but for some reason, somewhere in the pipeline after we pass it to MLT, the
'f'  ि  (for want of better knowledge how to type that glyph part), which seems to
be a 'combining character', gets combined one character to the right, which
seems to be what's shown in the OP examples.

It seems vim struggles a little with this too, moving the combining part around
when the cursor is on that character.

So this would seem to not be an issue with anything we're doing in kdenlive,
but is an issue in the rendering pipeline on the other side of what we pass to
MLT.  And I guess the next interesting question is whether it is somehow
specific to the particular codepoints in use here, or if it happens with other
combining characters too.
Comment 2 Ron 2025-05-21 16:22:17 UTC
And this is not specific to windows, I'm seeing it in both the 25.04.1 appimage, and my bleeding edge dev tree.