SCTE-35 being read as x-emsg rather than x-scte35
Open
@marcbaechinger is already working on this.
Since Nov 29, 2024.
needs triage
wont fix: intended behavior
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Version
Media3 1.5.0
More version details
No response
Devices that reproduce the issue
- Pixel 8 Pro API 35 Emulator
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
val renderersFactory: RenderersFactory = object : DefaultRenderersFactory(context) {
override fun buildMetadataRenderers(context: Context, output: MetadataOutput, outputLooper: Looper, extensionRendererMode: Int, out: ArrayList<Renderer>) {
val metadataRenderer = MetadataRenderer(
output,
outputLooper,
CustomMetadataDecoderFactory()
)
out.add(metadataRenderer)
}
}
- Create the CustomMetadataDecoderFactory()
@UnstableApi
class CustomMetadataDecoderFactory : MetadataDecoderFactory {
override fun supportsFormat(format: Format): Boolean {
Log.i("CustomMetadataDecoder", "Format: ${format.sampleMimeType}")
// Ensure support for the MIME type used by SCTE-35 metadata
return format.sampleMimeType == "application/x-scte35" || format.sampleMimeType == "application/x-emsg"
}
override fun createDecoder(format: Format): MetadataDecoder {
Log.i("CustomMetadataDecoder", "Decoder Metadata: ${format.metadata}")
if(format.sampleMimeType == "application/x-emsg") {
Log.i("CustomMetadataDecoder", "Decoding using EventMessageDecoder")
return EventMessageDecoder()
}
Log.i("CustomMetadataDecoder", "Decoding using SpliceInfoDecoder")
return SpliceInfoDecoder()
}
}
- Play the DASH file
DASH File Period Sample:
<Period id='1732293437' start="PT0S" >
<EventStream schemeIdUri="urn:scte:scte35:2014:xml+bin" timescale="1000">
<Event id="0" presentationTime="1732294630134">
<Signal xmlns="http://www.scte.org/schemas/35/2016">
<Binary>/DBOAAAAAAAAAP/wBQb+gnX6iAA4AjZDVUVJAYAIhH/DAAD3NtEOIE0xU2F1SjZkeUtiQnl2WUY1b0hZSkhINWtKNG1XT1JvNAAAAABYZSZy</Binary>
</Signal>
</Event>
<Event id="0" presentationTime="1732294636140">
<Signal xmlns="http://www.scte.org/schemas/35/2016">
<Binary>/DBOAAAAAAAAAP/wBQb+gnX6iAA4AjZDVUVJAYAIhH/DAAD3NtEOIE0xU2F1SjZkeUtiQnl2WUY1b0hZSkhINWtKNG1XT1JvNAAAAABYZSZy</Binary>
</Signal>
</Event>
<Event id="0" presentationTime="1732294642146">
<Signal xmlns="http://www.scte.org/schemas/35/2016">
<Binary>/DBOAAAAAAAAAP/wBQb+gnX6iAA4AjZDVUVJAYAIhH/DAAD3NtEOIE0xU2F1SjZkeUtiQnl2WUY1b0hZSkhINWtKNG1XT1JvNAAAAABYZSZy</Binary>
</Signal>
</Event>
...
Expected result
SCTE-35 metadata will be read as application/x-scte35, and data would be available under onMetadata 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.
tracks [eventTime=702.96, mediaPos=0.00, window=0, period=0
group [
[X] Track:0, id=tracks-v1, mimeType=video/avc, container=video/mp4, bitrate=2344000, codecs=avc1.4d401f, res=1280x720, fps=29.97003, supported=YES
]
group [
[X] Track:0, id=tracks-a1, mimeType=audio/mp4a-latm, container=audio/mp4, bitrate=128000, codecs=mp4a.40.2, channels=2, sample_rate=48000, language=en, supported=YES
]
group [
[X] Track:0, id=urn:scte:scte35:2014:xml+bin/, mimeType=application/x-emsg, supported=YES
]
]
Media
https://fs01nyc03.mdusolutions.net/CBSNewsLive24/7/index.mpd
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.