[FFmpeg-trac] #2886(avformat:new): HLS source with multiple variants is not optimally handled
FFmpeg
trac at avcodec.org
Thu Sep 18 01:38:06 CEST 2014
#2886: HLS source with multiple variants is not optimally handled
-------------------------------------+------------------------------------
Reporter: sinkers | Owner:
Type: enhancement | Status: new
Priority: wish | Component: avformat
Version: git-master | Resolution:
Keywords: HLS | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+------------------------------------
Comment (by sinkers):
How are you defining what are unneeded variants?
If you like I am happy to contribute some kind of spec for this if you
think it would help and also happy to assist with samples and testing.
Generally the behaviour for this should be as follows:
1. Parse the master playlist and extract all variants (including alternate
audio and text)
2. Start with the lowest bitrate variant
3. Calculate what sort of bandwidth we have by measuring the download of
the lowest variant. If the variant playlist doesn't include the bitrate
against each stream then until the bitrates have been downloaded assume
that they are in order e.g. lowest first
4. As quickly as possibly move to the variant that most closely matches
the current bandwidth
5. Monitor the fill rate of the buffer to get an idea of current bandwidth
and if required switch to a variant with a bandwidth closest to the
observed bandwidth
Note that the dash.js client isn't a bad reference on handling the
heuristics for ABR (but not the HLS part) and probably better than the VLC
example above, the latest version is here:
http://dashif.org/reference/players/javascript/1.2.0/index.html
and the code is here: https://github.com/Dash-Industry-
Forum/dash.js/tree/development/app
For HLS parsing there is a good example (in Javascript) here:
https://github.com/videojs/videojs-contrib-hls/tree/master/src
--
Ticket URL: <https://trac.ffmpeg.org/ticket/2886#comment:9>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list