{"id":26875767,"url":"https://github.com/vegidio/mediasim","last_synced_at":"2026-04-26T10:01:49.338Z","repository":{"id":285256423,"uuid":"957512032","full_name":"vegidio/mediasim","owner":"vegidio","description":"A CLI tool and Go library to calculate the similarity of images \u0026 videos.","archived":false,"fork":false,"pushed_at":"2026-04-05T11:39:34.000Z","size":914,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-05T13:10:39.077Z","etag":null,"topics":["cli","duplicate-finder","go","image-comparison","image-similarity","video-comparison","video-similarity"],"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/vegidio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"vegidio","buy_me_a_coffee":"vegidio"}},"created_at":"2025-03-30T14:59:22.000Z","updated_at":"2026-04-05T11:39:40.000Z","dependencies_parsed_at":"2025-09-22T10:09:06.775Z","dependency_job_id":"91d30023-c59c-43e7-93bc-e057966bbc99","html_url":"https://github.com/vegidio/mediasim","commit_stats":null,"previous_names":["vegidio/mediasim"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/vegidio/mediasim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vegidio%2Fmediasim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vegidio%2Fmediasim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vegidio%2Fmediasim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vegidio%2Fmediasim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vegidio","download_url":"https://codeload.github.com/vegidio/mediasim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vegidio%2Fmediasim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32292958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cli","duplicate-finder","go","image-comparison","image-similarity","video-comparison","video-similarity"],"created_at":"2025-03-31T10:52:10.560Z","updated_at":"2026-04-26T10:01:49.331Z","avatar_url":"https://github.com/vegidio.png","language":"Go","funding_links":["https://github.com/sponsors/vegidio","https://buymeacoffee.com/vegidio"],"categories":[],"sub_categories":[],"readme":"# Media Similarity (MediaSim)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/images/icon.avif\" width=\"240\" alt=\"mediasim\"/\u003e\n\u003cbr/\u003e\n\u003cstrong\u003eMediaSim\u003c/strong\u003e is a CLI tool and Go library to calculate the similarity of images \u0026 videos.\n\n## ⬇️ Installation\n\nThis app has versions for Windows, macOS, and Linux. Download the [latest release](https://github.com/vegidio/mediasim/releases) that matches your computer architecture and operating system.\n\nHowever, the recommended (and easiest) way to install **MediaSim** is using one of the following scripts; copy and paste the command below in the terminal, and the script will automatically detect and install the correct version of the app:\n\n### macOS \u0026 Linux\n\n```bash\ncurl -fsSL https://vegidio.github.io/mediasim/install.sh | sh\n```\n\n### Windows (PowerShell)\n\n```powershell\nirm https://vegidio.github.io/mediasim/install.ps1 | iex\n```\n\n## 🖼️ Usage\n\nYou can use **mediasim** in two ways: as a command-line interface (CLI) tool or a Go library.\n\nThe CLI tool is a standalone application that can be used to compare the similarity between media files, while the library can be integrated into your own Go projects.\n\n### CLI\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/images/screenshot.avif\" width=\"80%\" alt=\"mediasim\"/\u003e\n\u003c/p\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eCalculating the similarity score of two files\u003c/summary\u003e\n\n#### Run the command below in the terminal:\n\n```bash\n$ mediasim score \u003cmedia1\u003e \u003cmedia2\u003e\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eComparing two or more files\u003c/summary\u003e\n\n#### Run the command below in the terminal:\n\n```bash\n$ mediasim files \u003cmedia1\u003e \u003cmedia2\u003e [\u003cmedia3\u003e ...]\n```\n\nWhere:\n\n- `files` (mandatory): the path to the media files you want to compare. You must pass at least two files, separated by space.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eComparing multiple files in a directory\u003c/summary\u003e\n\n#### Run the command below in the terminal:\n\n```bash\n$ mediasim dir \u003cdirectory\u003e [-r] [--mt \u003cmedia-type\u003e]\n```\n\nWhere:\n\n- `directory` (mandatory): the path to the directory where the media files are located.\n- `-r` (optional): recursively search for files in subdirectories to include in the comparison.\n- `--mt` (optional): the file types to be included in the comparison. You can choose between `image`, `video`, or `all` (default).\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRenaming files based on similarity\u003c/summary\u003e\n\n#### Run the command below in the terminal:\n\n```bash\n$ mediasim rename \u003cdirectory\u003e [-r] [--mt \u003cmedia-type\u003e]\n```\n\nWhere:\n\n- `directory` (mandatory): the path to the directory where the media files are located.\n- `-r` (optional): recursively search for files in subdirectories to include in the comparison.\n- `--mt` (optional): the file types to be included in the comparison. You can choose between `image`, `video`, or `all` (default).\n\u003c/details\u003e\n\n---\n\nOther parameters you can use:\n\n- `-t` (optional): the threshold for the similarity score; a value between 0–1, where 0 is completely different and 1 is identical. The default value is `0.8`, which means only similarities of 80% or higher will be reported.\n- `-o` (optional): the output format; you can choose `report` (default) or, if you prefer a raw output, `json` or `csv`.\n- `--ie` (optional): ignores errors and continues the comparison even if some files are not valid.\n- `--ff` (optional): flips the frames vertically and horizontally during the comparison.\n- `--fr` (optional): rotates the frames in multiple angles during the comparison.\n\nFor the full list of parameters, type `mediasim --help` in the terminal.\n\n## 🎞️ Supported media types\n\nIn its default configuration, the **mediasim** library supports media files with the following extensions:\n\n- Images: `.bmp`, `.gif`, `.jpg` (`.jpeg`), `.png`, `.tiff`, `.webp`\n- Videos: `.avi`, `.mp4` (`.m4v`), `.mkv`, `.mov`, `.webm`\n\nThe CLI supports two additional image formats: `.avif` and `.heic`.\n\nIf you want to work with additional file extensions in the library, like those two above, you can use the functions `AddImageType` or `AddVideoType` before performing any similarity comparisons. This allows **mediasim** to include these file types during calculations.\n\nWhen adding support for new media formats, it's essential to load a 3rd party library capable of decoding them. For example, to enable AVIF image comparison in **mediasim**, you could use a library like [avif-go](https://github.com/vegidio/avif-go) to do this:\n\n```go\nimport _ \"github.com/vegidio/avif-go\"\nmediasim.AddImageType(\".avif\")\n```\n\n## 💣 Troubleshooting\n\n### Video Comparison Doesn't Work\n\nIf the comparison of videos is not working, it may be because you don't have [FFmpeg](https://www.ffmpeg.org/download.html) working in your computer, which is required to extract frames from the video files.\n\nWhen FFmpeg is not found, **mediasim** will try to automatically download and install it for you. Even though this will work in most cases, it may fail for unpredictable reasons.\n\nThe best option to have the video comparison working is to install FFmpeg yourself in your computer and make sure it is available in your `PATH`.\n\n### Video Comparison Is Taking Too Long\n\nComparing videos is inherently resource-intensive because it requires analyzing multiple frames from each video to get an accurate similarity score. For instance, comparing two 15-second videos requires roughly 250 times more CPU resources than comparing two images.\n\nTherefore, if you have many videos to compare, especially long ones, the process may take a significant amount of time, and unfortunately, there is not much that can be done to speed it up.\n\n### \"App Is Damaged/Blocked...\" (Windows \u0026 macOS only)\n\nFor a couple of years now, Microsoft and Apple have required developers to join their \"Developer Program\" to gain the pretentious status of an _identified developer_ 😛.\n\nTranslating to non-BS language, this means that if you’re not registered with them (i.e., paying the fee), you can’t freely distribute Windows or macOS software. Apps from unidentified developers will display a message saying the app is damaged or blocked and can’t be opened.\n\nTo bypass this, open the Terminal and run one of the commands below (depending on your operating system), replacing `\u003cpath-to-app\u003e` with the correct path to where you’ve installed the app:\n\n- Windows: `Unblock-File -Path \u003cpath-to-app\u003e`\n- macOS: `xattr -d com.apple.quarantine \u003cpath-to-app\u003e`\n\n## 🛠️ Build\n\n### Dependencies\n\nTo build this project, you will need the following dependencies installed in your computer:\n\n- [Golang](https://go.dev/doc/install)\n- [Task](https://taskfile.dev/installation/)\n\n### Compiling\n\nWith all the dependencies installed, in the project's root folder run the command:\n\n```bash\n$ task cli os=\u003coperating-system\u003e arch=\u003carchitecture\u003e\n```\n\nWhere:\n\n- `\u003coperating-system\u003e`: can be `windows`, `darwin` (macOS), or `linux`.\n- `\u003carchitecture\u003e`: can be `amd64` or `arm64`.\n\nFor example, if I wanted to build the CLI for Windows, on architecture AMD64, I would run the command:\n\n```bash\n$ task cli os=windows arch=amd64\n```\n\n## 📝 License\n\n**mediasim** is released under the Apache 2.0 License. See [LICENSE](LICENSE) for details.\n\n## 👨🏾‍💻 Author\n\nVinicius Egidio ([vinicius.io](http://vinicius.io))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvegidio%2Fmediasim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvegidio%2Fmediasim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvegidio%2Fmediasim/lists"}