[FFmpeg-trac] #9103(undetermined:new): srt subtitles fails to be read if numbering not present

FFmpeg trac at avcodec.org
Fri Feb 12 12:09:15 EET 2021


#9103: srt subtitles fails to be read if numbering not present
-------------------------------------+-------------------------------------
             Reporter:  artofit      |                     Type:
                                     |  enhancement
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  git-
  undetermined                       |  master
             Keywords:  ffplay       |               Blocked By:
  ffmpeg subtitles                   |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:


 How to reproduce:

 In the same folder:

 1/ Take some video: VIDEO.mkv

 2/ Create a srt text file (utf8) SUBTITLES.srt as such:


 {{{
 00:00:03,000 --> 00:00:04,000
 Some subtitle 1

 00:00:05,000 --> 00:00:06,000
 another one

 00:00:10,000 --> 00:00:12,000
 last one

 }}}


 ffplay -vf subtitles=filename="SUBTITLES.srt" "VIDEO.mkv"

 When you watch you do no see subtitles, this is because the srt files does
 not contain the expected numbering before the timecodes.

 ffplay is not tolerant on this lacking, while VLC or Mplayer render the
 expected result, as time codes are well formated.

 PROPOSED FIX:
 https://en.wikipedia.org/wiki/SubRip#File_format

 ffplay ought to auto-increment a counter at each new line time code as it
 iterates on reading the subtitles file.


 Additionaly the raised error does not pinpoint to the potential issue:
 Unable to open 2014-07-30_demo.srt
 Error initializing filter 'subtitles' with args
 'filename=2014-07-30_demo.srt'


 Thanks for improving this to allow to render the subtitles.


 Below such a case execution example:

 ffplay -vf subtitles=filename="2014-07-30_demo.srt" "2014-07-30_demo.mp4"
 ffplay version n4.3.1 Copyright (c) 2003-2020 the FFmpeg developers
   built with gcc 10.2.0 (GCC)
   configuration: --prefix=/usr --disable-debug --disable-static --disable-
 stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto
 --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-
 ladspa --enable-libaom --enable-libass --enable-libbluray --enable-
 libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi
 --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx
 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb
 --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-
 libpulse --enable-librav1e --enable-libsoxr --enable-libspeex --enable-
 libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-
 libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-
 libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2
 --enable-libxvid --enable-nvdec --enable-nvenc --enable-shared --enable-
 version3
   libavutil      56. 51.100 / 56. 51.100
   libavcodec     58. 91.100 / 58. 91.100
   libavformat    58. 45.100 / 58. 45.100
   libavdevice    58. 10.100 / 58. 10.100
   libavfilter     7. 85.100 /  7. 85.100
   libswscale      5.  7.100 /  5.  7.100
   libswresample   3.  7.100 /  3.  7.100
   libpostproc    55.  7.100 / 55.  7.100
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2014-07-30_demo.mp4':0/0
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     genre           : Dance Bachata
     title           : 20140730_demo
     encoder         : Lavf55.50.100
   Duration: 00:03:34.67, start: 0.000000, bitrate: 1062 kb/s
     Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
 1080x762, 956 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
     Metadata:
       handler_name    : VideoHandler
     Stream #0:1(eng): Audio: mp3 (mp4a / 0x6134706D), 32000 Hz, mono,
 fltp, 100 kb/s (default)
     Metadata:
       handler_name    : SoundHandler
 [Parsed_subtitles_0 @ 0x7f0798156a00] Shaper: FriBidi 1.0.10 (SIMPLE)
 HarfBuzz-ng 2.7.4 (COMPLEX)
 [Parsed_subtitles_0 @ 0x7f0798156a00] Unable to open 2014-07-30_demo.srt
 Error initializing filter 'subtitles' with args
 'filename=2014-07-30_demo.srt'




 ffmpeg version
 built on ...
 }}}
 Patches should be submitted to the ffmpeg-devel mailing list and not this
 bug tracker.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/9103>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list