当前位置:网站首页>Introduction to HLS content diversion and insert advertising specification

Introduction to HLS content diversion and insert advertising specification

2022-06-25 21:50:00 User 1324186

source :Global Video Tech Meetup:Seattle author :Zac Shenker Content arrangement : Hu Jingchuan This article from many CDN Switch to start , Introduce HLS The new specification of content turn in and the specification of insert advertising .

Catalog

  • many CDN Switch
    • be based on DNS Of CDN Switch
    • Based on the list (Manifest) Of CDN Switch
    • Client based CDN Switch
  • HLS Content turns to specification
  • Insert type (interstitial) Advertising norms

many CDN Switch

With the increase of users , Many media companies need more from many different perspectives CDN. In many areas , For redundancy and failover , Or in many large-scale activities with high concurrency , many CDN Load can be distributed and mitigated . In a multiple CDN In Architecture , The content of streaming media service ( Images 、 Video files, etc ) Multiple in different geographical areas CDN Caching between providers . With the help of intelligent load balancing algorithm and data collected at different points of transmission pipeline , The incoming traffic of the client is distributed in these multiple areas CDN Between providers , This provides greater redundancy and performance advantages .

The data is usually through QoE/QoS Analyze data collected by suppliers , Or measure network performance in a proprietary way ( for example , Time required to download virtual files ). All this data is used by a central rules engine or server , To determine multiple CDN Which of them should serve requests from a certain region .

many CDN Switching is not HLS The original part of the standard Ecology , There are many different implementations , Each has its own advantages and disadvantages , Here are some of the most common implementations .

be based on DNS Of CDN Switch

Guide all content requests through one domain name , The domain name dynamically handles traffic distribution in real time . therefore , If all traffic in the domain needs to be from CDN-A Redirect to CDN-B, that DNS Will point to CDN-B. The technology is simple , Very easy to deploy and support full platform , Many companies follow this technical route .

But it's not very effective , because DNS Propagation is time-consuming , And it takes a few minutes to spread through the Internet . In the following time , End users may pass the wrong CDN Send many requests to the content server , If not handled properly , At most, it will lead to performance degradation or service interruption of all requests .

Based on the list (Manifest) Of CDN Switch

CDN Another technique for switching is to update the list in real time . In this way , The decision server re updates the list according to the switching rules and factors to point to different CDN. This requires loading ( Or reload ) detailed list , To cope with change . Although this seems to be a simple strategy , But it needs to set up a server , Re provide the list after updating ( Not cached ). A variant of this service also records a... In the list CDN A list of , In one of them CDN In case of failure , Users can switch to this list and other CDN.

Although this technology seems easy , But in HLS How to specify... In the playlist URL, The player is live and VOD There are problems in how to frequently request new lists in this scenario .

Client based CDN Switch

In client exchange , The exchange mechanism is integrated into the client , This allows a lot of fine-grained control . Because based on HTTP The nature of streaming media and HLS Use of independent decodable slices in , Users can choose from different CDN Get each slice independently . Besides , Users also have information about network conditions 、 Delays and other factors “ newest ” Information , These factors can become decision nodes .

But this method has many disadvantages . First, you need to embed additional programs into the client , To communicate with external servers that maintain all rules and switching factors , And you need clients for all platforms (HTML5、Android、iOS、Roku、 Smart TV 、Xbox etc. ) To write 、 Testing and maintenance SDK, This is a difficult task . Besides , Change the flow in the client URL Need to access the source code of the client or API. On platforms that do not have this level of code support , You will not be able to switch streaming media on the client .

After understanding how to realize CDN After switching between different technologies , You must have realized by now , There is no one size fits all approach . contrary , Companies can... According to their needs 、 Infrastructure capacity 、 Design 、 Budget and scale adopt different strategies .

HLS Content turns to specification

up to now ,HLS The latest version number of the specification is 1.2b1, This is the third version of this specification , Each version is backward compatible . This specification defines master Syntax of playlist , Allow content providers to specify different paths for customers to access their content first , This is achieved using an external steering list that is periodically reloaded by the user . be-all CDN Should be in this master The list specifies .

Some new content has been added to this version of the specification . First of all #EXT-X-CONTENT-STEERING, It has two main properties ,SERVER-URI and PATHWAY-ID.

  • SERVER-URI Property is a pointer to the content steering list URI, If you need to switch to the server asset Identifier to generate a steering list ,SERVER-URI It may include asset identifier . It can use data URI programme , stay master An online list is provided in the playlist ; under these circumstances , have access to RELOAD-URI Parameter redirects the subsequent manifest overload to the remote steering server .
  • PATHWAY-ID Property identifies the that must be applied by the client pathway, Until you get the initial steering list . Its value must be a legal pathway ID, Such as "Steering Manifest " As specified in section .

chart 1: Syntax tag instance 1

Besides , Others turn to the server to query parameters , The client sends a list with a turn URI Request , To get a steering list . It can be URI Add the following query parameters .

  • _HLS_pathway: Currently in use pathway Of ID
  • _HLS_throughput:THROUGHPUT Is the number of integer digits per second . It represents the client's response to the application Pathway Current forecast of download throughput made . The exact method of bit rate estimation varies from customer to customer . It should be noted that ,HTTP The proxy cache should exclude this parameter from its cache key .

chart 2: Turn to the server to query parameters

In addition, there is a content shift list (Steering Manifest). Turning to... Is a response list JSON object , It has many fields . The first version number of the field is , Fixed for 1;

The next field is TTL,TTL It refers to the number of seconds that the client must wait before reloading the steering list . Recommended value is 300 second (5 minute ). Turning to the server can be changed according to the client TTL To distribute the load on the server ;

And then there was RELOAD-URI, This is optional , It specifies what the client must use the next time it gets the steering list URI. It can be a list based on the current turn URI Relative URI;

PATHWAY-PRIORITY The field contains Pathway ID Array of .PATHWAY-PRIORITY The elements in the array are by Pathway Preference ranking , The first is the highest priority . A steering list must contain at least one Pathway. stay PATHWAY-PRIORITY One of the arrays Pathway ID Not more than once , The client must ignore PATHWAY-PRIORITY Unrecognized in array Pathway ID.

chart 3: Steering list

More about the specification , You can refer to its PDF Full version (https://developer.apple.com/streaming/HLSContentSteeringSpecification.pdf)

Insert type (interstitial) Advertising norms

at present , Server side advertisement insertion (Server Side Ad Insertion) It's the most common way , However, it still faces many challenges .HLS interstitials The specification aims to make the deployment of advertising content more convenient , Whether on the server side or the client side , It no longer needs to rely on SSAI Special labels in . Besides , It's right VOD And live scenes are well supported .

chart 4:HLS interstitials Standard target

In this specification , The server can insert EXT-X-DATERANGE Tab to tell the client to schedule insert playback . It contains many properties , As shown in the figure below .

chart 5:DATERANGE Tag attributes

First ,CLASS Attribute is fixed to “com.apple.hls.interstitia”;X-ASSET-URI Attribute is an absolute with quotation marks URL, For a single interstitia asset; X-ASSET-LIST Property is to point to a JSON Object's URL, The JSON Object must contain a key / It's worth it ;X-RESUME-OFFSET Property is a decimal floating-point number in seconds , Used to specify where the main content should be resumed after the insert advertisement is played ,X-RESUME-OFFSET The typical value of is zero , If X-RESUME-OFFSET non-existent , Then the player uses the duration of interleaved playback as the recovery offset , This applies to real-time playback and playback with constant delay from the real-time edge VOD Play ;X-PLAYOUT-LIMIT The value of the property is a decimal floating second , Specifies the playback time limit for the entire insert . If it exists , The player should end the insert play when it reaches the offset at the beginning , Otherwise it should end at the end of the insert .

More about the specification , You can refer to its PDF Full version (https://developer.apple.com/streaming/GettingStartedWithHLSInterstitials.pdf)

Attach speech video :

http://mpvideo.qpic.cn/0bc3uqaa2aaavyaag5xwuvqvbjgdbwsaadia.f10002.mp4?dis_k=320cd40dca1e9875e686785000c3fec3&dis_t=1645152937&vid=wxv_2246857306133184513&format_id=10002&support_redirect=0&mmversion=false

原网站

版权声明
本文为[User 1324186]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202181215367722.html