Giter Site home page Giter Site logo

m3u8-parser's Introduction

m3u8-parser

Build Status Greenkeeper badge Slack Status

NPM

m3u8 parser

Installation

npm install --save m3u8-parser

The npm installation is preferred, but Bower works, too.

bower install  --save m3u8-parser

Usage

var manifest = [
  '#EXTM3U',
  '#EXT-X-VERSION:3',
  '#EXT-X-TARGETDURATION:6',
  '#EXT-X-MEDIA-SEQUENCE:0',
  '#EXT-X-DISCONTINUITY-SEQUENCE:0',
  '#EXTINF:6,',
  '0.ts',
  '#EXTINF:6,',
  '1.ts',
  '#EXT-X-PROGRAM-DATE-TIME:2019-02-14T02:14:00.106Z'
  '#EXTINF:6,',
  '2.ts',
  '#EXT-X-ENDLIST'
].join('\n');

var parser = new m3u8Parser.Parser();

parser.push(manifest);
parser.end();

var parsedManifest = parser.manifest;

Parsed Output

The parser ouputs a plain javascript object with the following structure:

Manifest {
  allowCache: boolean,
  endList: boolean,
  mediaSequence: number,
  dateRanges: [],
  discontinuitySequence: number,
  playlistType: string,
  custom: {},
  playlists: [
    {
      attributes: {},
      Manifest
    }
  ],
  mediaGroups: {
    AUDIO: {
      'GROUP-ID': {
        NAME: {
          default: boolean,
          autoselect: boolean,
          language: string,
          uri: string,
          instreamId: string,
          characteristics: string,
          forced: boolean
        }
      }
    },
    VIDEO: {},
    'CLOSED-CAPTIONS': {},
    SUBTITLES: {}
  },
  dateTimeString: string,
  dateTimeObject: Date,
  targetDuration: number,
  totalDuration: number,
  discontinuityStarts: [number],
  segments: [
    {
      title: string,
      byterange: {
        length: number,
        offset: number
      },
      duration: number,
      programDateTime:  number,
      attributes: {},
      discontinuity: number,
      uri: string,
      timeline: number,
      key: {
        method: string,
        uri: string,
        iv: string
      },
      map: {
        uri: string,
        byterange: {
          length: number,
          offset: number
        }
      },
      'cue-out': string,
      'cue-out-cont': string,
      'cue-in': string,
      custom: {}
    }
  ]
}

Supported Tags

Basic Playlist Tags

Media Segment Tags

Media Playlist Tags

Master Playlist Tags

Experimental Tags

m3u8-parser supports 3 additional Media Segment Tags not present in the HLS specification.

EXT-X-CUE-OUT

The EXT-X-CUE-OUT indicates that the following media segment is a break in main content and the start of interstitial content. Its format is:

#EXT-X-CUE-OUT:<duration>

where duration is a decimal-floating-point or decimal-integer number that specifies the total duration of the interstitial in seconds.

EXT-X-CUE-OUT-CONT

The EXT-X-CUE-OUT-CONT indicates that the following media segment is a part of interstitial content and not the main content. Every media segment following a media segment with an EXT-X-CUE-OUT tag SHOULD have an EXT-X-CUE-OUT-CONT applied to it until there is an EXT-X-CUE-IN tag. A media segment between a EXT-X-CUE-OUT and EXT-X-CUE-IN segment without a EXT-X-CUE-OUT-CONT is assumed to be part of the interstitial. Its format is:

#EXT-X-CUE-OUT-CONT:<n>/<duration>

where n is a decimal-floating-point or decimal-integer number that specifies the time in seconds the first sample of the media segment lies within the interstitial content and duration is a decimal-floating-point or decimal-integer number that specifies the total duration of the interstitial in seconds. n SHOULD be the sum of EXTINF durations for all preceding media segments up to the EXT-X-CUE-OUT tag for the current interstitial. duration SHOULD match the duration specified in the EXT-X-CUE-OUT tag for the current interstitial.'

EXT-X-CUE-IN

The EXT-X-CUE-IN indicates the end of the interstitial and the return of the main content. Its format is:

#EXT-X-CUE-IN

There SHOULD be a closing EXT-X-CUE-IN tag for every EXT-X-CUE-OUT tag. If a second EXT-X-CUE-OUT tag is encountered before an EXT-X-CUE-IN tag, the client MAY choose to ignore the EXT-X-CUE-OUT and treat it as part of the interstitial, or reject the playlist.

