androidx / androidx/media

Metadata (Vorbis comments) in chained Ogg streams

Open
#1,756 2 comments 0 reactions 1 assignee View on GitHub

@rohitjoins is already working on this.

Since Oct 10, 2024.

needs triage question
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

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:

  • ffprobe n7.0.2 (libavformat 61.1.100) only lists the metadata for the first stream. ffplay only displays the metadata for the first stream.
  • VLC 3.0.21 updates the metadata (although a bit ahead of time), but the first second or two of the second stream is silent
  • Both DeaDBeeF (development build from 2023 or so) and foobar2000 v2.1.6 add the streams separately when a local file is played, but when played from an online stream, the media plays and metadata is updated correctly
  • mpv v0.39.0 only plays the first stream when playing from a local file, but plays and prints metadata correctly when playing from an online stream

I have been testing with media3 and ExoPlayer version 1.4.1.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.