-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Playback exception on cmaf vod stream which the first segment have emsg box #1002
Comments
This issue seems to have been introduced with the Media3 1.1.0 release |
Thanks everyone for reporting! We will look into this. From the duplicate #1203 and the information here it looks like this was introduced with 1.1.0:
From #1203:
Note: there is another test stream in #1203 for repro and to verify a fix when available. |
The test stream in #1203 is actually the same test stream. The midrolls trigger the issue consistently, so as soon as you get an ad you should get the index out of bounds error, most probably triggered by the emsg info. |
Thanks! We can repro this with the stream. The analysis from @guoen21 is to the point. When calling A fix for this will be referenced here when it lands on GitHub. |
When delegating EMSG samples in `HlsSampleStreamWrapper`, the offset passed into `sampleMetadata(..)` of the delegate `TrackOutput` must be zero because it is called immediately after `sampleData(..)` is called. The condition to trigger this issue is that more than one metadata samples are pending in `pendingMetadataSampleInfos` of `FragmentedMp4Extractor` which produces non-zero offsets. Issue: #1002 Issue: #1203 PiperOrigin-RevId: 623210835
Version
Media3 1.2.0
More version details
No response
Devices that reproduce the issue
samsung SM-S911U1 (RFCW11VVC1X) Android 13
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
Play a cmaf vod stream which the first segment contains emsg box e.g. the stream have pre-roll ads
Expected result
Start and watch this video normally.
Actual result
For media v1.0.2 it works well and no any exception.
But for media v1.2.0 sometimes we can not start the playback and throws exceiption, sometimes it start normally.
I guess this issue will occur when we have pending metadata samples within fmp4 extractor. Our video chunk contain video + emsg samples and audio chuck only contain audio samples. If the audio chuck is extracted first and then no pending metadata (when extract video chuck the timeadjuster had inited), but if the video chuck is extracted first and then we will have pending metadata samples on media3 v1.2.0 (no peding emsg on v1.0.2). I think for the former the playback will be normal but for the latter it will break the playback.
On v1.2.0 for the case video chunk is extracted first,
FragmentedMp4Extractor#onEmsgLeafAtomRead()
have following logic:emsgTrackOutput.sampleData()
and then pending emsg topendingMetadataSampleInfos
. TheemsgTrackOutput
just cache the sample in local buffer, not commit sample to data queue yet.pendingMetadataSampleInfos
viaemsgTrackOutput.sampleMetadata()
with offset. e.g we have 4 pending emsg, and the offset of first emsg is441
.Here I think we should pass 0 instead of
offset
to delegate.sampleMetadata() call. It may cause the offset is set to -441 for the first sample of emsg queue and cause the exception while reading emsg samples.Media
Our stream use ssai ad solution, cmaf drm stream, and diffcult to make it to be public for debug.
Bug Report
adb bugreport
to [email protected] after filing this issue.The text was updated successfully, but these errors were encountered: