androidx / androidx/media

The DEFAULT_TIMESTAMP_SEARCH_BYTES is too small to handle some excessively large TS files

Open
#1,796 3 comments 0 reactions 1 assignee View on GitHub

@rohitjoins is already working on this.

Since Oct 14, 2024.

bug needs triage
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Version

Media3 main branch

More version details

Since b7710914 and maybe before it

Devices that reproduce the issue

Any device

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps
  1. Download the attached test video
  2. Player it with the demo app
  3. Notice that the duration is 00:00
Expected result

The duration should be correctly parsed, 6:05 in this test case.

Actual result

The demo app shows 00:00 as the duration and couldn't seek forward or backward.

The TsDurationReader fails to read the last PCR value as the search range is too small to reach the last valid packet. The default search bytes limit is defined as:

  public static final int DEFAULT_TIMESTAMP_SEARCH_BYTES = 600 * TS_PACKET_SIZE;

However, this value must be increased to 6851 * TS_PACKET_SIZE to read the last valid PCR value for pid 256 stream.

Could we develop an approach to iterate all packets of the whole ts file segment by segment to find the last PCR, rather than searching in a static range which is not friendly for large local ts files?

For comparison, FFmpeg, VLC and other TS dumper softwares all can parse the "duration" information correctly.

Media

http://amz.zaijun.org/test.ts

Bug Report
  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.