HTTP Live Streaming (HLS) tools

Delivering video over HTTP is up and coming. The two protocols that seem to be winning (currently) are HLS and HDS. These are my notes from playing around with HLS.

If you want to play HLS on Linux, this python player works: . Sometimes recent VCL 2.0.3 works, but not always (and the progress bar behaves very strangely..)

If you want to dump an HLS stream to a single .ts file, use this tool:

If you want to dump a HLS VOD (video on demand, premade) stream to local disk to play with; try out my quick hls-mirror script:

If you want to segment some media file for later video-on-demand delivery, using bleeding edge avconv (with just libx264+lamemp3) from git:

avconv -i big_buck_bunny_720p_surround.avi -vcodec h264 -acodec mp3 -hls_time 10 -hls_list_size 999999999 foo/output.m3u8

hls_list_size seems to be how many items (of the n made) that should appear in the m3u8 file. Setting to 0 actually means an empty m3u8, so useful!

The outputted files works on my android 4.1 and on my desktop.

Why all this you ask? Because video over HTTP works very well through Varnish, even better with streaming (cut-through forwarding) enabled. Even on mediocre DSL you can make a continous stream/file set, push to a Varnish on AWS/whatever, and anyone can broadcast live to the world. Slightly delayed, but standards based, simple to do and simple to scale.

I think we’ve just seen the start of how cool (and disrupting) this will become.

This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

2 Responses to HTTP Live Streaming (HLS) tools

  1. Gowtham Rupavatharam says:

    When we had tried the above command on Ubuntu 12.04 & Ubuntu 11.04 it keeps saying “Unknown encoder ‘h264’. It prints the following output

    avconv -i big_buck_bunny_480p.ogv -vcodec h264 -acodec mp3 -hls_time 10 -hls_list_size 999999999 big_buck.m3u8
    avconv version v9-1383-g2cf5d29, Copyright (c) 2000-2013 the Libav developers
    built on May 28 2013 18:25:37 with gcc 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)
    [theora @ 0xa98aac0] 7 bits left in packet 82
    Input #0, ogg, from ‘big_buck_bunny_480p.ogv’:
    Duration: 00:00:32.99, start: 0.000000, bitrate: 1057 kb/s
    Stream #0.0: Video: theora, yuv420p, 720×400, 25 fps, 25 tbn, 25 tbc
    ENCODER : ffmpeg2theora 0.19
    Stream #0.1: Audio: vorbis, 48000 Hz, stereo, fltp, 80 kb/s
    ENCODER : ffmpeg2theora 0.19
    Unknown encoder ‘h264’

    Any suggestions would be helpful….

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s