Open mis-kcn opened 4 days ago
I think what you are describing is the expected behavior for metadata coming in as an e-msg. Unlike in-band metadata that is in the media, e-msg metadata is coming from the manifest and is delivered that way with the mime type application/x-emsg
as it's track mime type.
The expectation that the track group has a different mime type than application/x-emsg
for metadata from the event stream in the manifest isn't right I think. It can for instance well be that the event stream in the DASH manifest has different message types, so keeping the common denominator which is application/x-emsg
seems correct and plausible to me.
With the existing API, I think you can recognize the type of the metadata in the MetadataOutput
though. It delivers you the schemaId
and the bytes that it reads from the event stream. So I think you should be able to decode the bytes when receiving them.
callback with the ID, Duration (optional), and Value.
Yeah, sorry. I don't think the event stream is provided in such a convenient way. I think mostly because of it's nature of being an event stream coming from the manifest that may contain messages of various schemeIds. I agree that this potentially can be improved in some ways as it could be made easier, but the flexibility of the current solution has it justification as well.
If I understand correctly you can do something like this:
@Override
public void onMetadata(Metadata metadata) {
for (int i = 0; i < metadata.length(); i++) {
Metadata.Entry entry = metadata.get(i);
if (entry instanceof EventMessage) {
EventMessage eventMessage = (EventMessage) entry;
if ("urn:scte:scte35:2014:xml+bin".equals(eventMessage.schemeIdUri)) {
Log.d(
"metadata",
"schemeIdUri="
+ eventMessage.schemeIdUri
+ ", id="
+ eventMessage.id
+ ", durationMs="
+ eventMessage.durationMs
+ ", size in bytes="
+ eventMessage.messageData.length);
}
}
}
}
I tried your stream but I've never seen metadata be emitted I'm afraid. I also saw HTTP 500 playback failures usually after an ad but I don't think this is related to not seeing metadata emitted.
Can you let me know if the approach above works for you? I specifically mean wehther you see metadata emitted and then reported by EventLogger
? Or don't you see the callback being triggered at all?
Version
Media3 1.5.0
More version details
No response
Devices that reproduce the issue
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
Add a new renderer and set it to your player
Create the CustomMetadataDecoderFactory()
DASH File Period Sample:
Expected result
SCTE-35 metadata will be read as
application/x-scte35
, and data would be available underonMetadata
callback with the ID, Duration (optional), and Value.Actual result
SCTE-35 metadata was read as
application/x-emsg
and not able to access data such as ID, and value.Media
https://fs01nyc03.mdusolutions.net/CBSNewsLive24/7/index.mpd
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.