Opened 4 years ago

Last modified 4 years ago

#8685 new defect

Subtitles inserted using mov_text codec fail to display properly in Quicktime 4.0.3

Reported by: Sofia Marino Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: mov_text
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Movies encoded in this manner will not display subtitles at all when played back in Quicktime Player on older Macintosh systems, despite displaying subtitles normally in VLC on a modern system.

An extracted subtitle file (using Quicktime Pro File->Export...) shows a mixture of invalid values (text size, width and height) and poor default values (text color) are being set by the muxer.

Expected behavior would be reasonable defaults (font size 10pt, foreground color #FFF, width equal to width of video, height equal to perhaps 20% of the video) which would result in subtitles that would render somewhat appropriately on older systems. Ideally the end user would also have the ability to change these parameters.

ffmpeg version:
ffmpeg version 4.2.2-1ubuntu1

Sample command line:
ffmpeg -i intro.mov -i intro.srt -c copy -c:s mov_text introsub.mov

Sample output from subtitle text export from Quicktime Pro 4.0.3:

{QTtext}{font:Chicago}{plain}{size:26228}{textColor: 24930, 1, 1}{backColor: 0, 0, 0}{timeScale:1000}{width:0}{height:0}{timeStamps:absolute}{language:32767}{textEncoding:0}
[00:00:00.000]
Captions Go Here
...

Attached to this ticket is a screenshot of the specific Quicktime export settings needed to obtain this output. I am also available to test changes to the defaults if necessary.

Attachments (3)

export settings.png (9.3 KB ) - added by Sofia Marino 4 years ago.
Export settings needed to obtain human-readable represetation of subtitles
introsub-gitmaster.qttext.txt (2.0 KB ) - added by Sofia Marino 4 years ago.
QTText representation of the subtitles displaying invalid values - taken from file muxed with git master
intro.srt (1.9 KB ) - added by Carl Eugen Hoyos 4 years ago.

Download all attachments as: .zip

Change History (17)

by Sofia Marino, 4 years ago

Attachment: export settings.png added

Export settings needed to obtain human-readable represetation of subtitles

comment:1 by Sofia Marino, 4 years ago

Looking at the file I'm working off of in a hex editor I have located where the invalid color and font size values are coming from. They start at position 0xDAF5B5 in this file.

All the values are big-endian 16-bit unsigned integers. In order it is font size, foreground red, foreground green, and foreground blue. The string "ftab" is written where the font size and red values are being read from, followed by the green and blue values.

I can email this video file to any developer interested in taking a further look at it - it is approx 14MB in size.

comment:2 by Carl Eugen Hoyos, 4 years ago

Keywords: mov_text added
Version: 4.2unspecified

Please test current FFmpeg git head and provide the ffmpeg command line you tested together with the complete, uncut console output and your input file to make this a valid ticket.

comment:3 by Sofia Marino, 4 years ago

Command line is in the original ticket, I'll work on getting the rest this week.

The input files are available upon request to be emailed to developers looking at this.

comment:4 by Carl Eugen Hoyos, 4 years ago

Please attach an input file here to make this a valid ticket.

in reply to:  4 comment:5 by Sofia Marino, 4 years ago

Replying to cehoyos:

Please attach an input file here to make this a valid ticket.

The file is 14MB in size, trac does not accept files above 2.5MB

It is available upon request unless the attachment size limit is lifted.

comment:6 by Carl Eugen Hoyos, 4 years ago

If the issue you see is not reproducible with the first 2MB of your subtitle file, please upload it to a filehoster of your choice (and post the link here) or https://streams.videolan.org/upload/

comment:7 by Sofia Marino, 4 years ago

The issue is with the muxed output, not the SRT, as quicktime-specific subtitle formatting options are not included in SRT files. Offset 0xDAF5B5 is past the first 2.5 MB of the resulting file, and would not be included in a truncated file.

I will upload the complete source files and the output to the link provided. Thank you.

comment:8 by Carl Eugen Hoyos, 4 years ago

Please try (hard) to avoid uploading anything but input files (no matter which format).

in reply to:  8 comment:9 by Sofia Marino, 4 years ago

Replying to cehoyos:

Please try (hard) to avoid uploading anything but input files (no matter which format).

Understood. The issue is entirely with the output but I will include only the inputs.

comment:10 by Sofia Marino, 4 years ago

Command line output from the git master build dated 2020-06-07 is as follows:

sofia-wsl@andromeda:/mnt/c/Users/sofia/Desktop/Virtual Sharefest CD-ROM/Disc 1 - Installer-Launcher/ffmpeg/ffmpeg-git-20200607-amd64-static$ ./ffmpeg -i ../../intro.mov -i ../../intro.srt -c copy -c:s mov_text ../../introsub-gitmaster.mov
ffmpeg version N-53084-gd29aaf12f4-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
  libavutil      56. 50.100 / 56. 50.100
  libavcodec     58. 90.100 / 58. 90.100
  libavformat    58. 44.100 / 58. 44.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 84.100 /  7. 84.100
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../../intro.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf56.40.101
  Duration: 00:01:21.77, start: 0.000000, bitrate: 1401 kb/s
    Stream #0:0(eng): Video: cinepak (cvid / 0x64697663), rgb24, 320x240, 1048 kb/s, 15 fps, 15 tbr, 15360 tbn, 15360 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 22050 Hz, mono, s16, 352 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #1, srt, from '../../intro.srt':
  Duration: N/A, bitrate: N/A
    Stream #1:0: Subtitle: subrip
Multiple -c, -codec, -acodec, -vcodec, -scodec or -dcodec options specified for stream 2, only the last option '-c:s mov_text' will be used.
Output #0, mov, to '../../introsub-gitmaster.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf58.44.100
    Stream #0:0(eng): Video: cinepak (cvid / 0x64697663), rgb24, 320x240, q=2-31, 1048 kb/s, 15 fps, 15 tbr, 15360 tbn, 15360 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 22050 Hz, mono, s16, 352 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:2: Subtitle: mov_text (text / 0x74786574)
    Metadata:
      encoder         : Lavc58.90.100 mov_text
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
  Stream #1:0 -> #0:2 (subrip (srt) -> mov_text (native))
Press [q] to stop, [?] for help
frame= 1226 fps=0.0 q=-1.0 Lsize=   14014kB time=00:01:21.74 bitrate=1404.4kbits/s speed=1.61e+03x
video:10462kB audio:3521kB subtitle:1kB other streams:0kB global headers:0kB muxing overhead: 0.211458%

The output is, in all relevant places, byte for byte identical to the output from 4.2, and the issue persists. It is still writing the ftab atom in the same spot where quicktime is looking for the subtitle formatting.

Last edited 4 years ago by Sofia Marino (previous) (diff)

in reply to:  10 ; comment:11 by Carl Eugen Hoyos, 4 years ago

Replying to smarino:

The output is byte for byte identical to the output from 4.2

This is absolutely impossible.

Anyway, where can I find the input file?

in reply to:  11 comment:12 by Sofia Marino, 4 years ago

Replying to cehoyos:

Replying to smarino:

The output is byte for byte identical to the output from 4.2

This is absolutely impossible.

Anyway, where can I find the input file?

The only diffs are the version number changes, there are no material changes to the structure of the file - I edited to clarify.

The input files were uploaded to the URL you provided.

by Sofia Marino, 4 years ago

QTText representation of the subtitles displaying invalid values - taken from file muxed with git master

comment:13 by Carl Eugen Hoyos, 4 years ago

Component: undeterminedavcodec
Version: unspecifiedgit-master

by Carl Eugen Hoyos, 4 years ago

Attachment: intro.srt added

comment:14 by Sofia Marino, 4 years ago

Please be aware that this issue occurs with all SRT files tested so far, not just the one attached to this ticket.

It appears to be related to this ticket which was closed as fixed after testing on OS X, but which noted that there were remaining issues with the default text formatting in quicktime movies on platforms that were not OS X.

https://trac.ffmpeg.org/ticket/1845#comment:31

Note: See TracTickets for help on using tickets.