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)

ffmpeg-20141029-101102.log (42.3 KB ) - added by Mika Raento 10 years ago.
log file from non-working comamnd
ffmpeg-20141029-101119.log (47.6 KB ) - added by Mika Raento 10 years ago.
log file from working command

Download all attachments as: .zip

Change History (12)

comment:1 by Carl Eugen Hoyos, 10 years ago

Component: ffmpegundetermined
Keywords: sub added

Please provide the input sample and the complete, uncut console output of the failing command to make this a valid ticket.

Last edited 10 years ago by Carl Eugen Hoyos (previous) (diff)

by Mika Raento, 10 years ago

Attachment: ffmpeg-20141029-101102.log added

log file from non-working comamnd

by Mika Raento, 10 years ago

Attachment: ffmpeg-20141029-101119.log added

log file from working command

comment:2 by Mika Raento, 10 years ago

uploaded the input file to upload.ffmpeg.org/incoming

comment:3 by Carl Eugen Hoyos, 10 years ago

Does the sample you uploaded contain any subtitles? How can I see them?

in reply to:  3 comment:4 by Mika Raento, 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 Carl Eugen Hoyos, 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 Mika Raento, 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 Cigaes, 10 years ago

Analyzed by developer: set
Component: undeterminedffmpeg
Reproduced by developer: set
Status: newopen

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.

Last edited 10 years ago by Cigaes (previous) (diff)

comment:8 by Mika Raento, 10 years ago

Thanks! Will take a look.

comment:9 by Mika Raento, 10 years ago

Yes, the patch fixes this problem. Thank you!

comment:10 by Michael Niedermayer, 10 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.