Skip to content
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

Support Common Media Client Data (CMCD) #8699

Closed
tonihei opened this issue Mar 10, 2021 · 20 comments
Closed

Support Common Media Client Data (CMCD) #8699

tonihei opened this issue Mar 10, 2021 · 20 comments
Assignees

Comments

@tonihei
Copy link
Collaborator

tonihei commented Mar 10, 2021

CMCD is a new standard that allows player clients to report some state to the CDN to allow the CDN to improve delivery performance (see https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5004-final.pdf).

Implementing this with ExoPlayer is currently difficult as the necessary information needs to be available on the playback thread at the point where the request is generated. This issue is tracking two things:

  1. Making sure the necessary hooks are available to forward all required information to the chunk sources that generate the requests.
  2. Providing an opt-in implementation of CMCD.
@tonihei tonihei self-assigned this Mar 10, 2021
@wilaw
Copy link

wilaw commented Mar 10, 2021

Request around opt-in API structure and API methods:

  1. Have CMCD be default off, to protect privacy and information leakage.
  2. Be able to activate it easily through single API call. This activation would turn on all available keys.
  3. Be able to apply a separate filter list to explicitly enable certain keys. Only keys whitelisted by the filter would be sent.
  4. Have an API method to enable setting the
    1. ContentID value.
    2. RTP value, both as a fixed threshold and also as a multiple of encoded bitrate.
    3. Custom keys - accepting both a key and value arguments.

@beka-discovery
Copy link

Any updates on CMCD support?

@pankaj-giter
Copy link

From Disney Streaming, we are interested to see this support in Exo Player given the performance and other benefits we will see.

Any updates on the timeline for supporting CMCD will be great.

@sdaub
Copy link

sdaub commented May 24, 2022

Starz has also been looking into CMCD for our apps. Having support in ExoPlayer would give us a much stronger business case for taking it up internally.

It would be great to see this added to an upcoming release.

@nicoweilelemental
Copy link

At AWS we see more and more customers asking us to support CMCD at the CDN level, as this is a key enabler for content steering (aka multi-CDN switching) and QoE improvements in general. We cannot do that without the cooperation of the player ecosystem, and that's where ExoPlayer footprint becomes decisive. Thanks in advance for adding CMCD support to a future release!

@fisherinnovation
Copy link

Vimeo has been activly working with CMCD data in our web playback systems and would love to see support in our mobile application video players as well. +1 to this request!

@tonihei
Copy link
Collaborator Author

tonihei commented May 25, 2022

This is still on our agenda and thanks for reiterating your interest. We'll post updates here once we have the implementation ready.

@acbegen
Copy link

acbegen commented May 25, 2022

I would like to make comments with my two different hats:

  1. First with my academic hat, we published two papers already showing the benefits of CMCD (and CMSD) in two different ACM conferences. There is also a paper published in the IEEE Communications Magazine. These are getting pretty good traction as many researchers in the field believe that CMCD/CMSD will bring us much anticipated capabilities. Expect more studies/papers on this topic. See some examples at: https://ali.begen.net/current.php
  2. With my Comcast hat, we expect to roll out CMCD support on the RDK client (which runs millions of settops not just for Comcast but for all syndication partners including all major cable operators in North America).

@mayursfox
Copy link

From FOX, we are interesting in seeing CMCD support in ExoPlayer as we believe this will be a key feature for monitoring QoE and for steering QoE improvements. We're actively engaged on enabling CMCD across other platforms in our ecosystem, would love to get an update on when ExoPlayer would offer support.

@beka-discovery
Copy link

Warner Bros Discovery.

We are looking for integrating CMCD into our playback platforms. We are very pleased that Shaka Player, Dash.js, and Roku players already have rolled out CMCD support.

Currently, I’m not aware of any good way of narrowing down Rebuffering cases without correlating Playback session to CDN logs/state.
CMCD support on ExoPlayer is highly appreciated. Since ExoPlayert is the most Player Engine in the Android ecosystem.

@dsparacio
Copy link

From Paramount Streaming's perspective, we are also very interested in seeing CMCD implemented for Exo.

We have full support for this across all web. Our team at Paramount has implemented the CMCD spec in HLS.js and Google Shaka Player. There is also an implementation in Dash.js. So, the most popular open source projects for web have it this feature in prod today. It would be nice to have cross platform support for CMCD. Let us know if you are looking for contributors for this feature.

@haudiobe
Copy link

Broad support for CMCD is important. If Exoplayer adds CMCD; it will stay important - we are supportive of this feature.

@seanmccarthy1992
Copy link

+1 from Paramount's perspective, our goal is to offer a standardized data set for operations teams to troubleshoot playback issues. A subset of our players now have the rich CMCD data set which makes debugging last-mile and CDN issues more timely and enables us to get to root cause faster. It would be great if this data was provided across our native player platform stack as well.

@zen-tek
Copy link

zen-tek commented Jun 4, 2022

