Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

matroska-subtitles

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

matroska-subtitles - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

2

index.js

@@ -103,2 +103,4 @@ const ebml = require('ebml')

stream.push(currentSubtitleBlock)
currentSubtitleBlock = null
}

@@ -105,0 +107,0 @@ })

2

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc