{"id":15086017,"url":"https://github.com/ericfrancis12/ffmpeg-microservice","last_synced_at":"2026-02-12T06:12:45.752Z","repository":{"id":251432383,"uuid":"833244074","full_name":"EricFrancis12/ffmpeg-microservice","owner":"EricFrancis12","description":"A microservice for FFmpeg that can input/output entirely via streaming.","archived":false,"fork":false,"pushed_at":"2024-08-29T15:21:01.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T10:02:11.472Z","etag":null,"topics":["ffmpeg","ffmpeg-command","microservice","microservices"],"latest_commit_sha":null,"homepage":"","language":"Go","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/EricFrancis12.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":"2024-07-24T16:31:11.000Z","updated_at":"2024-08-29T15:21:05.000Z","dependencies_parsed_at":"2024-10-13T08:22:00.468Z","dependency_job_id":null,"html_url":"https://github.com/EricFrancis12/ffmpeg-microservice","commit_stats":{"total_commits":33,"total_committers":2,"mean_commits":16.5,"dds":0.09090909090909094,"last_synced_commit":"8faccdc8222e3ad66679aef1928ee63dc458c775"},"previous_names":["ericfrancis12/ffmpeg-microservice"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricFrancis12%2Fffmpeg-microservice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricFrancis12%2Fffmpeg-microservice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricFrancis12%2Fffmpeg-microservice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricFrancis12%2Fffmpeg-microservice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EricFrancis12","download_url":"https://codeload.github.com/EricFrancis12/ffmpeg-microservice/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239417361,"owners_count":19635112,"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","ffmpeg-command","microservice","microservices"],"created_at":"2024-09-25T07:03:04.472Z","updated_at":"2026-02-12T06:12:45.712Z","avatar_url":"https://github.com/EricFrancis12.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FFmpeg Microservice\n\nFFmpeg Microservice is a scalable and efficient solution designed for processing video \u0026 audio files using FFmpeg. This microservice can input/output entirely via streaming - it does not need to store data in memory or on disk in order to function, ensuring robust performance with large files.\n\nIt supports various input methods, including direct HTTP streaming, file system input, and multipart form data, and can stream output directly to the client.\n\n## Quickstart\n\n1. Clone the repository:\n   \n   ```bash\n   git clone https://github.com/EricFrancis12/ffmpeg-microservice.git\n   ```\n\n2. Navigate to the project directory:\n   \n   ```bash\n   cd ffmpeg-microservice\n   ```\n\n3. Build the application:\n \n   ```bash\n   make build\n   ```\n\n   This will create a binary file located at  `/bin/ffmpeg-microservice`.\n\n4. Run the application:\n   \n   ```bash\n   make run\n   ```\n\n   The service should now be running at http://localhost:3003 by default.\n\n\n## Usage\n\nThe service accepts input via HTTP Post request, or as Multipart Form Data.\n\n### Stream an input file via HTTP request body\n\nUse `-i -` if you are sending the input file in the request body:\n\n```bash\ncurl -X POST \\\n   -H \"Content-Type: video/mkv\" \\\n   # Specify the command that will run:\n   -H \"X-Command: ffmpeg -i - -vf scale=100:50 -c:a copy -c:v libx264 -f flv ./output-A.flv\" \\\n   # The path to the input file:\n   --data-binary @./video.mkv \\\n   http://localhost:3003\n```\n\n### Use an input file from the file system\n\nUse `-i [path/to/file]` if you are referencing an input file in the file system:\n\n```bash\ncurl -X POST \\\n   -H \"X-Command: ffmpeg -i ./video.mkv -vf scale=100:50 -c:a copy -c:v libx264 -f flv ./output-B.flv\" \\\n   http://localhost:3003\n```\n\n### Stream the output back as HTTP response\n\nUse the header `\"Accept\": \"application/octet-stream\"` and `pipe:` to stream stdout back to the client:\n\n```javascript\nfetch(\"http://localhost:3003\", {\n   method: \"POST\",\n   headers: {\n      \"Accept\": \"application/octet-stream\",\n      \"X-Command\": \"ffmpeg -i ./video.mkv -vf scale=100:50 -c:a copy -c:v libx264 -f flv pipe:\",\n   },\n})\n   .then(res =\u003e res.blob())\n   .then(blob =\u003e {\n      const url = window.URL.createObjectURL(blob);\n      const a = document.createElement(\"a\");\n      a.style.display = \"none\";\n      a.href = url;\n      a.download = \"output-C.flv\";\n      document.body.appendChild(a);\n      a.click();\n      window.URL.revokeObjectURL(url);\n   });\n```\n\n\n### Send Multipart Form Data as input\n\nMake sure to use `?form-data=1` to indicate you are sending multipart form data.\nThe input file needs to have the name `file`.\nThe command needs to have the name `command`.\n\n```html\n\u003cform\n   enctype=\"multipart/form-data\"\n   method=\"POST\"\n   action=\"http://localhost:3003?form-data=1\"\n\u003e\n   \u003c!-- File Input --\u003e\n   \u003cinput\n      type=\"file\"\n      name=\"file\"\n      required\n   \u003e\n   \u003c!-- Command Input --\u003e\n   \u003cinput\n      type=\"text\"\n      name=\"command\"\n      value=\"ffmpeg -i - -vf scale=100:50 -c:a copy -c:v libx264 -f flv ./output-D.flv\"\n      required\n   \u003e\n   \u003cbutton type=\"submit\"\u003e\n      Submit\n   \u003c/button\u003e\n\u003c/form\u003e\n```\n\n\n## Testing\n\n1. Download the sample video:\n   \n   ```bash\n   make dl video\n   ```\n\n2. Run the test suite:\n\n   ```bash\n   make test\n   ```\n\n\n## Find a bug?\nIf you found an issue or would like to submit an improvement to this project, please submit an issue using the issues tab above. If you would like to submit a PR with a fix, reference the issue you created.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericfrancis12%2Fffmpeg-microservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericfrancis12%2Fffmpeg-microservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericfrancis12%2Fffmpeg-microservice/lists"}