Datazoom has been leveraging CMCD and related mechanisms for quite some time to link player QoE + CDN cache log data for coordinate analysis. We're also leveraging it for experimentation with distributed request tracing across the streaming content delivery pipeline. This overlaps with our efforts within the Streaming Video Alliance. In general, we see CMCD as valuable observability tool that every player should seek to support. Support for CMCD in Exoplayer would be a huge step forward.

@tonihei
Copy link
Collaborator Author

tonihei commented Jun 6, 2022

Just repeating what I already mentioned above: We are aware that there is a wide interest in this feature and we also understand why it is important to many of you. It's definitely on our agenda and we'll update this issue with commits and comments once we have them.

If you have a concrete implementation idea, we are also open to accept PRs. The request parameters can be extended in either DefaultDashChunkSource/HlsChunkSource at the point where we generate the original DataSpec, or by a variant of a ResolvingDataSource that amends existing requests before sending them (the former sounds more promising). In any case, the complicated part is to make sure all the relevant information is available. If you are thinking about sending a PR that isn't maintained in a small section of the code, it's worth providing a design document first to allow a better discussion of the approach. Once we know the right way to implement this, merging code changes becomes a lot simpler.

@totallyunknown
Copy link

Has anyone looked into https://github.com/realeyes-media/cta-wave-cmcd-lib? They said that's a reference implementation for CMCD on Exoplayer.

@tonihei
Copy link
Collaborator Author

tonihei commented Jun 20, 2022

This implementation looks as if it might not achieve its purpose very well at the moment as the necessary player state information is obtained with a delay to when it's used to fill the request parameters. For example, a buffer starvation or startup after seek would not show up in the relevant next request, but only one request later. This isn't really something they could have easily solved though and it nicely shows that implementing this correctly needs some integration in the player itself and can't be done from the outside.

tof-tof pushed a commit to androidx/media that referenced this issue Jun 9, 2023
Add support for including Common Media Client Data (CMCD) in the outgoing requests of adaptive streaming formats DASH, HLS, and SmoothStreaming.

API structure and API methods:
   *   CMCD logging is disabled by default, use `MediaSource.Factory.setCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory)` to enable it.
   *   All keys are enabled by default, override `CmcdConfiguration.RequestConfig.isKeyAllowed(String key)` to filter out which keys are logged.
   *  Override `CmcdConfiguration.RequestConfig.getCustomData()` to enable custom key logging.

NOTE: Only the following fields have been implemented: `br`, `bl`, `cid`, `rtp`, and `sid`.

Issue: google/ExoPlayer#8699

#minor-release

PiperOrigin-RevId: 539021056
tof-tof pushed a commit that referenced this issue Jun 9, 2023
Add support for including Common Media Client Data (CMCD) in the outgoing requests of adaptive streaming formats DASH, HLS, and SmoothStreaming.

API structure and API methods:
   *   CMCD logging is disabled by default, use `MediaSource.Factory.setCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory)` to enable it.
   *   All keys are enabled by default, override `CmcdConfiguration.RequestConfig.isKeyAllowed(String key)` to filter out which keys are logged.
   *  Override `CmcdConfiguration.RequestConfig.getCustomData()` to enable custom key logging.

NOTE: Only the following fields have been implemented: `br`, `bl`, `cid`, `rtp`, and `sid`.

Issue: #8699

#minor-release

PiperOrigin-RevId: 539021056
tof-tof pushed a commit to androidx/media that referenced this issue Jun 12, 2023
Add support for including Common Media Client Data (CMCD) in the outgoing requests of adaptive streaming formats DASH, HLS, and SmoothStreaming.

API structure and API methods:
   *   CMCD logging is disabled by default, use `MediaSource.Factory.setCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory)` to enable it.
   *   All keys are enabled by default, override `CmcdConfiguration.RequestConfig.isKeyAllowed(String key)` to filter out which keys are logged.
   *  Override `CmcdConfiguration.RequestConfig.getCustomData()` to enable custom key logging.

NOTE: Only the following fields have been implemented: `br`, `bl`, `cid`, `rtp`, and `sid`.

Issue: google/ExoPlayer#8699

#minor-release

PiperOrigin-RevId: 539021056
(cherry picked from commit b55ddf1)
tof-tof pushed a commit that referenced this issue Jun 14, 2023
Add support for including Common Media Client Data (CMCD) in the outgoing requests of adaptive streaming formats DASH, HLS, and SmoothStreaming.

API structure and API methods:
   *   CMCD logging is disabled by default, use `MediaSource.Factory.setCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory)` to enable it.
   *   All keys are enabled by default, override `CmcdConfiguration.RequestConfig.isKeyAllowed(String key)` to filter out which keys are logged.
   *  Override `CmcdConfiguration.RequestConfig.getCustomData()` to enable custom key logging.

NOTE: Only the following fields have been implemented: `br`, `bl`, `cid`, `rtp`, and `sid`.

Issue: #8699

#minor-release

PiperOrigin-RevId: 539021056
(cherry picked from commit b7e7153)
marcbaechinger pushed a commit to androidx/media that referenced this issue Jun 19, 2023
Additionally, two existing methods to `buildDataSpec` in `DashUtil` have been deprecated, while a new method has been added that allows the inclusion of `httpRequestHeaders`.

