Update: VLC
support for dash streaming
Latest versions of VLC are able to handle dash streams, so the terminal invocation would be:
cvlc https://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/dash/nonuk/dash_low/aks/bbc_world_service.mpd
Osmo4 (gpac)
osmo4
which is part of the gpac
project can play dash MPD files, but unfortunately, it does not work in headless mode for audio-only streams.
dash.js
This is the official dash.js library which requires a browser. Whether it can be made to work under nodejs is not clear.
Here is a minimal implementation for playing an audio/video dash stream adapted from the dash.js readme.
<!doctype html>
<html>
<head>
<title>Dash.js</title>
<style>
video {
width: 640px;
height: 360px;
}
</style>
</head>
<body>
<video id="videoPlayer" data-dashjs-player autoplay controls src="https://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/dash/nonuk/dash_low/aks/bbc_world_service.mpd">
</video>
<script src="//cdn.dashjs.org/latest/dash.all.min.js"></script>
</body>
</html>
Note: The file above will NOT work when opened from the local file system over a file:///
protocol. It requires a web server; any of the oneliners listed here would do.
Using Chrome/Chromium Headless
As of version 59 Google Chrome/Chromium can run in headless mode, which means it can be used on a headless system. Since there is no 'official' text-mode client for dash.js a somewhat heavyweight way to play dash audio in terminal would be opening it with headless chrome/chromium:
chromium-browser --headless --disable-gpu --repl https://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/dash/nonuk/dash_low/aks/bbc_world_service.mpd
Occasionally chrome/chromium would fail playing on first invocation, the --repl
option seems to allow it to eventually start playing. The repl also lets you type arbitrary javascript like e.g. document.location.reload()
.
ffmpeg
to playback DASH: stackoverflow.com/a/52853088/436794 – Pierz