androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.62k stars 384 forks source link

Metadata (Vorbis comments) in chained Ogg streams #1756

Open ziplantil opened 2 weeks ago

ziplantil commented 2 weeks ago

The Ogg container allows "chaining", i.e. concatenating multiple Ogg bitstreams together into a new stream. I cannot find a way to get metadata (Vorbis comment) updates from chained Ogg streams, however. If I try to play a chained Ogg file, any metadata updates (through onMetadata, onMediaMetadataChanged and onTracksChanged) are only provided for the first bitstream.

I have my own test file that I have attached in this issue (within a .zip as GitHub does not directly allowing attaching an .ogg file; the file is effectively in the public domain), but it's easy to create these manually too by simply concatenating two Ogg files (of the same codec) together.

pingpong.ogg.zip

The main use case of supporting metadata in chained streams properly (by emitting events every time a new Vorbis comment header is found in the container, at the very least when the stream serial number changes) are online streams that use Ogg containers without an external channel for publishing metadata.

For the record, how some other media players and tools behave:

I have been testing with media3 and ExoPlayer version 1.4.1.

tonihei commented 3 days ago

Sounds like an extractor feature request (/bug?). Assigning to @rohitjoins for now, in case you have more context on this chaining. I would't be surprised if ExoPlayer's extractor stops parsing the metadata after seeing the first stream headers and then doesn't know about the new format coming much later in the bitstream.