matroska-subtitles
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -103,2 +103,4 @@ const ebml = require('ebml') | ||
stream.push(currentSubtitleBlock) | ||
currentSubtitleBlock = null | ||
} | ||
@@ -105,0 +107,0 @@ }) |
{ | ||
"name": "matroska-subtitles", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Transform stream for parsing embedded .mkv subtitles.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -23,14 +23,32 @@ # matroska-subtitles [![npm][npm-img]][npm-url] [![dependencies][dep-img]][dep-url] [![license][lic-img]][lic-url] | ||
The `data` event of the stream will emit an array that determines the type of the data. | ||
When a new subtitle track is encountered a *track number* and *language* is emitted: | ||
```javascript | ||
data = [ 'new', { track: <track number>, language: <string> } ] | ||
When a new subtitle track is encountered the *track number*, *language*, *type* and optionally a *header* is emitted: | ||
``` | ||
data = [ 'new', { track: <track number>, language: <string>, type: <string>, header: <string> } ] | ||
``` | ||
Subsequently a specific subtitle track will emit data of this form: | ||
```javascript | ||
``` | ||
data = [ <track number>, { text: <string>, time: <ms>, duration: <ms> } ] | ||
``` | ||
## example | ||
## examples | ||
### dump all subtitles | ||
```javascript | ||
const fs = require('fs') | ||
const matroskaSubtitles = require('matroska-subtitles') | ||
var subs = matroskaSubtitles() | ||
subs.on('data', function (data) { | ||
console.log(data) | ||
}) | ||
fs.createReadStream('Sintel.2010.720p.mkv').pipe(subs) | ||
``` | ||
### group subtitle tracks | ||
The following is an example of extracting subtitle tracks of an mkv: | ||
@@ -37,0 +55,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117
8567
4
105