{"id":25871709,"url":"https://github.com/wyvernixtl/crop4mkv","last_synced_at":"2025-03-02T07:23:29.424Z","repository":{"id":276649218,"uuid":"929867951","full_name":"WyvernIXTL/crop4mkv","owner":"WyvernIXTL","description":"Bun ts script that analyses crop margins of a video and sets the flags for an mkv.","archived":false,"fork":false,"pushed_at":"2025-03-01T13:24:22.000Z","size":134,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-01T14:24:01.933Z","etag":null,"topics":["bun","bunjs","crop","cropping","matroska","matroska-files"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WyvernIXTL.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":"2025-02-09T15:39:33.000Z","updated_at":"2025-03-01T13:24:22.000Z","dependencies_parsed_at":"2025-02-22T12:18:23.857Z","dependency_job_id":"8923f48a-04cf-43ee-9b37-020162457060","html_url":"https://github.com/WyvernIXTL/crop4mkv","commit_stats":null,"previous_names":["wyvernixtl/set-crop-for-mkv","wyvernixtl/crop4mkv"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyvernIXTL%2Fcrop4mkv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyvernIXTL%2Fcrop4mkv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyvernIXTL%2Fcrop4mkv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyvernIXTL%2Fcrop4mkv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WyvernIXTL","download_url":"https://codeload.github.com/WyvernIXTL/crop4mkv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241472228,"owners_count":19968352,"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":["bun","bunjs","crop","cropping","matroska","matroska-files"],"created_at":"2025-03-02T07:23:27.334Z","updated_at":"2025-03-02T07:23:29.421Z","avatar_url":"https://github.com/WyvernIXTL.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `crop4mkv`\n\n**Bun TS script that analyzes crop margins of a video and sets the flags for an MKV.**\n\n[![NPM Version](https://img.shields.io/npm/v/crop4mkv)](https://www.npmjs.com/package/crop4mkv)\n[![GitHub License](https://img.shields.io/github/license/WyvernIXTL/crop4mkv)](https://github.com/WyvernIXTL/crop4mkv/blob/master/LICENSE)\n\n* This script searches with [`ffmpeg` `cropdetect`](https://ffmpeg.org/ffmpeg-filters.html#cropdetect) at multiple different points in the video to check the crop.\n* It then takes the crop per axis that clips the fewest pixels (the safe crop).\n* The crop is then saved into the MKV flags with [MKVToolNix](https://mkvtoolnix.download/) without touching the video stream.\n\nVideo players like [MPV](https://mpv.io/) read this MKV flag and crop the video at play time.\n\n## Usage\n\nGenerate and set crop tags for a single file:\n```\ncrop4mkv ./myvideo.mkv\n```\n\nGenerate and set crop tags recursively for a directory:\n```\ncrop4mkv ./myDir/\n```\n\nDo not write tag to file:\n```\ncrop4mkv --dryrun PATH\n```\n\nSkip check for the existence of crop tags:\n```\ncrop4mkv --overwrite PATH\n```\n\nSometimes a movie or show might have a few scenes that are in a different format.\nIf almost the entire video is 21/9, but one scene is 16/9, it might make sense to ignore that one scene by filtering outliers:\n```\ncrop4mkv --filter PATH\n```\n\nFor some options, there exist shorthand flags, which you can write together:\n```\ncrop4mkv PATH -dof # Dryrun, Overwrite, Filter\n```\n```\ncrop4mkv PATH -o # Overwrite \n```\n\n## Prerequisites\n\n* [MKVToolNix](https://mkvtoolnix.download/) installed and in [PATH](https://www.howtogeek.com/787217/how-to-edit-environment-variables-on-windows-10-or-11/).\n* [ffmpeg](https://ffmpeg.org/) installed and in PATH.\n* [bun](https://bun.sh/) installed and in PATH.\n\nI recommend for Windows users to install these dependencies apart from bun with [Scoop](https://scoop.sh/):\n```\nscoop bucket add main\nscoop install main/ffmpeg\nscoop bucket add extras\nscoop install extras/mkvtoolnix\n```\n\n## Installation\n\n```\nbun install -g crop4mkv\n```\n\n## Images\n\n![Image showing dryrun](https://media.githubusercontent.com/media/WyvernIXTL/crop4mkv/refs/heads/master/images/1-fs8.png)\n![Image showing success](https://media.githubusercontent.com/media/WyvernIXTL/crop4mkv/refs/heads/master/images/2-fs8.png)\n![Image showing execution of already done file](https://media.githubusercontent.com/media/WyvernIXTL/crop4mkv/refs/heads/master/images/3-fs8.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyvernixtl%2Fcrop4mkv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwyvernixtl%2Fcrop4mkv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyvernixtl%2Fcrop4mkv/lists"}