Dash-Industry-Forum / Content-Steering

A standardized means of steering DASH players between substitutable content sources by way of a remote steering server.
6 stars 0 forks source link

Content steering POC using shaka packager and exoplayer. #17

Open sr1990 opened 1 year ago

sr1990 commented 1 year ago

Hi all, While trying to understand how content steering packaging and playback worked (https://dashif.org/docs/DASH-IF-CTS-00XX-Content-Steering-Community-Review.pdf), I have created a small POC using Shaka packager to indicate content steering information, exoplayer for playback and a simple node js content steering server.

Shaka packager branch: https://github.com/sr1990/shaka-packager/tree/content_steering1

Example command line in shaka packager:

../packager \
 'in=Sintel-1280x720.mp4,stream=video,init_segment=h264_1280p/init.mp4,segment_template=h264_1280p/$Number$.m4s' \
 'in=Sintel-768x432.mp4,stream=video,init_segment=h264_768p/init.mp4,segment_template=h264_768p/$Number$.m4s' \
 'in=Sintel-audio.mp4,stream=audio,init_segment=audioSintel/init.mp4,segment_template=audioSintel/$Number$.m4s' \
 --mpd_output h264SintelCS1.mpd --generate_static_live_mpd
--content_steering_default_service_location alpha
--content_steering_query_before_start
--content_steering_url "http://10.0.0.220:3000/ContentSteering"
--content_steering_base_urls "alpha=http://10.0.0.220:3000/B/,beta=http://10.0.0.220:3000/C/"

Creates mpd with:

 <ContentSteering defaultServiceLocation="alpha" queryBeforeStart="true">http://10.0.0.220:3000/ContentSteering</ContentSteering>
 <BaseURL serviceLocation="alpha">http://10.0.0.220:3000/B/</BaseURL>
 <BaseURL serviceLocation="beta">http://10.0.0.220:3000/C/</BaseURL>

Exoplayer changes are at https://github.com/sr1990/ExoPlayer/tree/ContentSteering1

Steps and notes for setup are at : https://github.com/sr1990/ExoPlayer/commit/b72a9c9c9e2ccc69542dfb0d478cb24045bcd85f#diff-ebf5ab7c66a927d7d49320be5[…]a1d316fb514ec66712449ab102abad6

Note: Right now, edge cases are not handled and code needs a lot of refactoring on the player side.

haudiobe commented 1 year ago

Live TF 2022/11/04:

Thank you for the information. It does not impact the current specification, but very useful information for implementers.

@dsilhavy please have look here and we should promote this as part of test assets and so on.

@sr1990 we will publish a new version shortly for another round of review and we would like to point to your implementations as long as they are aligned with our updated spec. Please work with @wilaw to get access to the latest version and he will also add a reference to your implementations in this doc. Thank you again.

sr1990 commented 1 year ago

Based on @wilaw 's demo and discussion, I have updated the packager to add the ContentSteering element at the end of mpd. Example at: https://github.com/sr1990/ExoPlayer/commit/f5aa3582fefb833bd492782323631feec2e364e2

Also updated the player to append query parameters (_DASH_pathway and _DASH_throughput) to the requests sent to content steering server. Example logs from content steering server:

/ContentSteering?_DASH_pathway=alpha&_DASH_throughput=84267048
/ContentSteering?_DASH_pathway=beta&_DASH_throughput=131642064
/ContentSteering?_DASH_pathway=alpha&_DASH_throughput=131642064
haudiobe commented 1 year ago

2022/12/13 new version going to community review by the end of the months

sr1990 commented 1 year ago

Based on v0.9.6, following are some updates to the above implementation: On the packager side,

  1. Location element can be specified using content_steering_locations flag which accepts comma separated <service location, url> pairs.
  2. ContentSteering@defaultServiceLocation attribute with multiple serviceLocations can be specified using --content_steering_default_service_location flag. Example:
    ../packager \
    'input=udp://[127.0.0.1:1234?interface=0.0.0.0,stream=video,init_segment=live-video1.mp4,segment_template=live-video1-$Number$.mp4](http://127.0.0.1:1234/?interface=0.0.0.0,stream=video,init_segment=live-video1.mp4,segment_template=live-video1-$Number$.mp4)' \
    'input=udp://[127.0.0.1:1234?interface=0.0.0.0,stream=video,init_segment=live-video2.mp4,segment_template=live-video2-$Number$.mp4](http://127.0.0.1:1234/?interface=0.0.0.0,stream=video,init_segment=live-video2.mp4,segment_template=live-video2-$Number$.mp4)' \
    --mpd_output live.mpd \
    --content_steering_default_service_location "alpha,1234" \
    --content_steering_url "http://10.0.0.221:3000/ContentSteering" \
    --content_steering_base_urls "alpha=http://10.0.0.221:3000/A/,beta=http://10.0.0.221:3000/B/" \
    --segment_duration 4 \
    --content_steering_locations "1234=http://10.0.0.221:3000/locationA/live.mpd,5678=http://10.0.0.221:3000/locationB/live.mpd"

    will create mpd that contains the following elements. Location

    <Location serviceLocation="1234">http://10.0.0.221:3000/locationA/live.mpd</Location>
    <Location serviceLocation="5678">http://10.0.0.221:3000/locationB/live.mpd</Location>

    BaseUrls

    <BaseURL serviceLocation="alpha">http://10.0.0.221:3000/A/</BaseURL>
    <BaseURL serviceLocation="beta">http://10.0.0.221:3000/B/</BaseURL>

    Content Steering <ContentSteering defaultServiceLocation="alpha,1234">http://10.0.0.221:3000/ContentSteering</ContentSteering>

On the player side,

  1. The _DASH_pathway and _DASH_throughput query arg parameters can now report multiple values. Example content server logs: /ContentSteering?_DASH_pathway:"1234,5678,beta"&_DASH_throughput:694307,795166,62654744
  2. Parse multiple serviceLocations indicated by ContentSteering@defaultServiceLocation attribute.

Updated info: https://github.com/sr1990/ExoPlayer/blob/804f1505beb37299a1f8862becd4b765c043abdb/ContentSteeringREADME.txt#L146

haudiobe commented 8 months ago

Encourage to review the latest specification here: https://members.dashif.org/wg/Interoperability/document/4810

sr1990 commented 8 months ago

@haudiobe

  1. On page 9, shouldn't the following line "At the start of playback, the DASH client requests the MPD from one CDN, in this case from CDN2." mention CDN1 instead of CDN2 according to figure 4.2?

  2. On page 15, in point 15, should a reference to the scenario described in section 19c, particularly the case where the client has blacklisted a preferred service location be added here? This addition would provide clarification if these requests occur within the time-to-live (TTL) period of the blacklist.

haudiobe commented 7 months ago

@haudiobe

  1. On page 9, shouldn't the following line "At the start of playback, the DASH client requests the MPD from one CDN, in this case from CDN2." mention CDN1 instead of CDN2 according to figure 4.2?

It seems not be a bug, but correct. Can you check one more time in the published spec: https://www.etsi.org/deliver/etsi_ts/103900_103999/103998/01.01.01_60/ts_103998v010101p.pdf

  1. On page 15, in point 15, should a reference to the scenario described in section 19c, particularly the case where the client has blacklisted a preferred service location be added here? This addition would provide clarification if these requests occur within the time-to-live (TTL) period of the blacklist.

This clause has been updated significantly, Can you check of you issue is addressed and f not, possbly file a new issue https://www.etsi.org/deliver/etsi_ts/103900_103999/103998/01.01.01_60/ts_103998v010101p.pdf

yreznik-brightcove commented 7 months ago

There is a related ticket (and open call for contributions) in ExoPlayer project: https://github.com/google/ExoPlayer/issues/11203

haudiobe commented 7 months ago

Live TF 2024/02/23

We wait for @sr1990 to come back if the latest version of ExoPlayer and ShakaPackager support the latest published spec and if the question from above are resolved.