{"id":13527739,"url":"https://github.com/agsh/rtsp-ffmpeg","last_synced_at":"2025-04-01T09:32:01.709Z","repository":{"id":29443091,"uuid":"32979233","full_name":"agsh/rtsp-ffmpeg","owner":"agsh","description":"Node.js FFMpeg wrapper for streaming RTSP into MotionJPEG","archived":false,"fork":false,"pushed_at":"2024-07-16T13:39:21.000Z","size":67,"stargazers_count":246,"open_issues_count":15,"forks_count":80,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-03T19:48:34.904Z","etag":null,"topics":["ffmpeg-wrapper","hacktoberfest","nodejs","rtsp","rtsp-stream"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/agsh.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-03-27T10:02:55.000Z","updated_at":"2025-02-28T07:21:53.000Z","dependencies_parsed_at":"2024-06-18T17:02:00.619Z","dependency_job_id":"d4510c3f-a712-4acd-9202-d9ee9be41616","html_url":"https://github.com/agsh/rtsp-ffmpeg","commit_stats":{"total_commits":66,"total_committers":8,"mean_commits":8.25,"dds":0.2272727272727273,"last_synced_commit":"e0c3f32202e11fb532f1414812d8640fe57e0139"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agsh%2Frtsp-ffmpeg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agsh%2Frtsp-ffmpeg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agsh%2Frtsp-ffmpeg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agsh%2Frtsp-ffmpeg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agsh","download_url":"https://codeload.github.com/agsh/rtsp-ffmpeg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246616377,"owners_count":20806123,"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":["ffmpeg-wrapper","hacktoberfest","nodejs","rtsp","rtsp-stream"],"created_at":"2024-08-01T06:01:59.247Z","updated_at":"2025-04-01T09:32:00.886Z","avatar_url":"https://github.com/agsh.png","language":"JavaScript","readme":"# rtsp-ffmpeg\nLazy Node.js FFMpeg wrapper for streaming RTSP into MotionJPEG. It runs FFMpeg process only when someone is subscribed to\nits `data` event. Every `data` event contains one image `Buffer` object.\n\n## Installation\n\n1. Download [FFmpeg](http://www.ffmpeg.org/) to your local machine.\n\n2. Install package in your project `npm install rtsp-ffmpeg`\n\n## Sample\nWith [socket.io](http://socket.io/) library.\n\nServer:\n```javascript\nconst app = require('express')(),\n  server = require('http').Server(app),\n  io = require('socket.io')(server),\n  rtsp = require('rtsp-ffmpeg');\nserver.listen(6147);\nvar uri = 'rtsp://freja.hiof.no:1935/rtplive/definst/hessdalen03.stream',\n  stream = new rtsp.FFMpeg({input: uri});\nio.on('connection', function(socket) {\n  var pipeStream = function(data) {\n    socket.emit('data', data.toString('base64'));\n  };\n  stream.on('data', pipeStream);\n  socket.on('disconnect', function() {\n    stream.removeListener('data', pipeStream);\n  });\n});\napp.get('/', function (req, res) {\n  res.sendFile(__dirname + '/index.html');\n});\n```\n\nClient (index.html):\n### NB! \nthis is not efficient example, but simple. For drawing images on canvas please look at this [example](https://github.com/agsh/rtsp-ffmpeg/blob/master/example/index-canvas.html) by [Seikon](https://github.com/Seikon):  \n```html\n\u003cimg id=\"img\"\u003e\n\u003cscript src=\"/socket.io/socket.io.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n\tvar img = document.getElementById('img'),\n\t\tsocket = io('');\n\tsocket.on('data', function(data) {\n\t\timg.src = 'data:image/jpeg;base64,' + data;\n\t});\n\u003c/script\u003e\n```\n\nFor more detailed example look at [/example/server.js](/example/server.js)\nFor the large resolution images or IP cameras example check [/example/server-canvas.js](/example/server-canvas.js)\n\n## FFMpeg\n\n```javascript\n  var ffmpeg = new FFMpeg({\n    input: 'rtsp://localhost' // stream uri\n    , rate: 10 // output framerate (optional)\n    , resolution: '640x480' // output resolution in WxH format (optional)\n    , quality: 3 // JPEG compression quality level (optional)\n  });\n```\n\nIf you have an error `Error: spawn ffmpeg ENOENT`, you should first install ffmpeg package.\nAfter that, if the starup command differs from `ffmpeg`, you can change it in the static property like this, for example:\n```js\nFFMpeg.cmd = 'C:\\\\ffmpeg.exe';\n```\n","funding_links":[],"categories":["JavaScript","HarmonyOS"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagsh%2Frtsp-ffmpeg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagsh%2Frtsp-ffmpeg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagsh%2Frtsp-ffmpeg/lists"}