#9669(avfilter:new): Subtitles video filter does not correctly rotate/position some Japanese punctuation characters in vertical ASS subtitles
#9669: Subtitles video filter does not correctly rotate/position some Japanese punctuation characters in vertical ASS subtitles ----------------------------------+-------------------------------------- Reporter: y3kcjd5 | Type: defect Status: new | Priority: normal Component: avfilter | Version: git-master Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ----------------------------------+-------------------------------------- Certain Japanese punctuation characters have to be oriented a certain way for vertical display of subtitles to look correct. The "subtitles" video filter gets it wrong with some characters. I'm attaching some demo files to demonstrate the characters I've found, but there are probably more I've missed. How to reproduce: Run a command such as {{{ ffmpeg -i "5-sec-blank.mp4" -map 0:0 -report -loglevel verbose -map_chapters -1 -map_metadata -1 -vsync "passthrough" -aspect 16:9 -c:v libx264 -movflags faststart -preset slower -x264-params partitions=all:ref=6:me=umh:subme=10:merange=64:trellis=2:fast- pskip=0:bframes=6:b_adapt=2:direct=auto:rc_lookahead=60:crf=20:qcomp=0.80:qpmax=30:qpstep=4 -sws_flags spline+full_chroma_int+full_chroma_inp+accurate_rnd -filter:v subtitles="misrotationdemosubs.ass":original_size=1920x1080:alpha=1,format=yuv420p "subtitlehardcode.mp4" }}} and observe the orientation of the characters hardcoded into the video, then either open the .ass file directly with subtitling software such as Aegisub, or run something like {{{ ffmpeg -i "5-sec-blank.mp4" -i "misrotationdemosubs.ass" -map 0:0 -map 1:0 -c copy subtitlesoftcode.mkv }}} and play the resulting file in a media player with ASS subtitle support (mine uses DirectVobSub). I am running ffmpeg-2022-02-28-git-7a4840a8ca-full_build from gyan.dev in a Windows environment. If you can't get your hands on the "MS UI Gothic" font, just text edit the entry in the .ass file to something on your system (but keep the '@' mark at the beginning that denotes vertical orientation). -- Ticket URL: <https://trac.ffmpeg.org/ticket/9669> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9669: Subtitles video filter does not correctly rotate/position some Japanese punctuation characters in vertical ASS subtitles ------------------------------------+------------------------------------ Reporter: y3kcjd5 | Owner: (none) Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Changes (by y3kcjd5): * Attachment "misrotationdemosubs.ass" added. .ass subtitle file demonstrating vertical Japanese subtitles -- Ticket URL: <https://trac.ffmpeg.org/ticket/9669> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9669: Subtitles video filter does not correctly rotate/position some Japanese punctuation characters in vertical ASS subtitles ------------------------------------+------------------------------------ Reporter: y3kcjd5 | Owner: (none) Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Changes (by y3kcjd5): * Attachment "5-sec-blank.mp4" added. A blank 1920x1080 video to use as a template -- Ticket URL: <https://trac.ffmpeg.org/ticket/9669> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9669: Subtitles video filter does not correctly rotate/position some Japanese punctuation characters in vertical ASS subtitles ------------------------------------+------------------------------------ Reporter: y3kcjd5 | Owner: (none) Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Changes (by y3kcjd5): * Attachment "verticalhardsubsbad.png" added. What happens when the "subtitles" filter hardcodes the subtitles -- Ticket URL: <https://trac.ffmpeg.org/ticket/9669> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9669: Subtitles video filter does not correctly rotate/position some Japanese punctuation characters in vertical ASS subtitles ------------------------------------+------------------------------------ Reporter: y3kcjd5 | Owner: (none) Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Changes (by y3kcjd5): * Attachment "verticalsoftsubsgood.png" added. What subtitles should look like (through DirectVobSub) -- Ticket URL: <https://trac.ffmpeg.org/ticket/9669> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9669: Subtitles video filter does not correctly rotate/position some Japanese punctuation characters in vertical ASS subtitles ------------------------------------+------------------------------------ Reporter: y3kcjd5 | Owner: (none) Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by Elon Musk): Please check with mpv player. If it does not display correctly that it is not ffmpeg issue but libass issue which ffmpeg use. Unable to reproduce due to missing font. -- Ticket URL: <https://trac.ffmpeg.org/ticket/9669#comment:1> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9669: Subtitles video filter does not correctly rotate/position some Japanese punctuation characters in vertical ASS subtitles ------------------------------------+------------------------------------ Reporter: y3kcjd5 | Owner: (none) Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by y3kcjd5): I'm runnign into trouble getting mpv player set up. Did you try changing the font in the .ass file to a font you do have as I described above? Alternatively, does the "ass" video filter also use libass? Running the first command with that filter instead gives more broken but more correctly rotated results, so if they share libass, that's not the problem. -- Ticket URL: <https://trac.ffmpeg.org/ticket/9669#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9669: Subtitles video filter does not correctly rotate/position some Japanese punctuation characters in vertical ASS subtitles ------------------------------------+------------------------------------ Reporter: y3kcjd5 | Owner: (none) Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by Elon Musk): Yea report bug to libass project. -- Ticket URL: <https://trac.ffmpeg.org/ticket/9669#comment:3> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9669: Subtitles video filter does not correctly rotate/position some Japanese punctuation characters in vertical ASS subtitles ------------------------------------+------------------------------------ Reporter: y3kcjd5 | Owner: (none) Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by y3kcjd5): Replying to [comment:3 Elon Musk]:
Yea report bug to libass project. Uh, what? The subtitles filter broke rotation. That's not libass. -- Ticket URL: <https://trac.ffmpeg.org/ticket/9669#comment:4> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9669: Subtitles video filter does not correctly rotate/position some Japanese punctuation characters in vertical ASS subtitles ------------------------------------+------------------------------------ Reporter: y3kcjd5 | Owner: (none) Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by Elon Musk): subtitle filter code use same logic for drawing subtitles like ass filter. -- Ticket URL: <https://trac.ffmpeg.org/ticket/9669#comment:5> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9669: Subtitles video filter does not correctly rotate/position some Japanese punctuation characters in vertical ASS subtitles ------------------------------------+------------------------------------ Reporter: y3kcjd5 | Owner: (none) Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by y3kcjd5): Replying to [comment:5 Elon Musk]:
subtitle filter code use same logic for drawing subtitles like ass filter. Apparently not, because the results look different. The one thing the ass filter (and mpv player) mostly got right is the rotation. -- Ticket URL: <https://trac.ffmpeg.org/ticket/9669#comment:6> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9669: Subtitles video filter does not correctly rotate/position some Japanese punctuation characters in vertical ASS subtitles ------------------------------------+------------------------------------ Reporter: y3kcjd5 | Owner: (none) Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Changes (by y3kcjd5): * Attachment "asscode.png" added. What happens when the ass filter (libass) hardcodes the subs -- Ticket URL: <https://trac.ffmpeg.org/ticket/9669> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9669: Subtitles video filter does not correctly rotate/position some Japanese punctuation characters in vertical ASS subtitles ------------------------------------+------------------------------------ Reporter: y3kcjd5 | Owner: (none) Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by Elon Musk): Replying to [comment:6 y3kcjd5]:
Replying to [comment:5 Elon Musk]:
subtitle filter code use same logic for drawing subtitles like ass filter. Apparently not, because the results look different. The one thing the ass filter (and mpv player) mostly got right is the rotation.
Look at source code, your statement is contradiction with reality. Anyway it is highly unlikely, definitely impossible this will ever get fixed here and not in libass. -- Ticket URL: <https://trac.ffmpeg.org/ticket/9669#comment:7> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
Look at source code, your statement is contradiction with reality. I don't see how you can call it a contradiction with reality when I've
#9669: Subtitles video filter does not correctly rotate/position some Japanese punctuation characters in vertical ASS subtitles ------------------------------------+------------------------------------ Reporter: y3kcjd5 | Owner: (none) Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by y3kcjd5): Replying to [comment:7 Elon Musk]: posted screenshots demonstrating the discrepancies. Have you at least tried changing the font and running the commands yourself? -- Ticket URL: <https://trac.ffmpeg.org/ticket/9669#comment:8> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9669: Subtitles video filter does not correctly rotate/position some Japanese punctuation characters in vertical ASS subtitles ------------------------------------+------------------------------------ Reporter: y3kcjd5 | Owner: (none) Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by y3kcjd5): I've finally figured out why the "subtitles" and "ass" filters were returning different results, despite both using libass for rendering; it turns out that the "subtitles" filter only uses the "simple" renderer in libass for some reason (and there's no option to change it). The "ass" filter can be forced to reproduce the same output by including "shaping=simple" in its options (the default is "auto"). I've already reported the underlying spacing/positioning issues on the libass github, so this ticket has effectively boiled down to changing the "subtitles" filter to use libass's "auto" rendering setting like the "ass" filter does by default. -- Ticket URL: <https://trac.ffmpeg.org/ticket/9669#comment:9> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg