Code Monkey home page Code Monkey logo

hls-monitor's Introduction

HLS-monitor

Console script to monitor that HLS links are accessible (supports adaptive streaming)

Install via Composer

composer require lezhnev74/hls-monitor

Usage

Package comes with a console file located at vendor/bin/hls-monitor. Check that playlist is available and all it's streams are accessible from the Internet (in 10 simultaneous connections)

vendor/bin/hls-monitor playlists --log log.txt --concurrency=10 https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8

Output will be something like this:

#---------------------------------------------------
Executed on node: <YOUR_PUBLIC_IP>
Date of execution: 29.11.2016, 10:04 UTC
#---------------------------------------------------

Concurrency level:50
Playlists fetching is over in 0.7s
Streams fetching is over in 0.68s
Chunks fetching is over in 255.22s

The console command will return code 0 if no problems found. In case of some stream is not accessible, you will see someting like this:

#---------------------------------------------------
Executed on node: <YOU_PUBLIC_IP>
Date of execution: 29.11.2016, 11:11 UTC
#---------------------------------------------------

Downloading playlist...DONE
Playlist is located on: 127.0.0.1
Found streams in playlist: 3
Started checking streams
Stream is not accessible: http://m3u8provider.dev.com/stream2.m3u8
Stream has unaccessible chunks:
|--Chunk: http://m3u8provider.dev.com/04.ts
|--Chunk: http://m3u8provider.dev.com/05.ts
|---
Checking Streams is DONE

Reporting

At this version library has no reporting capabilities.

You will have to write a wrapper for this tool which will capture all of the failed output and will email it to you or report to somewhere.

Pseudo code looks like this:

$playlists = [...many playlists to check...];
$failed_reports = [];

// for each given playlist - make checking
$output = [];
$return_code = 0;
exec('vendor/bin/hls-monitor playlists '.implode(",",$playlists), $output, $return_code);   
   
if($return_code) {
   // there were problems with this palylist
   $failed_reports[] = $output;
}


// then report if anything is not good
if(count($failed_reports)) {
   // mail reports to somewhere
}

hls-monitor's People

Contributors

lezhnev74 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.