Issue: google/ExoPlayer#8699

#minor-release

PiperOrigin-RevId: 540594444
marcbaechinger pushed a commit to androidx/media that referenced this issue Jun 19, 2023
Instead of providing `playbackDurationUs` and `loadPositionUs` individually, which are used to calculate the buffer duration for CMCD logging, we can directly pass the pre-calculated `bufferedDurationUs` available in the `getNextChunk` method of the chunk source classes.

Issue: google/ExoPlayer#8699

#minor-release

PiperOrigin-RevId: 540630112
icbaker pushed a commit that referenced this issue Jun 20, 2023
Additionally, two existing methods to `buildDataSpec` in `DashUtil` have been deprecated, while a new method has been added that allows the inclusion of `httpRequestHeaders`.

Issue: #8699

#minor-release

PiperOrigin-RevId: 540594444
icbaker pushed a commit that referenced this issue Jun 20, 2023
Instead of providing `playbackDurationUs` and `loadPositionUs` individually, which are used to calculate the buffer duration for CMCD logging, we can directly pass the pre-calculated `bufferedDurationUs` available in the `getNextChunk` method of the chunk source classes.

Issue: #8699

#minor-release

PiperOrigin-RevId: 540630112
tianyif pushed a commit that referenced this issue Aug 11, 2023
Additionally, two existing methods to `buildDataSpec` in `DashUtil` have been deprecated, while a new method has been added that allows the inclusion of `httpRequestHeaders`.

Issue: #8699

#minor-release

PiperOrigin-RevId: 540594444
(cherry picked from commit c69b6fe)
tianyif pushed a commit that referenced this issue Aug 11, 2023
Instead of providing `playbackDurationUs` and `loadPositionUs` individually, which are used to calculate the buffer duration for CMCD logging, we can directly pass the pre-calculated `bufferedDurationUs` available in the `getNextChunk` method of the chunk source classes.

Issue: #8699

#minor-release

PiperOrigin-RevId: 540630112
(cherry picked from commit 4d1119a)
tianyif pushed a commit to androidx/media that referenced this issue Aug 14, 2023
Additionally, two existing methods to `buildDataSpec` in `DashUtil` have been deprecated, while a new method has been added that allows the inclusion of `httpRequestHeaders`.

Issue: google/ExoPlayer#8699

#minor-release

PiperOrigin-RevId: 540594444
(cherry picked from commit 52878b2)
tianyif pushed a commit to androidx/media that referenced this issue Aug 14, 2023
Instead of providing `playbackDurationUs` and `loadPositionUs` individually, which are used to calculate the buffer duration for CMCD logging, we can directly pass the pre-calculated `bufferedDurationUs` available in the `getNextChunk` method of the chunk source classes.

Issue: google/ExoPlayer#8699

#minor-release

PiperOrigin-RevId: 540630112
(cherry picked from commit be9b057)
tianyif pushed a commit that referenced this issue Aug 14, 2023
Additionally, two existing methods to `buildDataSpec` in `DashUtil` have been deprecated, while a new method has been added that allows the inclusion of `httpRequestHeaders`.

Issue: #8699

#minor-release

PiperOrigin-RevId: 540594444
(cherry picked from commit c69b6fe)
tianyif pushed a commit that referenced this issue Aug 14, 2023
Instead of providing `playbackDurationUs` and `loadPositionUs` individually, which are used to calculate the buffer duration for CMCD logging, we can directly pass the pre-calculated `bufferedDurationUs` available in the `getNextChunk` method of the chunk source classes.

Issue: #8699

#minor-release

PiperOrigin-RevId: 540630112
(cherry picked from commit 4d1119a)
@rohitjoins
Copy link
Contributor

Hi Everyone,

Thank you for your patience. We have added CMCD support in ExoPlayer. Please see the doc on how to enable CMCD.

Timeline of changes made:

  • Release 1.1.0: Added support to enable CMCD with fields bitrate (br), buffer length (bl), content ID (cid), requested maximum throughput (rtp), and session ID (sid).
  • Release 1.1.1: Added additional fields: streaming format (sf), stream type (st), version (v), top birate (tb), object duration (d), measured throughput (mtp) and object type (ot)
  • Upcoming Release 1.2.0(available in main branch): Remaining fields added: buffer starvation (bs), deadline (dl), playback rate (pr), startup (su), next object request (nor) and next range request (nrr). Also added functionality to transmit CMCD data using query parameters.

We look forward to your feedback. Have a nice weekend!

@rohitjoins rohitjoins assigned rohitjoins and unassigned tonihei Sep 8, 2023
@icbaker
Copy link
Collaborator

icbaker commented Sep 8, 2023

For those wanting to experiment without building from the main branch, 1.2.0-alpha01 is also already available, and contains support for buffer starvation (bs), deadline (dl), playback rate (pr) and startup (su). The remaining keys mentioned above will be available in the next 1.2.0 pre-release.

@rohitjoins
Copy link
Contributor

1.2.0 has been released, incorporating support for CMCD including all fields. Kindly share your feedback regarding this integration.

@google google locked and limited conversation to collaborators Jan 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests