{"id":13906600,"url":"https://github.com/Eyevinn/hls-recorder","last_synced_at":"2025-07-18T04:31:58.978Z","repository":{"id":44790750,"uuid":"414487372","full_name":"Eyevinn/hls-recorder","owner":"Eyevinn","description":"NPM library to record live HLS","archived":false,"fork":false,"pushed_at":"2022-01-24T13:42:10.000Z","size":2139,"stargazers_count":13,"open_issues_count":4,"forks_count":1,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-11-17T23:11:53.375Z","etag":null,"topics":["library"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Eyevinn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-07T06:32:37.000Z","updated_at":"2024-10-29T15:13:34.000Z","dependencies_parsed_at":"2022-07-25T23:17:40.936Z","dependency_job_id":null,"html_url":"https://github.com/Eyevinn/hls-recorder","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eyevinn%2Fhls-recorder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eyevinn%2Fhls-recorder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eyevinn%2Fhls-recorder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eyevinn%2Fhls-recorder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Eyevinn","download_url":"https://codeload.github.com/Eyevinn/hls-recorder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226344712,"owners_count":17610191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library"],"created_at":"2024-08-06T23:01:38.951Z","updated_at":"2024-11-25T14:31:54.906Z","avatar_url":"https://github.com/Eyevinn.png","language":"TypeScript","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"# hls-recorder\r\n\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Slack](http://slack.streamingtech.se/badge.svg)](http://slack.streamingtech.se)\r\n\r\nNode library for recording HLS Live\r\n\r\n## Prerequisites\r\n- nodejs \u003e= 12.0.0\r\n\r\n## Installation\r\n\r\n```\r\nnpm install --save @eyevinn/hls-recorder\r\n```\r\n\r\n## Usage (with Eyevinn Channel Engine)\r\n\r\n```javascript\r\nconst { HLSRecorder } = require(\"@eyevinn/hls-recorder\");\r\nconst ChannelEngine = require(\"eyevinn-channel-engine\");\r\n\r\n/*\r\n  For instructions on how to properly set up a channel engine, see:\r\n  https://www.npmjs.com/package/eyevinn-channel-engine\r\n*/\r\n\r\n// First set up your channel engine instance\r\nconst assetMgr = new YourAssetManager();\r\nconst channelMgr = new YourChannelManager();\r\n\r\nconst engineOptions = {\r\n  heartbeat: '/',\r\n  channelManager: channelMgr\r\n}\r\n\r\nconst engine = new ChannelEngine(assetMgr, engineOptions);\r\n\r\n// Then use the instance as first input argument in HLSRecorder instance\r\nconst opts = {\r\n  recordDuration: 4000, // seconds (-1 for infinite)\r\n  windowSize: 240000, // seconds | -1 for infinite* (will fallback to Default if source is not EVENT or VOD type) | Default = 300000\r\n  vod: true // insert EXT-X-ENDLIST on end (creating a VOD)\r\n};\r\nconst recorder = new HLSRecorder(engine, opts);\r\n\r\nrecorder.on(\"mseq-increment\", mseq =\u003e {\r\n  // Do stuff with media seq\r\n});\r\n\r\nrecorder.start(); // Start recording VOD2live stream\r\n\r\n/** \r\n * The recording can also be played back, in the form of an event Hls stream.\r\n *  If you want to view the recorded stream locally, then use the follwoing lines: \r\n **/\r\n\r\n// (!) Be sure to have 'restify' imported first \r\nrecorder.setRestifyServer(restify); // Create a Restify server instance in recorder\r\nrecorder.listen(8001); // Have server listening on port 8001\r\n\r\n// View Recorder Stream Playback at: \"http://localhost:8001/live/master.m3u8\"\r\n```\r\n\r\n## Usage (with HLS Live Stream URL)\r\n\r\n```javascript\r\nconst { HLSRecorder } = require(\"@eyevinn/hls-recorder\");\r\n\r\nconst source = \"https://true.live.stream/hls/master.m3u8\"\r\n\r\nconst opts = {\r\n  recordDuration: 4000, // seconds | -1 for infinite | Default = -1\r\n  windowSize: 240000, // seconds | -1 for infinite* (will fallback to Default if source is not EVENT or VOD type) | Default = 300000\r\n  vod: true // insert EXT-X-ENDLIST on end (creating a VOD)\r\nconst recorder = new HLSRecorder(source, opts);\r\n\r\nrecorder.on(\"mseq-increment\", mseq =\u003e {\r\n  // Do stuff with media seq\r\n});\r\n\r\nrecorder.start(); // Start recording live stream\r\n\r\n/** \r\n * The recording can also be played back, in the form of an event Hls stream.\r\n *  If you want to view the recorded stream locally, then use the follwoing lines: \r\n **/\r\n\r\n// (!) Be sure to have 'restify' imported first \r\nrecorder.setRestifyServer(restify); // Create a Restify server instance in recorder\r\nrecorder.listen(8001); // Have server listening on port 8001\r\n\r\n// View Recorder Stream Playback at: \"http://localhost:8001/live/master.m3u8\"\r\n```\r\n## Stopping\r\nTo stop the recorder use:\r\n```javascript\r\nrecorder.stop()\r\n```\r\nThis will close the server, if listening, and will add an ENDLIST tag to the bottom of each playlist manifest\r\n\r\n\r\n# About Eyevinn Technology\r\n\r\nEyevinn Technology is an independent consultant firm specialized in video and streaming. Independent in a way that we are not commercially tied to any platform or technology vendor.\r\n\r\nAt Eyevinn, every software developer consultant has a dedicated budget reserved for open source development and contribution to the open source community. This give us room for innovation, team building and personal competence development. And also gives us as a company a way to contribute back to the open source community.\r\n\r\nWant to know more about Eyevinn and how it is to work here. Contact us at work@eyevinn.se!\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEyevinn%2Fhls-recorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEyevinn%2Fhls-recorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEyevinn%2Fhls-recorder/lists"}