The DEFAULT_TIMESTAMP_SEARCH_BYTES is too small to handle some excessively large TS files
@rohitjoins is already working on this.
Since Oct 14, 2024.
- 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
- Download the attached test video
- Player it with the demo app
- 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
Bug Report
- You will email the zip file produced by
adb bugreportto android-media-github@google.com after filing this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.