Skip to content

Flickering subtitles in DASH/H264 with B-frames present #288

Description

@AGasztold

Media3 Version

ExoPlayer 2.18.3

Devices that reproduce the issue

All Android devices.

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

  1. Run attached media in Demo app
  2. Turn on subtitles
  3. Observe the flicker effect

Expected result

No flickering effect should be observed.

Actual result

Due to the presence of B frames in text chunks and the time offset of text segment relative to video segments:

SegmentTimeline for text: <S t="19" d="2000" r="283" />
SegmentTimeline for video: <S t="0" d="2000" r="89" />

there is an effect of flickering subtitles. When I applied the following workaround inside SubtitleOutputBuffer:

  public void setContent(long timeUs, Subtitle subtitle, long subsampleOffsetUs) {
    this.timeUs = (timeUs/1000000L) * 1000000L;
    this.subtitle = subtitle;
    this.subsampleOffsetUs =
        subsampleOffsetUs == Format.OFFSET_SAMPLE_RELATIVE ? this.timeUs : subsampleOffsetUs;
  }

which cancels this offset, flickering effect does not occur. Anyaway, this is not long term solution for me. I will appreciate your help.

Media

https://r.dcs.redlabs.pl/dash/o2/ATM-Lab/zos/vod-test/glitch/dash_b_frames/playlist.smil

Bug Report

Activity

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