libcaption
libcaption copied to clipboard
caption_frame_decode: rework API
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.
wget https://publish.dvlabs.com/democracynow/360/dn2018-1217.mp4
Before:
After:
Rename to .srt if needed, github was refusing that extension
ping @szatmary :)