HLS | Video Streaming Performance Testing

Hello everybody, I recently had a chance to make a proof of concept on HLS (HTTP Live Streaming) performance testing project. Let me tell you how to achieve this problem.

In this example, I’m going to do my demonstration on a real m3u8 file.

Our link is qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8 

First Step

You need to make an HTTP call to this m3u8 file. After making that request, you’ll notice that the response is not something you see every day. Not an HTML, XML or JSON file. It’s something different.

Example:
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=688301
http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/0640_vod.m3u8

#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=165135
http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/0150_vod.m3u8

You need to capture m3u8 chucks and make a request to them.

So we add Regular expression Extractor to our HTTP Sampler.

So we capture the numeric expression located in “0640_vod.m3u8” or “0150_vod.m3u8” keywords.

Second Step

We need to add a ForEach Controller to make a request to all those chucks.

Third Step

Create a new HTTP sampler and make a request to them by passing the chunk name capture in the previous request.  I use the output variable name defined in the second step and pass it as a parameter to my new URL.

Fourth Step

We are ready to make a request to captured chunks but one step is missing. That keeping the streaming alive. Just run your test once and see the output. You have another different response coming from the chunks.

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10,
0640/06400.ts
#EXTINF:10,
0640/06401.ts
#EXTINF:10,
0640/06402.ts

All you need to do is capturing the “*.ts” keywords. So we create another RegEx Extractor and extract ts links.

Fifth Step

Add one other ForEach controller, pass Streams variable as an input to it so you’ll be able to fetch through it.

Lastly, Create an HTTP Sampler to make a request to those ts links.

We are ready to conduct a performance test on any HLS streaming platform.

[fusion_widget_area name=”avada-custom-sidebar-performancetestingwidget” title_size=”” title_color=”” background_color=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=”” id=”” /]

Thanks.
-Canberk

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.