Example media playlist using EXT-X-CUE- tags.

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXTINF:10,
0.ts
#EXTINF:10,
1.ts
#EXT-X-CUE-OUT:30
#EXTINF:10,
2.ts
#EXT-X-CUE-OUT-CONT:10/30
#EXTINF:10,
3.ts
#EXT-X-CUE-OUT-CONT:20/30
#EXTINF:10,
4.ts
#EXT-X-CUE-IN
#EXTINF:10,
5.ts
#EXTINF:10,
6.ts
#EXT-X-ENDLIST

Not Yet Supported

Custom Parsers

To add a parser for a non-standard tag the parser object allows for the specification of custom tags using regular expressions. If a custom parser is specified, a custom object is appended to the manifest object.

const manifest = [
  '#EXTM3U',
  '#EXT-X-VERSION:3',
  '#VOD-FRAMERATE:29.97',
  ''
].join('\n');

const parser = new m3u8Parser.Parser();
parser.addParser({
  expression: /^#VOD-FRAMERATE/,
  customType: 'framerate'
});

parser.push(manifest);
parser.end();
parser.manifest.custom.framerate // "#VOD-FRAMERATE:29.97"

Custom parsers may additionally be provided a data parsing function that take a line and return a value.

const manifest = [
  '#EXTM3U',
  '#EXT-X-VERSION:3',
  '#VOD-FRAMERATE:29.97',
  ''
].join('\n');

const parser = new m3u8Parser.Parser();
parser.addParser({
  expression: /^#VOD-FRAMERATE/,
  customType: 'framerate',
  dataParser: function(line) {
    return parseFloat(line.split(':')[1]);
  }
});

parser.push(manifest);
parser.end();
parser.manifest.custom.framerate // 29.97

Custom parsers may also extract data at a segment level by passing segment: true to the options object. Having a segment level custom parser will add a custom object to the segment data.

const manifest = [
    '#EXTM3U',
    '#VOD-TIMING:1511816599485',
    '#EXTINF:8.0,',
    'ex1.ts',
    ''
  ].join('\n');

const parser = new m3u8Parser.Parser();
parser.addParser({
  expression: /#VOD-TIMING/,
  customType: 'vodTiming',
  segment: true
});

parser.push(manifest);
parser.end();
parser.manifest.segments[0].custom.vodTiming // #VOD-TIMING:1511816599485

Custom parsers may also map a tag to another tag. The old tag will not be replaced and all matching registered mappers and parsers will be executed.

const manifest = [
    '#EXTM3U',
    '#EXAMPLE',
    '#EXTINF:8.0,',
    'ex1.ts',
    ''
  ].join('\n');

const parser = new m3u8Parser.Parser();
parser.addTagMapper({
  expression: /#EXAMPLE/,
  map(line) {
    return `#NEW-TAG:123`;
  }
});
parser.addParser({
  expression: /#NEW-TAG/,
  customType: 'mappingExample',
  segment: true
});

parser.push(manifest);
parser.end();
parser.manifest.segments[0].custom.mappingExample // #NEW-TAG:123

Including the Parser

To include m3u8-parser on your website or web application, use any of the following methods.

<script> Tag

This is the simplest case. Get the script in whatever way you prefer and include it on your page.

<script src="//path/to/m3u8-parser.min.js"></script>
<script>
  var parser = new m3u8Parser.Parser();
</script>

Browserify

When using with Browserify, install m3u8-parser via npm and require the parser as you would any other module.

var m3u8Parser = require('m3u8-parser');

var parser = new m3u8Parser.Parser();

With ES6:

import { Parser } from 'm3u8-parser';

const parser = new Parser();

RequireJS/AMD

When using with RequireJS (or another AMD library), get the script in whatever way you prefer and require the parser as you normally would:

require(['m3u8-parser'], function(m3u8Parser) {
  var parser = new m3u8Parser.Parser();
});

License

Apache-2.0. Copyright (c) Brightcove, Inc

m3u8-parser's People

Contributors

adrums86 avatar alex-barstow avatar brandonocasey avatar dmlap avatar essk avatar forbesjo avatar genteure avatar gesinger avatar gjanblaszczyk avatar gkatsev avatar greenkeeper[bot] avatar harisha-swaminathan avatar kchang-brightcove avatar keisans avatar masterful avatar maysjtu avatar misteroneill avatar mjneil avatar owenedwards avatar peterblazejewicz avatar zshenker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

m3u8-parser's Issues

Any plans to support trickplay manifest formats?

https://developer.roku.com/en-ca/docs/developer-program/media-playback/trick-mode/hls-and-dash.md

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:54
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-IMAGES-ONLY
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:54,
#EXT-X-TILES:RESOLUTION=312x176,LAYOUT=3x3,DURATION=6
Thumbnail_000000001.jpg
#EXTINF:54,
#EXT-X-TILES:RESOLUTION=312x176,LAYOUT=3x3,DURATION=6
Thumbnail_000000002.jpg
#EXTINF:54,
#EXT-X-TILES:RESOLUTION=312x176,LAYOUT=3x3,DURATION=6
Thumbnail_000000003.jpg
#EXTINF:54,
#EXT-X-TILES:RESOLUTION=312x176,LAYOUT=3x3,DURATION=6
Thumbnail_000000004.jpg
#EXTINF:54,
#EXT-X-TILES:RESOLUTION=312x176,LAYOUT=3x3,DURATION=6
Thumbnail_000000005.jpg
#EXTINF:54,
#EXT-X-TILES:RESOLUTION=312x176,LAYOUT=3x3,DURATION=6
Thumbnail_000000006.jpg
#EXTINF:54,
#EXT-X-TILES:RESOLUTION=312x176,LAYOUT=3x3,DURATION=6
Thumbnail_000000007.jpg
#EXTINF:54,
#EXT-X-TILES:RESOLUTION=312x176,LAYOUT=3x3,DURATION=6
Thumbnail_000000008.jpg
#EXTINF:54,
#EXT-X-TILES:RESOLUTION=312x176,LAYOUT=3x3,DURATION=6
Thumbnail_000000009.jpg
#EXTINF:54,
#EXT-X-TILES:RESOLUTION=312x176,LAYOUT=3x3,DURATION=6
Thumbnail_000000010.jpg
#EXTINF:54,
#EXT-X-TILES:RESOLUTION=312x176,LAYOUT=3x3,DURATION=6
Thumbnail_000000011.jpg
#EXTINF:2,
#EXT-X-TILES:RESOLUTION=312x176,LAYOUT=3x3,DURATION=2
Thumbnail_000000012.jpg
#EXT-X-ENDLIST

m3u8 builder?

How do I get the JSON structure back out as a .m3u8 file?

My use case is that I simply need to add a NAME & RENDITION-ID to each item.

Btw my employers are Brightcove customers.

help on simple boolean response

Hi,

I was wondering if there was a simple way to parse an m3u8 using this and to return a simple true/false on whether the m3u8 is working?

Thanks!

An in-range update of karma is breaking the build 🚨

The devDependency karma was updated from 3.1.1 to 3.1.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

karma is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v3.1.2

Bug Fixes

Features

Commits

