Commit Graph

11 Commits

Author SHA1 Message Date
koln67 28074e5c96
[HLS] Add support for independent segments tag
Fixes #564.
2020-08-19 11:17:21 -07:00
Daniel Cantarín 7aab7a8b50
Add --hls_media_sequence_number to support custom value in HLS
HLS uses the EXT-X-MEDIA-SEQUENCE tag at the start of a live playlist in
order to specify the first segment sequence number. This is because any
live playlist have a limited number of segments, and they also keep
updating with new segments while removing old ones. When a player refreshes
the playlist, this information is important for keeping track of segments
positions.

When the packager starts, it naturally starts this count from zero. However,
there are many situations where the packager may be restarted, without this
meaning starting this value from zero (but continuing a previous sequence).
The most common situations are problems in the encoder feeding the packager.

With those cases in mind, this parameter allows to set the initial
EXT-X-MEDIA-SEQUENCE value. This way, it's possible to continue the sequence
number from previous packager run.

Closes #691.
2020-01-31 10:25:19 -08:00
KongQun Yang 3c26dfbd53 Estimate target duration in bandwidth calculation from initial blocks
We used to use the target segment duration provided by the user.
Unfortunately that does not work for iframe only playlist which
the target duration is effectively equal to the GOP duration.

In the new approach, we estimate the target duration from the initial
few blocks (10 blocks right now).

Fixes #610.

Change-Id: Ie8bf943e157149ca7ed3b9382fe0a1088d0774e2
2019-07-11 17:45:55 -07:00
KongQun Yang 4b97a6d8a2 Add support for --default_text_language
It allows users to override the default language for text tracks.

If not specified, --default_language applies to both audio and text
tracks.

Issue #430.

Change-Id: I86a9baba2072be27b6661fa7b65a8bc8b6adb3cc
2018-11-26 13:42:58 -08:00
KongQun Yang 74df8d30cc Exclude short segments from peak bandwidth computation
https://tools.ietf.org/html/rfc8216#section-4.1
The peak segment bit rate of a Media Playlist is the largest bit rate
of any contiguous set of segments whose total duration is between 0.5
and 1.5 times the target duration.

Fixes #498.

Change-Id: I1f28972b9cc5977735e47906bdcd88ba3942db5a
2018-11-26 20:02:09 +00:00
KongQun Yang a7463f60c1 Enable segment auto removal for live packaging
The number of preserved segments outside live window can be
configured using flag --preserved_segments_outside_live_window,
which is default to 50, i.e. 5 minutes for 6s segment.

Note that the segment removal will be disabled if it is set to 0.

Only HLS live playlist and DASH dynamic MPD are affected by this flag.

- Also add end to end tests.

Fixes #223.

Change-Id: I8a566efebe2f1552c7d9509ab017bade5a4a1c98
2018-05-02 00:18:42 +00:00
KongQun Yang 37d4ff017f Support removing segments outside of live window in HLS
Issue: #223

Change-Id: Ib91c60268d8df9adbaf5f6cac77eaebd6a3edb6e
2018-04-30 17:25:39 -07:00
KongQun Yang 32d26094ba [HLS] Support AUTOSELECT and DEFAULT in EXT-X-MEDIA
According to HLS spec: https://goo.gl/MiqjNd 4.3.4.1.1. Rendition Groups
- A Group MUST NOT have more than one member with a DEFAULT attribute of
  YES.
- Each EXT-X-MEDIA tag with an AUTOSELECT=YES attribute SHOULD have a
  combination of LANGUAGE[RFC5646], ASSOC-LANGUAGE, FORCED, and
  CHARACTERISTICS attributes that is distinct from those of other
  AUTOSELECT=YES members of its Group.

We tag the first rendition with a particular language in an audio group
with 'AUTOSELECT'; it is tagged with 'DEFAULT' too if the language
matches --default_language.

Fixes #315

Change-Id: Iacc0bc8c89ebffce8717fa65e82d6daf5a1f6adc
2018-01-19 02:10:07 +00:00
KongQun Yang 5cf2b17ade Add --hls_key_uri to allow setting fairplay/identity key uri
Change-Id: I52e0f56cd10390faf515170f407ea488a6b3c9fc
2017-11-14 15:49:27 +00:00
KongQun Yang 675f2631b8 Move HlsParams to hls_params.h
Change-Id: I25189623512834da8bd998c388c4cb0edebc6f47
2017-08-18 11:57:41 -07:00
KongQun Yang b451d3a7ca Consolidate various playlist_type types
Change-Id: If6fafc0867e7e1f3cd2ed612617e91c7cb144f20
2017-07-21 20:43:14 +00:00