Opened 21 months ago
Last modified 21 months ago
#10135 new defect
matroska/ass: Wrong AVPacket duration set for ass events with 0 duration
Reported by: | enen92 | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avformat |
Version: | git-master | Keywords: | mkv, ass |
Cc: | enen92 | Blocked By: | |
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
Reported to Kodi (https://github.com/xbmc/xbmc/issues/21625) but the root cause seems to be in libav. The subtitle AVPackets returned from the demuxer have a duration > 0 that seems to result from the pts value that the next subtitle is received.
Those subtitle events have start and end times equal to 0 and should not be shown:
Dialogue: 0,0:00:00.00,0:00:00.00,DCMain,CONAN,0000,0000,0000,,[ed] Dialogue: 0,0:00:00.00,0:00:00.00,DCMain,KOGORO,0000,0000,0000,,[eyecatch] Dialogue: 0,0:00:00.00,0:00:00.00,DCMain,,0000,0000,0000,,Detective Conan Episode 1047 "The \NRed Sheep's Eerie Game (Part One)" Dialogue: 0,0:00:00.00,0:00:00.00,DCMain,CONAN,0000,0000,0000,,[op]
Initially matroskadec sets the start and duration times correctly (both 0) but at some point along the chain the duration is changed.
How to reproduce:
% ffplay -vf subtitles=filename="ass_sample.mkv" ass_sample.mkv ffmpeg version master built on linux (although it happens on all platforms)
The entries "[ed]", "[eyecatch]", "Detective Conan Episode 1047 "The \NRed Sheep's Eerie Game (Part One)", "[op]" should not be shown. Opening the same file with mpv shows the correct behaviour (they don't rely on the duration from AVPacket)
Sample file is here (14Mb exceed the upload limit of the bugtracker):
https://www.mediafire.com/file/d6itonjk5z21j0r/1047_%255BErai-raws%255D_%25281%2529-001.mkv/file