Opened 2 years ago

Closed 19 months ago

#5056 closed defect (fixed)

Empty cues when converting ASS embedded in MKV to SRT

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

Description

For some files, extracting ASS subtitles as SRT fails. All timestamps are in the output, but the text is empty.

I’ve tracked this down to the [Events] section and Format: line not being part of the extradata / subtitle_header. Looking at the specs at http://www.matroska.org/technical/specs/subtitles/ssa.html these lines don’t have to be part of the CodecPrivate? element in an MKV, so I expect that’s what’s going on.

% ffmpeg -i sample.mkv -t 150 -f srt pipe:1
ffmpeg version N-76978-gfb1bf44 Copyright (c) 2000-2015 the FFmpeg developers
  built with Apple LLVM version 7.0.0 (clang-700.1.76)
  configuration: --prefix=/Users/eelco/Projects/Beamer/FFmpeg/build
  libavutil      55.  9.100 / 55.  9.100
  libavcodec     57. 16.101 / 57. 16.101
  libavformat    57. 19.100 / 57. 19.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 18.100 /  6. 18.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
Input #0, matroska,webm, from 'sample.mkv':
  Metadata:
    ENCODER         : Lavf57.19.100
  Duration: 00:55:57.79, bitrate: 0 kb/s
    Stream #0:0(eng): Subtitle: ass (default)
    Metadata:
      ENCODER         : Lavc57.16.101 ass
      DURATION        : 00:55:57.790000000
Output #0, srt, to 'pipe:1':
  Metadata:
    encoder         : Lavf57.19.100
    Stream #0:0(eng): Subtitle: subrip (srt) (default)
    Metadata:
      DURATION        : 00:55:57.790000000
      encoder         : Lavc57.16.101 srt
Stream mapping:
  Stream #0:0 -> #0:0 (ass (native) -> subrip (srt))
Press [q] to stop, [?] for help
1
00:01:28,948 --> 00:01:30,578


2
00:01:31,743 --> 00:01:33,953


3
00:02:16,496 --> 00:02:18,536


4
00:02:19,499 --> 00:02:21,209


5
00:02:22,710 --> 00:02:24,830


size=       0kB time=00:02:22.71 bitrate=   0.0kbits/s    
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

Attachments (1)

sample.mkv (41.1 KB) - added by eelco 2 years ago.

Download all attachments as: .zip

Change History (4)

Changed 2 years ago by eelco

comment:1 Changed 2 years ago by eelco

I managed to work around this issue by making sure that in ff_ass_split_dialog if ctx->current_section is not the "Events" section, to adjust ctx->current_section and also set ctx->field_order and ctx->field_number for the section (to the default).

If this is the right direction for a solution, I’d be happy to send a patch to ffmpeg-devel.

comment:3 Changed 19 months ago by cehoyos

  • Keywords srt removed
  • Priority changed from important to normal
  • Resolution set to fixed
  • Status changed from new to closed

Probably fixed by Rodger Combs in 3b32e1313c6d68aa10bc7d97ad505382def833b0

Note: See TracTickets for help on using tickets.