{"id":13832024,"url":"https://github.com/scalarhq/go-fluent-ffmpeg","last_synced_at":"2025-04-06T06:13:49.885Z","repository":{"id":45884374,"uuid":"334497664","full_name":"scalarhq/go-fluent-ffmpeg","owner":"scalarhq","description":"A Go implementation of fluent-ffmpeg","archived":false,"fork":false,"pushed_at":"2024-01-22T19:50:54.000Z","size":24,"stargazers_count":344,"open_issues_count":3,"forks_count":20,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-30T05:07:19.813Z","etag":null,"topics":["ffmpeg","fluent-ffmpeg","go","go-fluent-ffmpeg"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scalarhq.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}},"created_at":"2021-01-30T19:46:14.000Z","updated_at":"2025-01-16T13:11:43.000Z","dependencies_parsed_at":"2024-04-09T20:49:19.387Z","dependency_job_id":"37b2f7a6-b908-4af0-8a09-682dd7754973","html_url":"https://github.com/scalarhq/go-fluent-ffmpeg","commit_stats":null,"previous_names":["scalarhq/go-fluent-ffmpeg","modfy/fluent-ffmpeg","modfy/go-fluent-ffmpeg"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalarhq%2Fgo-fluent-ffmpeg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalarhq%2Fgo-fluent-ffmpeg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalarhq%2Fgo-fluent-ffmpeg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalarhq%2Fgo-fluent-ffmpeg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scalarhq","download_url":"https://codeload.github.com/scalarhq/go-fluent-ffmpeg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441062,"owners_count":20939239,"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","fluent-ffmpeg","go","go-fluent-ffmpeg"],"created_at":"2024-08-04T10:01:48.143Z","updated_at":"2025-04-06T06:13:49.862Z","avatar_url":"https://github.com/scalarhq.png","language":"Go","funding_links":[],"categories":["Go","HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"# Go Fluent FFmpeg [![GoDoc](https://pkg.go.dev/badge/github.com/modfy/fluent-ffmpeg)](https://pkg.go.dev/github.com/modfy/fluent-ffmpeg)\n\nA Go version of [node-fluent-ffmpeg](https://github.com/fluent-ffmpeg/node-fluent-ffmpeg).\n\n## Installation\n`go get -u github.com/modfy/fluent-ffmpeg`\n\n### Requirements\nYou will need FFmpeg installed on your machine, or you can specify a path to a binary:\n\n```go\n// Provide an empty string to use default FFmpeg path\ncmd := fluentffmpeg.NewCommand(\"\")\n\n// Specify a path\ncmd = fluentffmpeg.NewCommand(\"/path/to/ffmpeg/binary\")\n```\n\n## Quick Start\n\nCreate and run commands using an API similar to node-fluent-ffmpeg:\n\n```go\nerr := fluentffmpeg.NewCommand(\"\"). \n\t\tInputPath(\"/path/to/video.avi\").\n\t\tOutputFormat(\"mp4\").\n\t\tOutputPath(\"/path/to/video.mp4\").\n\t\tRun()\n```\n\nYou could use `context` to set the timeout:\n\n```go\nctx, cancel := context.WithTimeout(context.Background(), time.Second * 5)\ndefer cancel()\nerr := fluentffmpeg.NewCommand(\"\"). \n\t\tInputPath(\"/path/to/video.avi\").\n\t\tOutputFormat(\"mp4\").\n\t\tOutputPath(\"/path/to/video.mp4\").\n\t\tRunWithContext(ctx)\n```\n\nIf you want to view the errors/logs returned from FFmpeg, provide an io.Writer to receive the data. \n```go\nbuf := \u0026bytes.Buffer{}\nerr := fluentffmpeg.NewCommand(\"\").\n\t\tInputPath(\"./video.avi\").\n\t\tOutputFormat(\"mp4\").\n\t\tOutputPath(\"./video.mp4\").\n\t\tOverwrite(true).\n\t\tOutputLogs(buf). // provide a io.Writer\n\t\tRun()\n\nout, _ := ioutil.ReadAll(buf) // read logs\nfmt.Println(string(out))\n```\n\nYou can also get the command in the form of an [exec.Cmd](https://golang.org/pkg/os/exec/#Cmd) struct, with which you can have better control over the running process. For example, you can conditionally kill the FFmpeg command:\n\n```go\ndone := make(chan error, 1)\ncmd := fluentffmpeg.NewCommand(\"\").\n\t\tInputPath(\"./video.avi\").\n\t\tOutputFormat(\"mp4\").\n\t\tOutputPath(\"./video.mp4\").\n\t\tOverwrite(true).\n\t\tBuild()\ncmd.Start()\n\ngo func() {\n    done \u003c- cmd.Wait()\n}()\n\nselect {\ncase \u003c-time.After(time.Second * 5):\n    fmt.Println(\"Timed out\")\n    cmd.Process.Kill()\ncase \u003c-done:\n}\n```\n\nFFprobe is also available for use and returns a map[string]interface{} of JSON data:\n```go\ndata := fluentffmpeg.Probe(\"./video.avi\")\n```\n\n## Credits\n\nThis repo was inspired by [node-fluent-ffmpeg](https://github.com/fluent-ffmpeg/node-fluent-ffmpeg) and was built upon the work done by [@bitcodr](https://github.com/bitcodr/) in the https://github.com/bitcodr/gompeg\n\n## Managed Version\n\nYou can deploy this codebase yourself or you an entirely managed api from the creators at https://api.modfy.video","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalarhq%2Fgo-fluent-ffmpeg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscalarhq%2Fgo-fluent-ffmpeg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalarhq%2Fgo-fluent-ffmpeg/lists"}