{"id":13478870,"url":"https://github.com/sabaatworld/batch-media-compressor","last_synced_at":"2025-03-27T08:31:05.188Z","repository":{"id":79648161,"uuid":"247872627","full_name":"sabaatworld/batch-media-compressor","owner":"sabaatworld","description":"Compress your entire photo \u0026 video library and take it with you everywhere.","archived":false,"fork":false,"pushed_at":"2024-08-25T17:56:58.000Z","size":1489,"stargazers_count":9,"open_issues_count":3,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-30T12:48:18.505Z","etag":null,"topics":["compressed-media","conversion","cross-platform","exiftool","ffmpeg","image-magick","images","macos","photo-library","photography","portable-devices","python3","qt","videos","vscode","windows"],"latest_commit_sha":null,"homepage":"https://github.com/sabaatworld/batch-media-compressor","language":"Python","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/sabaatworld.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}},"created_at":"2020-03-17T03:41:28.000Z","updated_at":"2024-07-17T18:05:26.000Z","dependencies_parsed_at":"2024-01-14T08:59:38.577Z","dependency_job_id":null,"html_url":"https://github.com/sabaatworld/batch-media-compressor","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabaatworld%2Fbatch-media-compressor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabaatworld%2Fbatch-media-compressor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabaatworld%2Fbatch-media-compressor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sabaatworld%2Fbatch-media-compressor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sabaatworld","download_url":"https://codeload.github.com/sabaatworld/batch-media-compressor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245809756,"owners_count":20676045,"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":["compressed-media","conversion","cross-platform","exiftool","ffmpeg","image-magick","images","macos","photo-library","photography","portable-devices","python3","qt","videos","vscode","windows"],"created_at":"2024-07-31T16:02:04.893Z","updated_at":"2025-03-27T08:31:04.367Z","avatar_url":"https://github.com/sabaatworld.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003cp\u003e\n\u003ca href=\"https://github.com/sabaatworld/batch-media-compressor/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/sabaatworld/batch-media-compressor?include_prereleases\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/sabaatworld/batch-media-compressor/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release-date/sabaatworld/batch-media-compressor\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Batch Media Compressor\n\n## Introduction\n\nSimple application to convert and compress all of your images and videos so that you can store them on mobile device and access them anywhere. It support a large variety or image and video formats (including RAW image formats). This application will compress all images to JPG and videos to MP4 (HEVC) accoring to the configured settings.\n\nIf you're like me and value the privacy of your personal images or videos (or maybe you just don't want to pay for services like Google Photos \u0026 Amazon Photos), but still want the benifits of being able to revisit you memories on your portable devices, the this app is sure to help. The aim of this project is to compress the entire image / video library to a small enough size that can by synced over to your phone or other porable devices. I shrunk down my 385GB image and video library to 27GB; which I put on my phone storage.\n\n## Getting Started\n\nIts super easy to get started:\n\n1. Download and install [ExifTool](https://exiftool.org), [Image Magick](https://imagemagick.org/index.php) and [FFMPEG](https://ffmpeg.org).\n    * On OSX, you need to additionally install **dcraw** and **ufraw** to support RAW image formats. On Windows, these are included with Image Magick.\n    * It's easiest if you add there tools to you PATH environment variable so that Batch Media Compressor can access them without any configuration.\n    * If you're unable to or don't want to add these to PATH, then feel free to configure the location of these tools in the **Edit Preferences** window.\n1. Download the latest version of the app from the [releases](https://github.com/sabaatworld/batch-media-compressor/releases) page.\n1. Select directories to scan and output directories using **Right-click on Tray Icon** -\u003e **Edit Preferences**.\n1. Start media compression using **Right-click on Tray Icon** -\u003e **Start Processing**.\n\n![application window](screenshots/app_window.png)\n\n### Multithreading (Maximizing Conversion Speed)\n\nMake sure that you have \"worker\" count is equal to the number of logical CPU cores.\n\nIf you want to offload video conversion to your **Nvidia GPU**, you will need to a version of **ffmpeg** that support hardware encoding. Since this type of ffmpeg binary is not distributable, you will need compile it from source. For windows, the easiest way to do this was [media-autobuild_suite](https://github.com/m-ab-s/media-autobuild_suite). However, there are many other options available as mentioned [ffmpeg compilation guide](https://trac.ffmpeg.org/wiki/CompilationGuide). Basically, you need \"--enable-cuda-nvcc\" / \"--enable-libnpp\" support in your ffmpeg binary, which in-turn requires [Nvidia's CUDA SDK](https://developer.nvidia.com/cuda-toolkit) to run.\n\nOnce you have ffmpeg setup, crank up the GPU count and workers to indicate that you want to convert videos using your GPU. I've tested parallel conversion on 2 X Nvidia GTX 1080 GPUs on my Windows 10 machine and they really accelerate the video conversion. Note that consumer GPUs like these only support a limited number of conversions in parallel so conversion will actually fail if you want to have more than one worker per GPU. To remove this restriction, apply this [nvidia-patch](https://github.com/keylase/nvidia-patch).\n\n### Syncing Media to Portables\n\n#### Android\n\nAlthough you could just copy over the compressed / converted files to your portable device, the best option is to setup [Syncthing](https://syncthing.net/) to automatially sync the converted files to your \"DCIM\" directory on your portable devices. This works on LAN as well over the internet.\n\n#### iOS\n\nUse iTunes to sync photos and videos from the output directory. Note that for some reason iTunes needs more space on the device than the actual size of the compressed media. In the near future, I'll release an app to make things easier for iOS users.\n\n## Developer Instructions\n\n### VSCode Setup Instructions\n\n1. Setup VSCode with Python extension (Tested with Python: 3.7.5)\n1. Download python3 for Win. Do “brew install python3” for Mac.\n1. Check `python3 --version` (mac) , `py -3 --version` (win)\n1. Create project dir and open in VSCode\n1. Select Python interpreter in VSCode\n1. Create **virtual environment**\n\n    * Mac\n\n    ```bash\n    python3 -m venv .venv\n    source .venv/bin/activate\n    ```\n\n    * Win\n      (If error then allow execution: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process)\n\n    ```bash\n    py -3 -m venv .venv\n    Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force\n    .venv\\scripts\\activate\n    ```\n\n1. Download **ExifTool** (Tested with 11.76) binary - \u003chttps://www.sno.phy.queensu.ca/~phil/exiftool/\u003e. Ensure `exiftool` is on PATH.\n1. The requirements.txt file has been created using `pip freeze \u003e requirements.txt`. Execute `pip install -r requirements.txt` to install the required packages.\n1. Install **ImageMagick** (Tested with 7.0.9) - \u003chttp://docs.wand-py.org/en/0.5.7/guide/install.html\u003e. Ensure \"MAGICK_HOME\" has been setup properly. Also ensure that RAW handling binaries are available; which can be checked by running `convert -list configure`.\n\n    * Installing RAW support libraries on Mac\n\n    ```bash\n    brew install dcraw\n    brew install ufraw\n    ```\n\n1. Install **ffmpeg** (Tested with 4.2.1) - \u003chttps://www.ffmpeg.org/download.html\u003e. Make sure `ffmpeg` is on PATH.\n1. Install **Qt Creator** (Tested with 5.12.x) if you want to change the UI - \u003chttps://www.qt.io/offline-installers\u003e.\n\n### Running the App\n\nSimply launch `main.py` in VSCode to start the application. This should pop up the main application window.\n\n### Building Binary\n\n#### OSX\n\n```\n./packaging/build_osx.sh\n```\n\n#### Windows\n\nPackaging on windows requires the following:\n\n1. [Windows 10 SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk)\n1. [Inno Setup](https://jrsoftware.org/isdl.php)\n\n```\n .\\packaging\\build_win.bat \u003cPATH_TO_PFX_FILE\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsabaatworld%2Fbatch-media-compressor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsabaatworld%2Fbatch-media-compressor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsabaatworld%2Fbatch-media-compressor/lists"}