The new version differs by 11 commits.

  • 7d4d347 chore: release v3.1.2
  • 5077c18 chore: update contributors
  • fb05fb1 fix(server): use flatted for json.stringify (#3220)
  • 2682bff feat(docs): callout the key debug strategies. (#3219)
  • 4e87902 fix(changelog): remove release which does not exist (#3214)
  • 30ff73b fix(browser): report errors to console during singleRun=false (#3209)
  • 5334d1a fix(file-list): do not preprocess up-to-date files (#3196)
  • dc5f5de fix(deps): upgrade sinon-chai 2.x -> 3.x (#3207)
  • d38f344 fix(package): bump lodash version (#3203)
  • ffb41f9 refactor(browser): log state transitions in debug (#3202)
  • 240209f fix(dep): Bump useragent to fix HeadlessChrome version (#3201)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Report error for non-quoted attribute strings

Greetings
I'm using VideoJS with HLS and I'm receiving exceptions for this line:

attr = (/([^=]*)=(.*)/).exec(attrs[i]).slice(1);

(parse-stream.js line 40)

The problem is, the attribute array is like this:

1:"PROGRAM-ID=1"
2:""
3:"BANDWIDTH=650000"
4:""
5:"RESOLUTION=600x356"
6:""
7:"CODECS=avc1.66.31"
8:",mp4a.40.2"

probably because it's parsed from a m3u8 manifest.

On the first line parsed, line 8, the regex returns undefined so there is no slice() method.

I'm not sure if parseAttributes() should be receiving this, but it definitely should check the regex result before using it.

An in-range update of babel7 is breaking the build 🚨

There have been updates to the babel7 monorepo:

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

babel7 is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Widevine + Fairplay multi-drm stream

Looks like stream, configured with multi-drm setup, Widevine + Fairplay, conflicts with AES-128 encryption detection.

In my m3u8 playlist there are two EXT-X-KEY rows, like

#EXT-X-KEY:METHOD=SAMPLE-AES,URI="data:text/plain;base64,...",KEYID=...,IV=...,KEYFORMATVERSIONS="1",KEYFORMAT="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"
#EXT-X-KEY:METHOD=SAMPLE-AES,URI="skd://...",KEYFORMATVERSIONS="1",KEYFORMAT="com.apple.streamingkeydelivery"

First one β€” is for Widevine, second one is for Fairplay.

This stream is correctly played in Safari, but not in Chrome.
Parser correctly recognises Widevine options, but second row is recognised like AES-128 key for segments. And later, VideoJS segment loader fails to load "key" by skd:// URL, thus failing to play stream.

Shaka Player plays this stream in Chrome without errors, I guess, because there is no AES-128 support in it (shaka-project/shaka-player#850).

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected πŸ€–


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Stringify parsed manifest

Is there a way to turn a parsed manifest back into m3u8 format? I need to parse, modify, and then save an m3u8 file and I can't tell how save the manifest back to text format.

4.5.1 with Typescript crash (vhs-utils)

Hello, my project crash with m3u8-parser (4.5.1) and MR #118 @brandonocasey

Environment: Linux
Tested on Windows and working but not on Linux, and working with downgrade to 4.5.0 with Linux.

/root/project/node_modules/@videojs/vhs-utils/es/stream.js:121
export { Stream as default };
^^^^^^

SyntaxError: Unexpected token 'export'
    at wrapSafe (internal/modules/cjs/loader.js:1116:16)
    at Module._compile (internal/modules/cjs/loader.js:1164:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Module.require (internal/modules/cjs/loader.js:1089:19)
    at require (internal/modules/cjs/helpers.js:73:18)
    at Object.<anonymous> (/root/project/node_modules/m3u8-parser/dist/m3u8-parser.cjs.js:9:30)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Module.require (internal/modules/cjs/loader.js:1089:19)
    at require (internal/modules/cjs/helpers.js:73:18)
    at Object.<anonymous> (/root/project/src/m3u8.ts:3:20)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)

An in-range update of doctoc is breaking the build 🚨

The devDependency doctoc was updated from 1.3.1 to 1.4.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

doctoc is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 2 commits.

  • 164f78e 1.4.0
  • d003dce fix(deps): replace markdown-to-ast with @textlint/markdown-to-ast

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

parse title from extinf

Hi there,

how can I parse title from the extint?
reference

I create

parser.addParser({
                    expression: /#EXTINF/,
                    customType: 'audio',
                    segment: true,
                    dataParser: function (line) {
                        const valuePart = line.split(':')
                        const values = valuePart[1].split(',')
                        const duration = parseFloat(values[0])
                        const title = values[1]
                        return {
                            duration,
                            title
                        };
                    }
                });

but only work for the last item, and the segment doesn't contain anything

An in-range update of conventional-changelog-cli is breaking the build 🚨

The devDependency conventional-changelog-cli was updated from 2.0.5 to 2.0.7.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

conventional-changelog-cli is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of rollup is breaking the build 🚨

The devDependency rollup was updated from 1.27.6 to 1.27.7.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rollup is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v1.27.7

2019-12-01

Bug Fixes

  • Fix a scenario where a reassignments to computed properties were not tracked (#3267)

Pull Requests

Commits

The new version differs by 4 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Get M3U8 String manifest from Object?

How I can make reverse engineer, get m3u8 generated string from Manifest Object? My purpose it's analyze the manifest, delete some items, and regenerate the manifest

Exception on #EXT-X-MEDIA-TIME tag

We have a vtt playlist with non standard #EXT-X-MEDIA-TIME tag:

#EXT-X-MEDIA-TIME:0.0

The parser then tries to parse the attributes from "-TIME:0.0" probably because it somehow detects this as the #EXT-X-MEDIA tag.

This causes this exception here: attr = /([^=]*)=(.*)/.exec(attrs[i]).slice(1);

Exception has occurred: TypeError
TypeError: Cannot read property 'slice' of null
at parseAttributes (/Users/ost/Development/adaptive_playground/Server/node_modules/m3u8-parser/es5/parse-stream.js:60:41)
at ParseStream.push (/Users/ost/Development/adaptive_playground/Server/node_modules/m3u8-parser/es5/parse-stream.js:339:30)
at LineStream. (/Users/ost/Development/adaptive_playground/Server/node_modules/m3u8-parser/es5/stream.js:124:21)
at LineStream.trigger (/Users/ost/Development/adaptive_playground/Server/node_modules/m3u8-parser/es5/stream.js:91:24)
at LineStream.push (/Users/ost/Development/adaptive_playground/Server/node_modules/m3u8-parser/es5/line-stream.js:59:14)
at Parser.push (/Users/ost/Development/adaptive_playground/Server/node_modules/m3u8-parser/es5/parser.js:370:23)

Probably because of the unneeded '?' after the ':'

  match = /^#EXT-X-MEDIA:?(.*)$/.exec(line);

PlayReady DRM

Microsoft also made some contribution into HLS format, to support their PlayReady DRM.

See
https://docs.microsoft.com/en-us/playready/packaging/mp4-based-formats-supported-by-playready-clients?tabs=case4

I don't have alive HLS stream with PlayReady to check, and actually I am not sure, how to test playback here, because with the death of old Edge there are no more browsers with PlayReady support on the desktop platform, as far as I know.

But I think minimal change need to be done to avoid issue like #139, filter out EXT-X-KEY rows with KEYFORMAT="com.microsoft.playready"

An in-range update of husky is breaking the build 🚨

The devDependency husky was updated from 1.1.4 to 1.2.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

husky is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 6 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Fixable memory leak in Chromium based browsers

Hi!

I found a nice memory leak issue in Chromium based browsers due to a V8 engine string slicing problem.
More about it here: https://bugs.chromium.org/p/v8/issues/detail?id=2869

This causes a longer DVR live stream (tested with 10 hours long) to crash in 30-40 minutes in video.js 7+ due to extreme memory consuption.

235371930-1a7810ff-a42c-4610-aa49-d4a21186c960

235372738-9bb0a8fc-8502-4376-aae8-2075b417d5f6

A possible solution is just a small hack that's required for every parsed string.

For example:

if (line[0] !== "#") {
  this.trigger("data", {
    type: "uri",
    uri: (" " + line).substring(1), // <-------
  });
  return;
}
match = /^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(newLine);

if (match) {
  event = {
    type: 'tag',
    tagType: 'program-date-time'
  };

  if (match[1]) {
    event.dateTimeString = (" " + match[1]).substring(1);  // <-------
    event.dateTimeObject = new Date(match[1]);
  }

  this.trigger('data', event);
  return;
}

These modifications reduced the players memory consuption from 2 GB to 30 MB.

Best regards,
zsilbi

An in-range update of rollup is breaking the build 🚨

The devDependency rollup was updated from 1.18.0 to 1.19.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rollup is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 6 commits.

  • 9af119d 1.19.0
  • b3f361c Update changelog
  • 456f4d2 Avoid variable from empty module name be empty (#3026)
  • 17eaa43 Use id of last module in chunk as name base for auto-generated chunks (#3025)
  • 871bfa0 Switch to a code-splitting build and update dependencies (#3020)
  • 2443783 Unified file emission api (#2999)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of husky is breaking the build 🚨

The devDependency husky was updated from 1.1.3 to 1.1.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

husky is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 9 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of npm-run-all is breaking the build 🚨

The devDependency npm-run-all was updated from 4.1.3 to 4.1.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

npm-run-all is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 3 commits.

  • a79fbac πŸ”– 4.1.4
  • d97929c remove test in version script temporary
  • 57d72eb πŸ”₯ remove ps-tree

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Can not handle multiple subtitles

In the m3u8 file:
Total subtitles tracks are 2 tracks
But using m3u8-parser, total subtitles track is only 1 track

 let parser = new m3u8Parser.Parser();
 parser.push(response.body);
 text_tracks = parser.manifest.mediaGroups.SUBTITLES;

sub
Note: response.body is the content of the m3u8 file (in the attachment)
test.txt
Env: Ubuntu 18.04, m3u8-parser version 4.4.0

Support for basic vs extended format ?

Hi, I saw that a m3u8 file can be "basic" or "extended".

eg. A basic line for a track would be

#EXTINF:240,Artist - Title

While extended would be

#EXTINF:240,a=Artist,t=Title

Could your parser support this ?

By the way, I noticed title is not returned at all ?
Related to #158 ?

Is it possible to get a raw list of all expressions matched for each segment?

While it's cool that metadata like #EXT-X-DISCONTINUITY maps to segments[0].discontinuity = true, would it be possible at all to also have some object within the segment that is an array of all the expressions that were parsed?

Since right now the plugin can't be used to reverse build the manifest (which I don't actually need anyway), I'm looking to easily store the actual expressions for easily rebuilding chunklists later.

Can EXT-X-I-FRAME-STREAM-INF be supported?

I'd like to see support for the parsing of#EXT-X-I-FRAME-STREAM-INF lines.
eg
#EXT-X-I-FRAME-STREAM-INF: BANDWIDTH=100403,RESOLUTION=392x216,CODECS="avc1.42c01e",URI="QualityLevels(90258)/Manifest(video,format=m3u8-aapl,type=keyframes)"

I tried to make a custom parser for this, but I cant seem to get it to work right with an object for each time this line occurs (many times)

Any ideas welcome,
Thanks!

How to add Types for typescript.

Despite declaring m3u8-parser in global.d.ts , it doesn't seem to work and when trying to install types with npm , it says unauthorized header.

Wiseplay support with videojs

Hi, can you please add support (or any kind of skipping) for wiseplay in playlist?

example:

var wisePlayUri = 'urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c';
var widevineUuid = 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed'; // group segments into numbered timelines delineated by discontinuities`

if (entry.attributes.KEYFORMAT === wisePlayUri) {
  this.trigger('warn', {
    message: 'wiseplay support should be implemented!'
  });
  return;
}

if (entry.attributes.KEYFORMAT === widevineUuid) {
  var VALID_METHODS = ['SAMPLE-AES', 'SAMPLE-AES-CTR', 'SAMPLE-AES-CENC'];

  if (VALID_METHODS.indexOf(entry.attributes.METHOD) === -1) {
    this.trigger('warn', {
      message: 'invalid key method provided for Widevine'
    });
    return;
  }

  if (entry.attributes.METHOD === 'SAMPLE-AES-CENC') {
    this.trigger('warn', {
      message: 'SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead'
    });
  }

  if (entry.attributes.URI.substring(0, 23) !== 'data:text/plain;base64,') {
    this.trigger('warn', {
      message: 'invalid key URI provided for Widevine'
    });
    return;
  }

  if (!(entry.attributes.KEYID && entry.attributes.KEYID.substring(0, 2) === '0x')) {
    this.trigger('warn', {
      message: 'invalid key ID provided for Widevine'
    });
    return;
  }
  // if Widevine key attributes are valid, store them as `contentProtection`
  // on the manifest to emulate Widevine tag structure in a DASH mpd


  this.manifest.contentProtection = this.manifest.contentProtection || {};
  this.manifest.contentProtection['com.widevine.alpha'] = {
    attributes: {
      schemeIdUri: entry.attributes.KEYFORMAT,
      // remove '0x' from the key id string
      keyId: entry.attributes.KEYID.substring(2)
    },
    // decode the base64-encoded PSSH box
    pssh: decodeB64ToUint8Array(entry.attributes.URI.split(',')[1])
  };
  console.debug('::: ', this.manifest.contentProtection['com.widevine.alpha'])
  return;
}

Add file address

Hi, I want to suggest a small improvement for your parser.
I am using a parser for this file https://test-streams.mux.dev/x36xhzz/url_6/193039199_mp4_h264_aac_hq_7.m3u8
The famous cartoon about a fat rabbit.
It would be cool to add, in addition to the segments, the address "https://test-streams.mux.dev/x36xhzz/url_6/" where the segment files are located.

manifest={allowCache: true
location: "https://test-streams.mux.dev/x36xhzz/url_6/",
discontinuitySequence: 0,
discontinuityStarts: [],
endList: true,
mediaSequence: 0,
playlistType: "VOD",
segments: (64) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}],
targetDuration: 11}

How to modify playlist urls or Segment urls

I am developing a media downloader or transfer based on this.
There are many cases that I need to change the href or location of the segment, is there any possible to change it baesd on this interface?

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.