How to fix ffmpeg & mencoder by clicking Persian (RTL) subtitles canceled?

I am trying to create an application for recording subtitles on video. The specific task is to record Persian (right to left) subtitles. But I have a problem with that. When I get several words at the same time without any "Enter" between them, ffmpeg or mencoder press the lines up. for example, if I have three lines, the third lines are displayed on the first line, then the second line, and then the first line is displayed. I have attached two screenshots to clarify this. As you can see in the second, there are 9 lines of Persian subtitles that should be aligned from 1 above to 9 at the bottom, but the 9th line appears in the first line at the top.

enter image description here

enter image description here

I am using this code at the moment to record subtitles on mp4 video:

mencoder video.mp4 -sub subtitle.srt -utf8  -o output.mp4 -oac pcm -ovc lavc
+4

All Articles