[FFmpeg-trac] #9808(undetermined:new): Curly brace characters in WebVTT subtitle files not encoded correctly

FFmpeg trac at avcodec.org
Thu Jun 9 20:17:42 EEST 2022


#9808: Curly brace characters in WebVTT subtitle files not encoded correctly
-------------------------------------+-------------------------------------
             Reporter:  Gavin        |                     Type:  defect
  Llewellyn                          |
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 I am trying to add subtitles from a VTT file to an MP4 video. However,
 where the VTT file has a pair of curly braces, I only see a backslash
 character in the MP4 when played back with QuickTime Player.

 I can see the same issue when using ffmpeg to convert a VTT file to an SRT
 file.

 How to reproduce:
 {{{
 % ./ffmpeg -i curly_braces.vtt output.srt
 ffmpeg version N-107064-g7adeeff91f-tessus Copyright (c) 2000-2022 the
 FFmpeg developers
   built with Apple clang version 11.0.0 (clang-1100.0.33.17)
   configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-
 version=tessus --enable-avisynth --enable-fontconfig --enable-gpl
 --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d
 --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-
 libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-
 libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-
 libopus --enable-librubberband --enable-libshine --enable-libsnappy
 --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame
 --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-
 libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-
 libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq
 --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-
 ffplay
   libavutil      57. 26.100 / 57. 26.100
   libavcodec     59. 33.100 / 59. 33.100
   libavformat    59. 24.100 / 59. 24.100
   libavdevice    59.  6.100 / 59.  6.100
   libavfilter     8. 40.100 /  8. 40.100
   libswscale      6.  6.100 /  6.  6.100
   libswresample   4.  6.100 /  4.  6.100
   libpostproc    56.  5.100 / 56.  5.100
 Input #0, webvtt, from 'curly_braces.vtt':
   Duration: N/A, bitrate: N/A
   Stream #0:0: Subtitle: webvtt
 Output #0, srt, to 'output.srt':
   Metadata:
     encoder         : Lavf59.24.100
   Stream #0:0: Subtitle: subrip
     Metadata:
       encoder         : Lavc59.33.100 srt
 Stream mapping:
   Stream #0:0 -> #0:0 (webvtt (native) -> subrip (srt))
 Press [q] to stop, [?] for help
 size=       0kB time=00:00:03.00 bitrate=   0.3kbits/s speed=4.44e+03x
 video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: 2040.000000%
 }}}

 The input file:
 {{{
 $ cat curly_braces.vtt
 WEBVTT

 1
 00:00:01.000 --> 00:00:06.000
 {

 2
 00:00:02.000 --> 00:00:07.000
 }

 3
 00:00:03.000 --> 00:00:08.000
 {}

 }}}

 The output file:
 {{{
 $ cat output.srt
 1
 00:00:01,000 --> 00:00:06,000
 \{

 2
 00:00:02,000 --> 00:00:07,000
 \}

 3
 00:00:03,000 --> 00:00:08,000
 \

 }}}

 Note that these characters do not need to be escaped in the VTT file from
 what I can see from the WebVTT spec: https://www.w3.org/TR/webvtt1
 /#webvtt-cue-text-span
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9808>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list