Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install hlsclient

How to install hlsclient

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install hlsclient
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.3.1
0.5.3Never BuiltWhy not?
0.3.1 Available View build log
0.1.4 Available View build log
Windows (64-bit)
0.1.4
0.5.3Never BuiltWhy not?
0.1.4 Available View build log
Mac OS X (10.5+)
0.3.1
0.5.3Never BuiltWhy not?
0.3.1 Available View build log
0.1.4 Available View build log
Linux (32-bit)
0.3.1
0.5.3Never BuiltWhy not?
0.3.1 Available View build log
0.1.4 Available View build log
Linux (64-bit)
0.5.3 Available View build log
0.3.1 Available View build log
0.1.4 Available View build log
 
Author
Lastest release
version 0.5.3 on Jan 9th, 2014

This is a simple Python HTTP Live Streaming Client. It consumes a list of remote playlists, and saves all needed files to serve the playlist locally: the key, segments, and a modified m3u8 with paths normalized.

It also supports backups, i.e., if the same playlist is available on more than one server, it will track each server status and will switch to the backup if needed.

Through the config.ini it's possible to customize where the files will be saved and what is the URL that provides servers info via JSON.

The JSON must be something like:

{
    "streams": [
        "nasa": {
            "input-path": "/msfc/Edge.m3u8",
            servers: [
                "http://liveips.nasa.gov.edgesuite.net"
            ]
        }
    ]
}

Variant Playlist Generation

hlslcient can consume multiple playlists and generate a variant playlists grouping then.

To do so, include a bandwidth for each stream and add an action to combine them in the JSON:

{
    "streams": {
        "Nasa-low": {
            "input-path": "/msfc/Edge.m3u8",
            "servers": ["http://liveips.nasa.gov.edgesuite.net"],
            "bandwidth": 254082
        },
        "Nasa-medium": {
            "input-path": "/msfc/3G.m3u8",
            "servers": ["http://liveips.nasa.gov.edgesuite.net"],
            "bandwidth": 460658
        },
        "Nasa-high": {
            "input-path": "/msfc/Wifi.m3u8",
            "servers": ["http://liveips.nasa.gov.edgesuite.net"],
            "bandwidth": 1080434
        }
    },

    "actions": [
        {
            "type": "combine",
            "input": ["Nasa-low", "Nasa-medium", "Nasa-high"],
            "output": "/msfc/nasa_mbr.m3u8"
        }
    ]
}

Transcoding

hlsclient is also able to create an audio only track from a video stream using FFMPEG.

To do so, add a transcode action an include the new stream on a combine action:

"actions": [
    {
        "type": "combine",
        "input": ["Nasa-audio-only", "Nasa-low", "Nasa-medium", "Nasa-high"],
        "output": "/msfc/nasa_mbr.m3u8"
    },
    {
        "type": "transcode",
        "input": "Nasa-low",
        "output": {
            "audio": {
                "Nasa-audio-only": {
                    "path": "Nasa-audio-only.m3u8",
                    "audio-bitrate": 64000,
                    "bitrate": 65000
                }
            }
        }
    }
]

Encryption

If you set encryption=true in the config file, hlsclient will automatically encrypt all streams with a random AES-128 cipher.

Running

To run the client, simply run:

$ python -m hlsclient

Running tests

You will need ffmpeg and mediainfo installed.

$ ./runtests

FFmpeg Installation

In order to use the current version of hlsclient with transcoding support, you must have ffmpeg installed with libaac and libx264. Download them and compile FFfmpeg like this:

  • libaac:

    ./configure && make && sudo make install
    
  • libx264:

    ./configure --enable-shared && make && sudo make install
    
  • FFmpeg:

    ./configure --enable-libx264 --enable-gpl --enable-libfaac --enable-nonfree --enable-shared && make && sudo make install
    

The tested versions were:

  • libaac: faac-1.28
  • libx264: x264-snapshot-20121030-2245
  • FFmpeg: N-46213-g976175f

Subscribe to package updates

Last updated Jan 9th, 2014

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.