{"id":15086036,"url":"https://github.com/noblesamurai/ffmpeg-loop","last_synced_at":"2026-01-04T04:07:56.094Z","repository":{"id":48931758,"uuid":"122400464","full_name":"noblesamurai/ffmpeg-loop","owner":"noblesamurai","description":"Instantiate ffmpeg in looping mode.","archived":false,"fork":false,"pushed_at":"2021-07-13T04:01:06.000Z","size":1350,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-23T10:29:06.678Z","etag":null,"topics":["ffmpeg"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noblesamurai.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":"2018-02-21T22:13:12.000Z","updated_at":"2021-07-13T04:01:08.000Z","dependencies_parsed_at":"2022-09-26T20:21:51.526Z","dependency_job_id":null,"html_url":"https://github.com/noblesamurai/ffmpeg-loop","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noblesamurai%2Fffmpeg-loop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noblesamurai%2Fffmpeg-loop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noblesamurai%2Fffmpeg-loop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noblesamurai%2Fffmpeg-loop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noblesamurai","download_url":"https://codeload.github.com/noblesamurai/ffmpeg-loop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243955713,"owners_count":20374372,"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"],"created_at":"2024-09-25T07:04:15.637Z","updated_at":"2026-01-04T04:07:56.041Z","avatar_url":"https://github.com/noblesamurai.png","language":"JavaScript","readme":"# Ffmpeg-loop [![Build Status](https://secure.travis-ci.org/noblesamurai/ffmpeg-loop.png?branch=master)](http://travis-ci.org/noblesamurai/ffmpeg-loop) [![NPM version](https://badge-me.herokuapp.com/api/npm/ffmpeg-loop.png)](http://badges.enytc.com/for/npm/ffmpeg-loop)\n\n\u003e Instantiate ffmpeg in looping mode.\n\n## Purpose\nUses fluent-ffmpeg to instantiate an ffmpeg proc in looping mode\n\n## Usage\n\n```js\nconst expect = require('expect.js');\nconst opts = { height: 100, width: 100, fps: 30 };\nconst command = ffmpegLoop('path/to/file', opts);\nexpect(command).to.be.ok();\nexpect(command.pipe).to.be.ok();\ncommand.pipe(fs.createReadableStream(/*..*/));\n/*..*/\ncommand.kill();\n\n```\n\n## API\n\n\u003ca name=\"exp_module_ffmpeg-loop--module.exports\"\u003e\u003c/a\u003e\n\n### module.exports(filename) ⇒ ⏏\nCreates an ffmpeg command to loop a video.\nNote: All crop dimensions are for the original video size (not the output\nsize).\n\n**Kind**: Exported function\n**Returns**: A fluent ffmpeg process - has pipe() method.\n\n| Param | Type | Description |\n| --- | --- | --- |\n| filename | \u003ccode\u003estring\u003c/code\u003e | path to video |\n| opts.cropHeight | \u003ccode\u003einteger\u003c/code\u003e | crop height |\n| opts.cropWidth | \u003ccode\u003einteger\u003c/code\u003e | crop width (width and height are required). |\n| opts.cropX | \u003ccode\u003einteger\u003c/code\u003e | crop x (x and y are optional. If not set, the   default is the center position of the video). |\n| opts.cropY | \u003ccode\u003einteger\u003c/code\u003e | crop y |\n| opts.fps | \u003ccode\u003einteger\u003c/code\u003e |  |\n| opts.height | \u003ccode\u003einteger\u003c/code\u003e | output height |\n| opts.loop | \u003ccode\u003eboolean\u003c/code\u003e | whether to loop the source clip (defaults to true) |\n| opts.start | \u003ccode\u003efloat\u003c/code\u003e | seek to this time before starting. Must be less |\n| opts.inputDuration | \u003ccode\u003efloat\u003c/code\u003e | if set we can use this to make sure we don't attempt to start after the end of the input file (ie. we can loop or repeat the last frame correctly rather than seg faulting). |\n| opts.width | \u003ccode\u003einteger\u003c/code\u003e | output width than video length. |\n\nNote: To regenerate this section from the jsdoc run `npm run docs` and paste\nthe output above.\n\n## Installation\n\nThis module is installed via npm:\n\n``` bash\n$ npm install ffmpeg-loop\n```\n\n## Contributing\n\n### Prerequisites\n\n```\n$ pip install pre-commit\n```\n\n### Installation\n\n```\n$ pre-commit install --install-hooks\n```\n\n## License\n\nThe BSD License\n\nCopyright (c) 2018, Tim Allen\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n\n* Neither the name of the Tim Allen nor the names of its\n  contributors may be used to endorse or promote products derived from\n  this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoblesamurai%2Fffmpeg-loop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoblesamurai%2Fffmpeg-loop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoblesamurai%2Fffmpeg-loop/lists"}