Skip to content

Closed Captions are mispelled in Media3 #2372

Closed

Description

@amit12kumardish

Version

Media3 main branch

More version details

im using:
private val extractorsFactory = DefaultExtractorsFactory().apply { setTsSubtitleFormats( ImmutableList.of( Format.Builder().setSampleMimeType(MimeTypes.APPLICATION_CEA608).build() ) ) }
check the attached stream for reference.
media3 version 1.6.0
Closed captions (CC) are being displayed with spelling errors or garbled/malformed text in Media3, whereas they appear correctly in vlc player.

Devices that reproduce the issue

Android box with media3

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

play the attached media and see cc are coming misspelled

Expected result

closed captions should come properly

Actual result

Closed captions are coming mispelled

Media

vlc-record-2025-04-24-11h38m32s-udp___239.255.50.81_7000-.ts.zip

Bug Report

Activity

  1. icbaker commented on Apr 28, 2025

    @icbaker
    Collaborator

    Thanks for the media, I can reproduce the issue. This is supposed to be handled by ReorderingSeiMessageQueue, but adding some logging it seems that component is completely skipped in this case.

    That is happening because when playing H.262 like your stream we pass the CEA data directly to CeaUtil here without reordering it:

    CeaUtil.consumeCcData(pesTimeUs, userDataPayload, outputs);

    If I change this to use ReorderingSeiMessageQueue with an arbitrary reorder size of 5, the subtitles display correctly.

    In H.264 and H.265 we parse the max re-ordering queue size from the bitstream, and use this to configure ReorderingSeiMessageQueue - but looking at the H.262 spec I can't see an equivalent piece of metadata we can easily use. It says:

    When the sequence contains coded B-frames, the number of consecutive coded B-frames is variable and unbounded

    Which suggests that there isn't a 'reordering queue size' number we can read.

    I'm going to try setting it to 3 arbitrarily...

  2. amit12kumardish commented on Apr 29, 2025

    @amit12kumardish
    Author

    @icbaker Is there any workaround or fix to solve the cc mispelled issue.

  3. icbaker commented on Apr 29, 2025

    @icbaker
    Collaborator

    This is fixed by the commits linked above.

  4. amit12kumardish commented on Apr 30, 2025

    @amit12kumardish
    Author
  5. icbaker commented on Apr 30, 2025

    @icbaker
    Collaborator

    The fix will be included in the 1.7.0-alpha01 release, which will likely happen in the next 2-3 weeks.

    In the meantime, you can build the library locally from the main branch to get all the latest code changes: https://github.com/androidx/media/blob/release/README.md#locally

  6. amit12kumardish commented on May 13, 2025

    @amit12kumardish
    Author
  7. icbaker commented on May 20, 2025

    @icbaker
    Collaborator

    1.8.0-alpha01 was released yesterday (there was a problem with the 1.7.0-alpha01 release, hence skipping to 1.8): https://github.com/androidx/media/releases/tag/1.8.0-alpha01

  8. amit12kumardish commented on May 20, 2025

    @amit12kumardish
    Author
  9. icbaker commented on May 20, 2025

    @icbaker
    Collaborator

    No and no :)

  10. amit12kumardish commented on May 20, 2025

    @amit12kumardish
    Author
  11. amit12kumardish commented on Jun 2, 2025

    @amit12kumardish
    Author
  12. locked and limited conversation to collaborators on Jun 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions