Record HLS streams and replay them afterwards.
streamrr (or streamrr.exe on Windows) from a terminal.streamrr to your $PATH to run it from anywhere.)cargo install --git https://github.com/THEOplayer/streamrr.git
This will build the streamrr CLI tool, and then add it to your $PATH.
If everything goes well, you should now be able to run:
streamrr --help
This will print the usage instructions.
The CLI has three main commands: record, replay and import.
streamrr record will record an HLS VOD or live stream to a directory on your local disk.
streamrr record https://example.com/mystream.m3u8 recordings/mystream/
This will start recording the first variant stream of the HLS master playlist, along with all it segments. If it’s an HLS live stream, the tool will repeatedly fetch the latest playlist, and download all newly added segments.
Run streamrr record --help for the full instructions.
streamrr replay will spawn a local HTTP server and serve a previously recorded stream.
streamrr replay recordings/mystream/
The replayed stream is available at http://localhost:8080/index.m3u8.
streamrr replay can also serve an HTTP Archive (HAR) file directly, without importing it first:
streamrr replay capture.har
All captured variants and renditions are served, nothing is written to disk, and segments are decoded from the HAR only when requested.
Run streamrr replay --help for the full instructions.
streamrr import will import an HTTP Archive (HAR) file as a recording.
In your browser’s developer tools, open the Network tab while playing the stream, then save all captured requests as a HAR file. In Chrome and Edge, right-click in the request list and choose “Save all as HAR with content” (or use the Export HAR button). In Firefox, right-click and choose “Save All As HAR”. Make sure response content is included.
streamrr import capture.har recordings/mystream/
This will import the first HLS playlist found in the HAR file. To import a different stream, pass its playlist URL
with --url:
streamrr import --url https://example.com/mystream.m3u8 capture.har recordings/mystream/
Requests that were not captured (for example, segments that were already cached by the browser) are marked with
#EXT-X-GAP in the imported playlists. Low-Latency HLS (LL-HLS) streams are not supported yet.
Run streamrr import --help for the full instructions.
All files necessary to replay the stream are saved directly to the given recording directory. You can easily share these recordings with others by putting them in an archive:
tar -cvf myrecording.tar recordings/mystream/
This software is distributed under the BSD 3-Clause Clear License. See the license file for more information.