libcaption icon indicating copy to clipboard operation
libcaption copied to clipboard

caption_frame_decode: rework API

Open MathieuDuponchelle opened this issue 4 years ago • 2 comments

Fixes #59

  • pop_on mode requires incrementing the frame timestamp until end_of_caption is encountered.

  • caption_frame_decode now always updates the timestamp of the frame when the timestamp parameter != -1. This requires that callers only pass a valid timestamp when a new one is encountered, for example with SCC the timestamp at the start of the cue, then -1 until the next new timestamp.

  • A new enum member is added for the return value, LIBCAPTION_CLEAR. It allows the caller to determine that closed captions should not be displayed anymore, in order to finish the previous cue earlier than the start of the next cue.

MathieuDuponchelle avatar Mar 18 '20 20:03 MathieuDuponchelle

wget https://publish.dvlabs.com/democracynow/360/dn2018-1217.mp4

Before:

orig.txt

After:

new.txt

Rename to .srt if needed, github was refusing that extension

MathieuDuponchelle avatar Mar 18 '20 20:03 MathieuDuponchelle

ping @szatmary :)

MathieuDuponchelle avatar Jul 02 '20 12:07 MathieuDuponchelle