npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@warren-bank/dash-to-hls

v0.1.6

Published

Node.js server to convert DASH video stream manifests to HLS

Readme

dash-to-hls

Node.js server to convert DASH video stream manifests to HLS


Summary of Behavior

  • runs an HTTP(S) server
  • each inbound request includes:
    • required in URL path:
      • base64 encoded URL for a DASH manifest
    • optional in querystring parameters:
      • &dump=1
        • outputs a dump of JSON data
          • which is mainly useful for me during development
      • &VOD=1
        • HLS master manifest forwards this querystring parameter in URLs for all HLS child manifests
        • HLS child manifests include:
          • prefix: #EXT-X-PLAYLIST-TYPE:VOD
          • suffix: #EXT-X-ENDLIST
        • this overrides the default behavior, which is to determine VOD when the DASH manifest does not include: MPD@type="dynamic"
      • &playlist=bandwidth
        • outputs an HLS child manifest for the given playlist (as identified by its integer bandwidth)
        • media group: VIDEO
      • &group_type=(AUDIO|SUBTITLES)&group_id=id&group_lang=lang&group_index=0
        • outputs an HLS child manifest for the given media group
        • media group: AUDIO|SUBTITLES
      • [default]
        • outputs the HSL master manifest
        • includes URLs to access all HLS child manifests
  • when each inbound request is received:
    • the base64 encoded DASH manifest URL is used as a key to lookup whether a parsed data structure representing the DASH manifest is temporarily held in a cache
      • if not, then:
        • download the DASH manifest
          • several command-line options are available to configure HTTP requests made to external servers
        • parse its contents (using mpd-parser library)
        • add the parsed DASH data structure to the cache
        • continue..
    • the querystring parameters are used to determine which HLS manifest to output
      • the parsed DASH data structure is used to produce this result

Installation and Usage: Globally

How to: Install:

npm install --global "@warren-bank/dash-to-hls"

How to: Run the server(s):

dash-to-hls [--help] [--version] [--tls] [--host <ip_address>] [--port <number>] [--req-headers <filepath>] [--origin <header>] [--referer <header>] [--useragent <header>] [--header <name=value>] [--req-options <filepath>] [--req-secure-honor-server-cipher-order] [--req-secure-ciphers <string>] [--req-secure-protocol <string>] [--req-secure-curve <string>] [-v <number>] [--acl-whitelist <ip_address_list>]

Examples:

  1. print help dash-to-hls --help

  2. print version dash-to-hls --version

  3. start HTTP server at default host:port dash-to-hls

  4. start HTTP server at default host and specific port dash-to-hls --port "8080"

  5. start HTTP server at specific host:port dash-to-hls --host "192.168.0.100" --port "8080"

  6. start HTTPS server at default host:port dash-to-hls --tls

  7. start HTTPS server at specific host:port dash-to-hls --tls --host "192.168.0.100" --port "8081"

  8. start HTTPS server at default host:port and send specific HTTP headers dash-to-hls --tls --req-headers "/path/to/request/headers.json"

Options:

  • --tls is a flag to start HTTPS server, rather than HTTP
  • --host must be an IP address of the server
    • ex: 192.168.0.100
    • used to generate self-referencing URLs in the master HLS manifest to query each child manifest
    • when this option is not specified:
      • the list of available network addresses is determined
      • if there are none, 'localhost' is used silently
      • if there is only a single address on the LAN, it is used silently
      • if there are multiple addresses:
        • they are listed
        • a prompt asks the user to choose (the numeric index) of one
  • --port is the port number that the server listens on
    • ex: 8080
    • used to generate self-referencing URLs in the master HLS manifest to query each child manifest
    • when this option is not specified:
      • HTTP server binds to: 80
      • HTTPS server binds to: 443
  • --req-headers is the filepath to a JSON data Object containing key:value pairs
    • each key is the name of an HTTP header to send in in every outbound request
  • --origin is the value of the corresponding HTTP request header
  • --referer is the value of the corresponding HTTP request header
  • --useragent is the value of the corresponding HTTP request header
  • --header is a single name:value pair
    • this option can be used multiple times to include several HTTP request headers
    • the pair can be written:
      • "name: value"
      • "name=value"
      • "name = value"
  • --req-options is the filepath to a JSON data Object
  • --req-secure-honor-server-cipher-order is a flag to set the following key in the request options Object to configure the context for secure https requests:
    • {honorCipherOrder: true}
  • --req-secure-ciphers is the value to assign to the following key in the request options Object to configure the context for secure https requests:
    • {ciphers: value}
  • --req-secure-protocol is the value to assign to the following key in the request options Object to configure the context for secure https requests:
    • {secureProtocol: value}
  • --req-secure-curve is the value to assign to the following key in the request options Object to configure the context for secure https requests:
    • {ecdhCurve: value}
  • -v sets logging verbosity level:
    • -1:
      • silent
    • 0 (default):
      • show errors only
    • 1:
      • show an informative amount of information
    • 2:
      • show technical details
    • 3:
      • show an enhanced technical trace (useful while debugging unexpected behavior)
  • --acl-whitelist restricts server access to clients at IP addresses in whitelist
    • ex: "192.168.1.100,192.168.1.101,192.168.1.102"

Installation and Usage: Working with a Local git Repo

How to: Install:

git clone "https://github.com/warren-bank/DASH-to-HLS.git"
cd "DASH-to-HLS"
npm install

How to: Run the server(s):

# ----------------------------------------------------------------------
# If using a port number >= 1024 on Linux, or
# If using Windows:
# ----------------------------------------------------------------------
npm start [-- [--help] [--version] [--tls] [--host <ip_address>] [--port <number>] [--req-headers <filepath>] [--origin <header>] [--referer <header>] [--useragent <header>] [--header <name=value>] [--req-options <filepath>] [--req-secure-honor-server-cipher-order] [--req-secure-ciphers <string>] [--req-secure-protocol <string>] [--req-secure-curve <string>] [-v <number>] ]

# ----------------------------------------------------------------------
# https://www.w3.org/Daemon/User/Installation/PrivilegedPorts.html
#
# Linux considers port numbers < 1024 to be privileged.
# Use "sudo":
# ----------------------------------------------------------------------
npm run sudo [-- [--help] [--version] [--tls] [--host <ip_address>] [--port <number>] [--req-headers <filepath>] [--origin <header>] [--referer <header>] [--useragent <header>] [--header <name=value>] [--req-options <filepath>] [--req-secure-honor-server-cipher-order] [--req-secure-ciphers <string>] [--req-secure-protocol <string>] [--req-secure-curve <string>] [-v <number>] ]

Examples:

  1. print help npm start -- --help

  2. start HTTP server at specific host:port npm start -- --host "192.168.0.100" --port "8080"

  3. start HTTPS server at specific host:port npm start -- --host "192.168.0.100" --port "8081" --tls

  4. start HTTP server at default host:port with escalated privilege npm run sudo -- --port "80"

  5. start HTTPS server at default host:port with escalated privilege npm run sudo -- --port "443" --tls

  6. start HTTP server at specific port and send custom request headers

headers_file="${TMPDIR}/headers.json"
echo '{"Origin" : "http://XXX:80", "Referer": "http://XXX:80/page.html"}' > "$headers_file"
npm start -- --port "8080" --req-headers "$headers_file"
  1. start HTTPS server at specific port and send custom request headers
headers_file="${TMPDIR}/headers.json"
echo '{"Origin" : "http://XXX:80", "Referer": "http://XXX:80/page.html"}' > "$headers_file"
npm start -- --port "8081" --req-headers "$headers_file" --tls -v 1
  1. start HTTPS server at specific port and send custom request headers
h_origin='http://XXX:80'
h_referer='http://XXX:80/page.html'
h_useragent='Chromium'
h_custom_1='X-Foo: 123'
h_custom_2='X-Bar: baz'
npm start -- --port "8081" --origin "$h_origin" --referer "$h_referer" --useragent "$h_useragent" --header "$h_custom_1" --header "$h_custom_2" --tls -v 1

Options:


Legal: