If you don't find an answer, please click here to post your question.
Engineering Blog

Transcoding Media files using Cloud Brokering

by Community Manager on ‎03-13-2017 02:40 PM (870 Views)

Written by Maheshwaran G 3/12/17

 

Overview

Media streaming is taking the internet by storm by dominating the internet traffic and will continue doing so in the future too!  Hope everybody would agree with this statement without any element of doubt. Advancement in telecommunication, broadband internet access and enhanced coding technique that aids in video streaming services are becoming increasingly popular. The video files are generally transcoded before being delivered to the end users using different devices like desktop, tablet, smart phone, etc for consuming the content. The process of transcoding primarily involves a two step process for the content. One, decoding in which video data is converted to uncompressed format. Second, re-encoding where the data is converted to desired format that enables the content to be rendered across various devices. Traditionally, the video transcoding software is supposed to be installed in one system for transforming the video files which is more of a centralized approach where powerful server with higher bandwidth is deployed to perform the video/audio transcoding.

This traditional method has become challenging in terms of maintaining more than one transcoding software, with support of various features used, and with overhead of managing the complete scalability of centralized services to catch up the increasing demand in transcoding the content.  However, in recent days, most of the video platform providers are transitioning from the traditional way of managing the transcoding service to cloud based video transcoding services, which has gained enormous popularity and has changed the world of video transcoding.

Cloud based video transcoding services are offered to benefit primarily the broadcasters and large production companies dealing with huge volume of media files that needs to be transformed to different variants for the use of the media files in the various platform. Recently, there are many transcoding services available in the market with the capacity of different capability in transcoding media files. Conventionally, the online Video platform provider for transcoding the content, interfaces with one or many transcode services and finds difficulty to select suitable transcode services across heterogeneous transcode engines in integrated transcoding workflow. Hence we are in need of a system with a smart software function that would select the right transcode service for transcoding the content.

In this article, we will see how we can enable the transcoding workflow with smart brokering of incoming transcoding requests in heterogeneous transcode services/engines platform. We will find how different brokering methods like static or dynamic brokering of transcode services would function and help any video online platform provider to perform transcoding of content in much more efficient and cost effective manner.

 

 

Static Brokering

Schematic System Model

 Screen Shot 2017-03-13 at 9.07.01 AM.png

 

 

 

Static Brokering is a simple and commonly used brokering methodology to select the transcode engine in the heterogeneous transcoding platform, where we know upfront about the capabilities of all the transcoding engines configured and manually define simple rules to facilitate the routing of the transcode request  to specific transcode engine that would best fit the content processing.

 

For example, you can govern the route rules by defining routing rules as MUX format “HLS” shall be processed in “ffmpeg” transcode engine and MUX format “DASH” shall be processed in “Elemental” transcode engine and so forth. In this case, if the requested output format is “HLS” then the brokering Unit would lookup the routing rules matching MUX format “HLS” for transcoding and routes the transcoding request to “ffmpeg” transcode engine as instructed in the rules, similarly, the request to transcode output MUX format as “DASH” shall be routed to “elemental” for processing the content.

 

Sample rule (Transcode Brokering Profile) shall be designed as below. 

[

{

   “mux_format”: “hls”,

   “transcode_engine” : “ffmpeg”

  },

{

  “mux_format” : “dash”,

  “transcode_engine” : “elemental”

}

]

 

The static rule can also be multi level rule, saying if the input format is AVI and required output MUX format is HLS with output video codec as H.264 and audio codec is AC3, then select appropriate transcode engine for the transcoding.

 

[

  {

   “mux_format”:”hls”,

   “input_format” : “avi”,

   “output_video_codec” : “h.264”,

   “ouput_audio_codec” : “ac3”,

   “transcode_engine” : “azure”

  },

  {

   “mux_format”:”dash”,

   “input_format” : “avi”,

   “output_video_codec” : “h.264|h.265”,

   “ouput_audio_codec” : “ac3|aac”,

   “transcode_engine” : “azure”

  }

]

Lacuna in this case are:

  • Upfront capability awareness
  • No adaptability to capabilities churns
  • No consideration on SLA, Cost and Quality
  • No easy extensibility to additional factors. 
  •  

Dynamic Brokering

Schematic System Model

 Screen Shot 2017-03-13 at 9.07.43 AM.png

 

  

Unlike static brokering where the rules are defined upfront knowing the capabilities and refining them when churn happens, the Dynamic Brokering method is more suitable method with three simple step assessment to determine the suitable transcoding engine for transcoding using the Pugh Matrix analyzer. 

 

 

  • Capability Assessment :  This is first step in the three step assessment process. Capability Manage unit is the core for the first level assessment, where it discovers all the capabilities of the available transcode engine in the given deployment. This happens  on the periodic basis or when any upgrade is triggered for the transcode engines. Once the capability is discovered, it's maintained as Indented Capability Matrix (ICM) to facilitate any future lookup. 


  •  

Similarly the other managing unit like Quality Manage Unit, SLA manage unit, Cost manage unit will learn performance metrics, Cost policy, Quality metrics on periodic basis against each muxing format or for a group processing of the muxing format from the transcode engine to rate them accordingly, which will be later used by the Pugh Matrix analyzer for ranking the transcode engine based on its individual rate assessment which is  done over a period of time. These rating will be dynamically adjusted based on transcode engine efficiency and performance against each measuring criteria like Cost, SLA and Quality.

            Schematic Indented Capability Matrix (ICM) would look like the below.

 

 

Transcode Engine Id

Mux Format

Video Codec

Audio Codec

(Audio profile, Channel mixing, etc.)

TE-1

