Skip to content

caption_frame_decode: rework API#60

Open
MathieuDuponchelle wants to merge 1 commit into
szatmary:developfrom
MathieuDuponchelle:fix-timestamping
Open

caption_frame_decode: rework API#60
MathieuDuponchelle wants to merge 1 commit into
szatmary:developfrom
MathieuDuponchelle:fix-timestamping

Conversation

@MathieuDuponchelle
Copy link
Copy Markdown

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.

Fixes szatmary#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
Copy link
Copy Markdown
Author

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
Copy link
Copy Markdown
Author

ping @szatmary :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scc2srt: surprising timestamps

1 participant