{"id":26920772,"url":"https://github.com/rattleycooper/ffmpeg_wrapper","last_synced_at":"2025-04-01T22:48:26.200Z","repository":{"id":82011909,"uuid":"291512819","full_name":"RattleyCooper/ffmpeg_wrapper","owner":"RattleyCooper","description":"Shut down ffmpeg gracefully on Windows using `taskkill`","archived":false,"fork":false,"pushed_at":"2025-01-02T03:10:02.000Z","size":378,"stargazers_count":7,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-02T04:21:00.149Z","etag":null,"topics":["ffmpeg","helper","screen-recorder","taskkill","wrapper"],"latest_commit_sha":null,"homepage":"","language":"Nim","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/RattleyCooper.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":"2020-08-30T16:55:16.000Z","updated_at":"2025-01-02T03:10:06.000Z","dependencies_parsed_at":"2025-01-02T04:21:03.187Z","dependency_job_id":"bd13521a-19d2-4531-88be-bad42fe1042d","html_url":"https://github.com/RattleyCooper/ffmpeg_wrapper","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RattleyCooper%2Fffmpeg_wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RattleyCooper%2Fffmpeg_wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RattleyCooper%2Fffmpeg_wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RattleyCooper%2Fffmpeg_wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RattleyCooper","download_url":"https://codeload.github.com/RattleyCooper/ffmpeg_wrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246724799,"owners_count":20823544,"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","helper","screen-recorder","taskkill","wrapper"],"created_at":"2025-04-01T22:48:25.792Z","updated_at":"2025-04-01T22:48:26.183Z","avatar_url":"https://github.com/RattleyCooper.png","language":"Nim","readme":"# ffmpeg wrapper\n\n ffmpeg wrapper starts an ffmpeg process and hooks the `WM_CLOSE` event sent by windows when a `taskkilll` command is sent to the wrapper's process. The wrapper then shuts down the child ffmpeg process it started gracefully to avoid file corruption issues.\n\nThis is meant to be shipped alongside ffmpeg in cases where the only way to tell ffmpeg to shut down gracefully is to send a `taskkill` command(ffmpeg is being used by host software that needs to interrupt ffmpeg). ffmpeg doesn't run with a window handle unless you specifically give ffmpeg a window handle using the `start` command. This still doesn't fix the fact that ffmpeg is not designed to handle this edge case. ffmpeg doesn't handle any `WM_CLOSE` event, so assigning a window handle isn't enough.\n\nDon't use the `/F` option or the `WM_CLOSE` event isn't fired and the wrapper will fail to shut down ffmpeg gracefully.\n\n## Compiling\n\n`ffmpeg_wrap` is written with `nim`.  You need `wnim` and `winim` if you want to compile `ffmpeg_wrap`.  You can use `nimble` to get both.\n\n`nimble install winim`\n`nimble install wnim`\n\nThe resulting binary is around 1.5mb, but if you compile with the `--opt:size` flag it's less than 700kb\n\n## Example Usage\n\nThis will record a section of your screen until you run `taskkill /PID FFMPEG_WRAPPER_PID`\n\n```\nffmpeg_wrap.exe ffmpeg.exe -rtbufsize 150M -f gdigrab -framerate 30 -offset_x 448 -offset_y 240 -video_size 1024x600 -draw_mouse 1 -show_region 1 -i desktop -r 30 -preset ultrafast -tune zerolatency -movflags +faststart screen-recording.mp4\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frattleycooper%2Fffmpeg_wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frattleycooper%2Fffmpeg_wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frattleycooper%2Fffmpeg_wrapper/lists"}