mediacrop


Namemediacrop JSON
Version 2.0.0 PyPI version JSON
download
home_pageNone
SummaryA web-based visual tool to get FFmpeg crop coordinates for any media file.
upload_time2025-08-31 20:28:06
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseMIT License Copyright (c) 2025 Mallik Mohammad Musaddiq Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords ffmpeg crop video image audio visual gui tool
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ✂️ MediaCrop - Visual FFmpeg Crop Tool

[![Python Version](https://img.shields.io/badge/python-3.7%2B-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PyPI version](https://badge.fury.io/py/mediacrop.svg)](https://pypi.org/project/mediacrop/)
[![Downloads](https://static.pepy.tech/badge/mediacrop)](https://pepy.tech/project/mediacrop)
[![Last Commit](https://img.shields.io/github/last-commit/mallikmusaddiq1/mediacrop.svg)](https://github.com/mallikmusaddiq1/mediacrop/commits/main)
[![Stars](https://img.shields.io/github/stars/mallikmusaddiq1/mediacrop.svg)](https://github.com/mallikmusaddiq1/mediacrop/stargazers)
[![Instagram](https://img.shields.io/badge/Instagram-%40musaddiq.x7-E4405F?logo=instagram&logoColor=white)](https://instagram.com/musaddiq.x7)

**MediaCrop** is a modern, lightweight, web-based visual tool that helps you get FFmpeg crop coordinates for any media file (video, image, or audio) with zero guesswork. Just drag, resize, and get the exact crop string you need.

The tool runs a local server and opens a sleek, responsive interface in your browser, providing an intuitive and powerful user experience.

---

## 📖 The Story Behind MediaCrop

Working with **FFmpeg** is powerful, but not always simple. One of the most frustrating parts for many users is **finding the right crop coordinates**. Traditionally, this involved a tedious cycle of:

* Opening the media in a player.
* Guessing the pixel coordinates.
* Running the FFmpeg command.
* Repeating until it looked right.

This trial-and-error process wastes time and energy. I created **MediaCrop** to provide a **visual, drag-and-drop solution** to get these coordinates instantly.

With MediaCrop, you just draw a box, and the tool gives you the **FFmpeg-ready crop filter string**. No stress. No repeated guessing. Just **precision with ease**.

---

## 🖼️ MediaCrop Desktop Screenshot

A modern, dark-themed interface that's fully responsive and works on any device.

![MediaCrop Desktop Screenshot](Screenshots/Screenshot-719x1086.png)

---

## ✨ Features

* **🌐 Modern Web Interface:** Sleek, dark-themed UI that runs in your browser. No extra GUI installation needed.
* **📱 Fully Responsive:** Works seamlessly on both desktop and mobile devices.
* **🖱️ Interactive Crop Box:** Drag to move and resize with 8 handles for precision.
* **📐 Advanced Aspect Ratios:** Lock the crop box to presets like 16:9, 4:3, 1:1, Cinemascope, or custom ratios.
* **📊 Live Info Panel:** Instantly see crop box position (X, Y), size, and aspect ratio.
* **🔧 Quick Tools:** One-click to center, toggle grid, reset selection, or view help.
* **⌨️ Full Keyboard Control:** Pixel-perfect adjustments with arrow keys and shortcuts.
* **🖱️ Context Menu:** Right-click for quick access to common actions.
* **✅ Broad Format Support:** Preview many common media formats, or set coordinates even if preview is unsupported.
* **🚀 Zero Dependencies:** Pure Python standard library. No external `pip` installs required.
* **💻 Cross-Platform:** Works on Windows, macOS, and Linux.

---

### Supported Preview Formats

MediaCrop can generate coordinates for **any** file FFmpeg supports, but provides in-browser preview for these formats:

* **Images:** `JPG`, `PNG`, `WEBP`, `AVIF`, `GIF`, `BMP`, `SVG`, `ICO`
* **Videos:** `MP4`, `WEBM`, `MOV`, `OGV`
* **Audio:** `MP3`, `WAV`, `FLAC`, `OGG`, `M4A`, `AAC`, `OPUS`

---

## ⚙️ Installation

You only need **Python 3.7+** installed on your system.

### Option 1: From PyPI (Recommended)

```bash
pip install mediacrop
```

### Option 2: From Source

```bash
# Clone the repository
git clone https://github.com/mallikmusaddiq1/mediacrop.git

# Navigate into the directory
cd mediacrop

# Install locally
pip install .
```

---

## 🚀 Usage

Using the tool is simple:

```bash
mediacrop "/path/to/your/mediafile.mp4"
```

* Use quotes `""` if the path contains spaces.
* Your default browser will open at [http://127.0.0.1:8000](http://127.0.0.1:8000).
* Adjust the crop box visually, apply aspect ratio presets, grid, and tools as needed.
* Click **Save Coordinates**:

  * A notification will confirm success.
  * The crop filter string is printed in the terminal.
* Press **Ctrl+C** to stop the server.

### Command-Line Options

* `-p <port>`, `--port <port>`: Use a specific port (default: 8000).
* `-v`, `--verbose`: Show detailed server logs.
* `-h`, `--help`: Show help message.

---

## 🎬 Using the Output with FFmpeg

MediaCrop provides a perfectly formatted FFmpeg crop string.

**Example Output:**

```bash
crop=1280:720:320:180
```

Use it with FFmpeg:

```bash
ffmpeg -i input.mp4 -vf "crop=1280:720:320:180" output.mp4
```

---

## ⌨️ Controls & Shortcuts

| Action           | Control                        |
| ---------------- | ------------------------------ |
| Move Crop Box    | Click & Drag / Arrow Keys      |
| Fine Move (1px)  | Shift + Arrow Keys             |
| Resize Crop Box  | Drag one of the 8 handles      |
| Toggle Grid      | `G` or 📐 Grid button          |
| Center Crop Box  | `C` or 🎯 Center button        |
| Save Coordinates | `Enter` or 💾 Save button      |
| Open/Close Help  | ❓ Help button / `Esc` to close |
| Context Menu     | Right-click on crop box        |

---

## 👨‍💻 Author Info:

👤 Name:
**Mallik Mohammad Musaddiq**

📧 Email:
[mallikmusaddiq1@gmail.com](mailto:mallikmusaddiq1@gmail.com)

🌐 GitHub:
[mallikmusaddiq1](https://github.com/mallikmusaddiq1)

🔗 Project Repo:
[mallikmusaddiq1/mediacrop](https://github.com/mallikmusaddiq1/mediacrop)

---

## 📄 License

This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mediacrop",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "ffmpeg, crop, video, image, audio, visual, gui, tool",
    "author": null,
    "author_email": "Mallik Mohammad Musaddiq <mallikmusaddiq1@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/19/bf/8ffc4e3a90720f904c3b8b3bf6456743e44c77209f3bc25e44684e22c098/mediacrop-2.0.0.tar.gz",
    "platform": null,
    "description": "# \u2702\ufe0f MediaCrop - Visual FFmpeg Crop Tool\n\n[![Python Version](https://img.shields.io/badge/python-3.7%2B-blue.svg)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![PyPI version](https://badge.fury.io/py/mediacrop.svg)](https://pypi.org/project/mediacrop/)\n[![Downloads](https://static.pepy.tech/badge/mediacrop)](https://pepy.tech/project/mediacrop)\n[![Last Commit](https://img.shields.io/github/last-commit/mallikmusaddiq1/mediacrop.svg)](https://github.com/mallikmusaddiq1/mediacrop/commits/main)\n[![Stars](https://img.shields.io/github/stars/mallikmusaddiq1/mediacrop.svg)](https://github.com/mallikmusaddiq1/mediacrop/stargazers)\n[![Instagram](https://img.shields.io/badge/Instagram-%40musaddiq.x7-E4405F?logo=instagram&logoColor=white)](https://instagram.com/musaddiq.x7)\n\n**MediaCrop** is a modern, lightweight, web-based visual tool that helps you get FFmpeg crop coordinates for any media file (video, image, or audio) with zero guesswork. Just drag, resize, and get the exact crop string you need.\n\nThe tool runs a local server and opens a sleek, responsive interface in your browser, providing an intuitive and powerful user experience.\n\n---\n\n## \ud83d\udcd6 The Story Behind MediaCrop\n\nWorking with **FFmpeg** is powerful, but not always simple. One of the most frustrating parts for many users is **finding the right crop coordinates**. Traditionally, this involved a tedious cycle of:\n\n* Opening the media in a player.\n* Guessing the pixel coordinates.\n* Running the FFmpeg command.\n* Repeating until it looked right.\n\nThis trial-and-error process wastes time and energy. I created **MediaCrop** to provide a **visual, drag-and-drop solution** to get these coordinates instantly.\n\nWith MediaCrop, you just draw a box, and the tool gives you the **FFmpeg-ready crop filter string**. No stress. No repeated guessing. Just **precision with ease**.\n\n---\n\n## \ud83d\uddbc\ufe0f MediaCrop Desktop Screenshot\n\nA modern, dark-themed interface that's fully responsive and works on any device.\n\n![MediaCrop Desktop Screenshot](Screenshots/Screenshot-719x1086.png)\n\n---\n\n## \u2728 Features\n\n* **\ud83c\udf10 Modern Web Interface:** Sleek, dark-themed UI that runs in your browser. No extra GUI installation needed.\n* **\ud83d\udcf1 Fully Responsive:** Works seamlessly on both desktop and mobile devices.\n* **\ud83d\uddb1\ufe0f Interactive Crop Box:** Drag to move and resize with 8 handles for precision.\n* **\ud83d\udcd0 Advanced Aspect Ratios:** Lock the crop box to presets like 16:9, 4:3, 1:1, Cinemascope, or custom ratios.\n* **\ud83d\udcca Live Info Panel:** Instantly see crop box position (X, Y), size, and aspect ratio.\n* **\ud83d\udd27 Quick Tools:** One-click to center, toggle grid, reset selection, or view help.\n* **\u2328\ufe0f Full Keyboard Control:** Pixel-perfect adjustments with arrow keys and shortcuts.\n* **\ud83d\uddb1\ufe0f Context Menu:** Right-click for quick access to common actions.\n* **\u2705 Broad Format Support:** Preview many common media formats, or set coordinates even if preview is unsupported.\n* **\ud83d\ude80 Zero Dependencies:** Pure Python standard library. No external `pip` installs required.\n* **\ud83d\udcbb Cross-Platform:** Works on Windows, macOS, and Linux.\n\n---\n\n### Supported Preview Formats\n\nMediaCrop can generate coordinates for **any** file FFmpeg supports, but provides in-browser preview for these formats:\n\n* **Images:** `JPG`, `PNG`, `WEBP`, `AVIF`, `GIF`, `BMP`, `SVG`, `ICO`\n* **Videos:** `MP4`, `WEBM`, `MOV`, `OGV`\n* **Audio:** `MP3`, `WAV`, `FLAC`, `OGG`, `M4A`, `AAC`, `OPUS`\n\n---\n\n## \u2699\ufe0f Installation\n\nYou only need **Python 3.7+** installed on your system.\n\n### Option 1: From PyPI (Recommended)\n\n```bash\npip install mediacrop\n```\n\n### Option 2: From Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/mallikmusaddiq1/mediacrop.git\n\n# Navigate into the directory\ncd mediacrop\n\n# Install locally\npip install .\n```\n\n---\n\n## \ud83d\ude80 Usage\n\nUsing the tool is simple:\n\n```bash\nmediacrop \"/path/to/your/mediafile.mp4\"\n```\n\n* Use quotes `\"\"` if the path contains spaces.\n* Your default browser will open at [http://127.0.0.1:8000](http://127.0.0.1:8000).\n* Adjust the crop box visually, apply aspect ratio presets, grid, and tools as needed.\n* Click **Save Coordinates**:\n\n  * A notification will confirm success.\n  * The crop filter string is printed in the terminal.\n* Press **Ctrl+C** to stop the server.\n\n### Command-Line Options\n\n* `-p <port>`, `--port <port>`: Use a specific port (default: 8000).\n* `-v`, `--verbose`: Show detailed server logs.\n* `-h`, `--help`: Show help message.\n\n---\n\n## \ud83c\udfac Using the Output with FFmpeg\n\nMediaCrop provides a perfectly formatted FFmpeg crop string.\n\n**Example Output:**\n\n```bash\ncrop=1280:720:320:180\n```\n\nUse it with FFmpeg:\n\n```bash\nffmpeg -i input.mp4 -vf \"crop=1280:720:320:180\" output.mp4\n```\n\n---\n\n## \u2328\ufe0f Controls & Shortcuts\n\n| Action           | Control                        |\n| ---------------- | ------------------------------ |\n| Move Crop Box    | Click & Drag / Arrow Keys      |\n| Fine Move (1px)  | Shift + Arrow Keys             |\n| Resize Crop Box  | Drag one of the 8 handles      |\n| Toggle Grid      | `G` or \ud83d\udcd0 Grid button          |\n| Center Crop Box  | `C` or \ud83c\udfaf Center button        |\n| Save Coordinates | `Enter` or \ud83d\udcbe Save button      |\n| Open/Close Help  | \u2753 Help button / `Esc` to close |\n| Context Menu     | Right-click on crop box        |\n\n---\n\n## \ud83d\udc68\u200d\ud83d\udcbb Author Info:\n\n\ud83d\udc64 Name:\n**Mallik Mohammad Musaddiq**\n\n\ud83d\udce7 Email:\n[mallikmusaddiq1@gmail.com](mailto:mallikmusaddiq1@gmail.com)\n\n\ud83c\udf10 GitHub:\n[mallikmusaddiq1](https://github.com/mallikmusaddiq1)\n\n\ud83d\udd17 Project Repo:\n[mallikmusaddiq1/mediacrop](https://github.com/mallikmusaddiq1/mediacrop)\n\n---\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025 Mallik Mohammad Musaddiq\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.",
    "summary": "A web-based visual tool to get FFmpeg crop coordinates for any media file.",
    "version": "2.0.0",
    "project_urls": {
        "Homepage": "https://github.com/mallikmusaddiq1/mediacrop",
        "Issues": "https://github.com/mallikmusaddiq1/mediacrop/issues"
    },
    "split_keywords": [
        "ffmpeg",
        " crop",
        " video",
        " image",
        " audio",
        " visual",
        " gui",
        " tool"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "82bf238e4cb9033c1ab4914cee53310f92c9ed005968573813007dec652bf20f",
                "md5": "41bf2bc2f4d495e4e7b3e03b2534be54",
                "sha256": "ee0744203cc266e48bc53dc1cf99fad11ed1a517bdfa8ea1babc30f6f6776935"
            },
            "downloads": -1,
            "filename": "mediacrop-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "41bf2bc2f4d495e4e7b3e03b2534be54",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 20544,
            "upload_time": "2025-08-31T20:28:04",
            "upload_time_iso_8601": "2025-08-31T20:28:04.938625Z",
            "url": "https://files.pythonhosted.org/packages/82/bf/238e4cb9033c1ab4914cee53310f92c9ed005968573813007dec652bf20f/mediacrop-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "19bf8ffc4e3a90720f904c3b8b3bf6456743e44c77209f3bc25e44684e22c098",
                "md5": "ac5cf1268df47af532f61080524d0b80",
                "sha256": "c8a110fe2b9a555e2c9fdb55cb6c63ad74a39057c43777f2b5f167e5c77a9614"
            },
            "downloads": -1,
            "filename": "mediacrop-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ac5cf1268df47af532f61080524d0b80",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 20219,
            "upload_time": "2025-08-31T20:28:06",
            "upload_time_iso_8601": "2025-08-31T20:28:06.478863Z",
            "url": "https://files.pythonhosted.org/packages/19/bf/8ffc4e3a90720f904c3b8b3bf6456743e44c77209f3bc25e44684e22c098/mediacrop-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-31 20:28:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mallikmusaddiq1",
    "github_project": "mediacrop",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "mediacrop"
}
        
Elapsed time: 0.61402s