Opened 10 years ago
Closed 10 years ago
#4062 closed defect (fixed)
sub2video overlay fails with negative starting timestamp and -copyts
Reported by: | Mika Raento | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | ffmpeg |
Version: | git-master | Keywords: | sub |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | yes |
Description
Summary of the bug: If the input starts on a negative time and -copyts is given, sub2video causes 'Buffer queue overflow, dropping' messages and broken output.
Although this seems like a minor problem, the problem is easily triggered by broadcast input that has non-monotonic timestamps (will try to find a simple testcase for that and file a separate ticket).
I need -copyts to later sync video and audio if there is missing video or audio.
How to reproduce:
$ ffmpeg -y -i negative_pts_sub.ts -copyts -filter_complex '[0:0][0:3]overlay[outv0]' -map 0:1 -map '[outv0]' broken.ts ffmpeg version N-67065-g2fa08fd Copyright (c) 2000-2014 the FFmpeg developers built on Oct 23 2014 08:58:30 with Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
The following works:
$ ffmpeg -y -itsoffset 46.944644 -i negative_pts_sub.ts -copyts -filter_complex '[0:0][0:3]overlay[outv0]' -map 0:1 -map '[outv0]' working.ts
Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.
Attachments (2)
Change History (12)
comment:1 by , 10 years ago
Component: | ffmpeg → undetermined |
---|---|
Keywords: | sub added |
follow-up: 4 comment:3 by , 10 years ago
Does the sample you uploaded contain any subtitles? How can I see them?
comment:4 by , 10 years ago
Replying to cehoyos:
Does the sample you uploaded contain any subtitles? How can I see them?
The cut-down version does not contain any subtitles that would be visible.
$ ffprobe -i negative_pts_sub.ts -select_streams s -show_packets
will show you that there are subtitle packets.
Do you want a larger sample that contains visible subtitles?
comment:5 by , 10 years ago
Imo, even if the issue is reproducible without visible subtitles, it makes the issue (your issue) easier to understand if there are subtitles visible.
comment:6 by , 10 years ago
Uploaded negative_pts_sub_long.ts to upload.ffmpeg.org/incoming
There are Finnish subtitles from 03min04s, viewable in VLC or by running the 'working' example command with this file (the subtitles are not scaled right, I didn't put that in the command for this ticket).
comment:7 by , 10 years ago
Analyzed by developer: | set |
---|---|
Component: | undetermined → ffmpeg |
Reproduced by developer: | set |
Status: | new → open |
Thanks for the bug report and the sample. Can you test whether the following patch fixes the problem for you?
http://ffmpeg.org/pipermail/ffmpeg-devel/2014-November/164811.html
The problem is with the heartbeat for the subtitles; since subtitles streams are sparse, overlay needs a heartbeat frame to know that subtitles have not changed and have a timestamp. The initial value for the heartbeat was left to 0, and video frames with negative timestamps would not generate heartbeat. The solution is to init it to -∞ or equivalent.
comment:10 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
Fixed by Nicolas in 90cdec5e2698973fdb6643c1d66c7254478929f3
Please provide the input sample and the complete, uncut console output of the failing command to make this a valid ticket.