https://github.com/azot-labs/dasha
🔍 Parser for MPEG-DASH & HLS manifests
https://github.com/azot-labs/dasha
dash hls m3u8 manifest mpd mpeg streaming
Last synced: 8 months ago
JSON representation
🔍 Parser for MPEG-DASH & HLS manifests
- Host: GitHub
- URL: https://github.com/azot-labs/dasha
- Owner: vitalygashkov
- License: agpl-3.0
- Created: 2022-02-12T07:42:27.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-13T18:01:14.000Z (about 2 years ago)
- Last Synced: 2024-04-14T11:19:46.971Z (about 2 years ago)
- Topics: dash, hls, m3u8, manifest, mpd, mpeg, streaming
- Language: JavaScript
- Homepage:
- Size: 340 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# dasha
[](https://www.npmjs.com/package/dasha)
[](https://www.npmjs.com/package/dasha)
[](https://www.npmjs.com/package/dasha)
Library for parsing MPEG-DASH (.mpd) and HLS (.m3u8) manifests. Made with the purpose of obtaining a simplified representation convenient for further downloading of segments.
## Install
```shell
npm i dasha
```
## Quick start
```js
import fs from 'node:fs/promises';
import { parse } from 'dasha';
const url =
'https://dash.akamaized.net/dash264/TestCases/1a/sony/SNE_DASH_SD_CASE1A_REVISED.mpd';
const body = await fetch(url).then((res) => res.text());
const manifest = await parse(body, url);
for (const track of manifest.tracks.all) {
for (const segment of track.segments) {
const content = await fetch(url).then((res) => res.arrayBuffer());
await fs.appendFile(`${track.id}.mp4`, content);
}
}
```