Opened 12 months ago

Last modified 11 months ago

#6947 new defect

Unwanted visual formatting added when embedding subtitles

Reported by: forthrin Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

When playing an MP4 file with embedded subtitles in VLC, the subtitles are shown as specified by the user in VLC's subtitle preferences, but *not* "Font colour" and "Opacity".

After discussing this with the VLC team, it may seem like FFmpeg secretly applies font colour and opacity when embedding the subtitles.

$ cat a.srt
1
00:00:00,000 --> 00:10:00,000
The quick brown fox jumps
over the lazy dog.

$ ffmpeg -i a.mp4 -i a.srt -vcodec copy -scodec mov_text b.mp4
$ ffmpeg -i b.mp4 b.srt

$ cat b.srt
1
00:00:00,000 --> 00:09:56,459
<font face="Serif" size="18">The quick brown fox jumps
over the lazy dog.</font>

According to this, FFmpeg applies "Font face" and "Font size", but not "Font colour" and "Opacity". Strange...

Anyway, unless the tx3g/mov_text format *requires* visual formatting, it seems most correct that a plain text subtitle is embedded *as-is*, eg. without any applied formatting, leaving all formatting to the video player.

Please give insight how the subtitle embedding works, and how to embed subtitles without visual formatting.

ffmpeg 3.4.1 (macOS/Homebrew)

Change History (2)

comment:1 Changed 12 months ago by cehoyos

Is the issue not reproducible with current FFmpeg git head?

comment:2 Changed 11 months ago by forthrin

The exact same thing happens with this version.

git clone git://source.ffmpeg.org/ffmpeg
./configure
make
./ffmpeg
ffmpeg version N-89763-gd38a223943 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
./ffmpeg -i a.mp4 -i a.srt -vcodec copy -scodec mov_text b.mp4
./ffmpeg -i b.mp4 b.srt
cat b.srt
1
00:00:00,000 --> 00:09:56,459
<font face="Serif" size="18">The quick brown fox jumps
over the lazy dog.</font>
Note: See TracTickets for help on using tickets.