[FFmpeg-trac] #11135(avcodec:new): Text outline becomes stretched depending on video aspect ratio when converting SRT to ASS subtitles
FFmpeg
trac at avcodec.org
Mon Aug 12 11:36:37 EEST 2024
#11135: Text outline becomes stretched depending on video aspect ratio when
converting SRT to ASS subtitles
---------------------------------+---------------------------------------
Reporter: omgold | Type: defect
Status: new | Priority: normal
Component: avcodec | Version: unspecified
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
---------------------------------+---------------------------------------
Summary of the bug:
When burning SRT subtitles with the subtitles filter into a video, the
outline/border (not the text itself) becomes stretched according to the
aspect ratio of the video.
I tracked the problem down to a rather odd behavior of ass, where the
outline width in x/y directions are scaled with PlayResX/PlayResY
parameters.
If these are set to values match the video aspect ratio, it works fine.
But apparently ffmpeg does not do that when converting SRT to ASS (which
it does before burning the subtitle into the images with the subtitles
filter).
The problem appears both when using the filter and also when keeping the
subtitle as a separate track (converted to ASS), but not with a separate
track keeping it in SRT format. (With an embedded separate ASS track the
stretching is visible with a player that uses libass, like mpv, but not
with vlc).
It can be worked around by converting the SRT to an ASS file with ffmpeg,
then edit the PlayResX/PlayResY by hand and using the fixed ASS for
desired operation with ffmpeg.
Note, though, that the issue propagates into higher-level video editing
software like kdenlive, which use SRT internally and do not give the user
to ability to apply such a workaround.
How to reproduce:
{{{
% ffmpeg -report -i untitled.mp4 -i test.srt -vcodec copy -scodec copy
test-srt.mkv
% ffmpeg -report -i untitled.mp4 -i test.srt -vcodec copy -scodec ass
test-ass.mkv
% ffmpeg -i untitled.mp4 -filter subtitles=filename=test.srt test-
embedded.mkv
ffmpeg version 7.0.1
built on Arch Linux
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11135>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list