HLS

H.264

AAC

....

TE-1

HLS

AVC

AAC

....

TE-2

DASH

H.265

AC3

....

TE-2

DASH

H.265

EAC3

....

TE-3

HLS

H.264

AAC

....

 

Once the Brokering unit receives the asset/media file for transcoding with the corresponding processing profile, it passes on the information to Pugh Matrix analyzer to execute the dynamic brokering using the simple three step assessment. The Pugh Matrix first does the capability assessment with the help of the capability manage unit. This is where the processing profile info with the ICM to pick the possible transcode engine for each MUX format. This assessment could possibly yield more than one transcode engines for a mux format ( say for example, the processing profile instructs for the output HLS with video codec as H.264 and audio codec as AAC, then based on the above sample ICM table the capability manage unit would select two transcoding engines TE-1 and TE-3). In case, one transcode engine is selected then brokering unit would stop processing it for further assessment and route the transcoding request to the selected transcoding engine. However, if more than one transcode engines are selected, then brokering unit would further move forward with the second which is Lone Mux format assessment.

 

  • Lone MUX format assessment : This assessment is performed once the capability assessment is complete with the result of more than one transcode engines selected for processing the asset/media file. In here, the Pugh Matrix analyzer uses the  “SLA Manage Unit” to get the ranking view of the selected transcoded engines with respect to the Committed SLA for the given MUX format. Similarly, Pugh Matrix analyzer uses “Cost Manage unit” to understand the cost incurred to transcode for each MUX format and ranks the selected transcode engines accordingly (say low cost would be rated higher rank compared to others) and further it uses “Quality Manager Unit” to infer the quality of the output generated by the transcode engine by receiving the quality score against each transcoding engine selected for each MUX format. Once the ranking of all transcoding engine against measuring criteria like SLA, Cost and Quality is completed, the Pugh Matrix analyzer would apply the customer precedence model, which can indicate customer weightage against each measuring criteria, and generates the score for each transcode engine.The highly scored transcoded engine post applying the customer precedence model shall be selected as a preferred transcoding engine.


 

Lone Mux format assessment

Measuring Criteria

Customer Weightage

Transcode Engine-1

Rank (Score)

Transcode Engine-2

Rank (Score)

Cost

0.25

1 (0.25)

2 (0.5)

SLA

0.5

2 (1.0)

1 (0.5)

Quality

0.25

1 (0.25)

1 (0.25)

Total Score

 

1.50

1.25

 

In the above table, transcode engine-2 score better in Cost, Transcode Engine -1 scores better in SLA and with respect to quality both the transcode engines are rated same (greater the rank better the transcode engine). You can also notice the column 2 above indicating the customer precedence against the measuring criteria, where customer prefers to give more weightage to  SLA and provides same weightage for Cost and Quality. The customer weightage is then applied on the ranking to get the score against each measuring criteria [ say, Cost score for transcode engine-1 is 0.25 = ( Rank * customer weightage) ]. Overall score for the transcode engine is computed by summing the individual score of transcoding engine against each measuring criteria ( say in the above case, the total score for Transcode engine -1 is 1.50 and Transcode engine -2 is 1.5, which means currently the Transcoding Engine -1 has an edge over Transcoding engine -2).

  • Collective Mux format assessment:  The collective Mux format assessment is similar to the Lone Mux format assessment, where in here, the ranking of transcoding engines are assessed against the measuring criteria considering all the possible mux formats processed in same transcoding engine. The score can change considerably if transcoding engine supports dynamic transcoding, hence collective mux format assessment is performed to pick the suitable transcoding engine considering the collective processing of the mux format in a transcoding engine. Once total score is computed for collective mux format assessment, the score is compared with the previous Lone Mux format assessment score and Pugh Matrix analyzer pick the suitable and efficient transcode engine for processing (higher the score, greater the efficiency).

 

Collective Mux format assessment

Measuring Criteria

Customer Weightage

Transcode Engine-1

Rank (Score)

Transcode Engine-2

Rank (Score)

Cost

0.25

1 (0.25)

2 (0.5)

SLA

0.5

1 (0.5)

2 (1.0)

Quality

0.25

1 (0.25)

1 (0.25)

Total Score

 

1.0

1.75

 

Based on the above example on collective MUX format assessment, the transcode engine -1 score 1.0 and transcode engine -2 score 1.75; However the previous lone MUX format assessment score are less than the Transcode engine - 2 score in collective MUX format assessment. Hence in this case, transcode engine 2 will be selected by the Pugh Matrix analyzer and intimated to transcode brokering unit for routing the request to selected transcode engine for transcode processing.

 

 

Lone Mux Format Assessment

Collective Mux Format assessment

Transcode Engine -1

Transcode Engine -2

Transcode Engine -1

Transcode Engine -2

1.5

1.25

1.0

1.75

 

 

Note: When more than one transcode engine selected in fulfilling the single transcoding workflow of an asset (say MUX format HLS and DASH Transcode engine 1 is selected and for Muxing format MP4 transcode engine 2 is selected), then brokering unit with aggregate the muxing formats based on the transcode engine and route the request accordingly ( say it creates aggregated mux formats (HLS & DASH) routing the request to transcode engine 1 and generate/route MUX format MP4 request  to transcode engine 2) and also aggregates the response to propagate the response to the transcoding workflow accordingly.

 

 

 

Conclusion

There are various techniques adopted for the transcode brokering in the market, however, in this write-up, I tried to explain one simple static and medium complex dynamic way of transcode request brokering in the heterogenous transcode engine cloud platforms, which would potentially increase the efficiency of the media transcoding in an integrated transcode workflow.