{"id":50359700,"url":"https://github.com/davidix/video-optimizer","last_synced_at":"2026-05-30T00:30:47.358Z","repository":{"id":354495197,"uuid":"1223879405","full_name":"davidix/video-optimizer","owner":"davidix","description":"FFmpeg-based video size optimizer with Typer/Rich CLI","archived":false,"fork":false,"pushed_at":"2026-04-28T19:02:26.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-28T21:05:12.837Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2026-04-28T18:39:31.000Z","updated_at":"2026-04-28T19:02:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/davidix/video-optimizer","commit_stats":null,"previous_names":["davidix/video-optimizer"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/davidix/video-optimizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidix%2Fvideo-optimizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidix%2Fvideo-optimizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidix%2Fvideo-optimizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidix%2Fvideo-optimizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidix","download_url":"https://codeload.github.com/davidix/video-optimizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidix%2Fvideo-optimizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33676190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-05-30T00:30:47.164Z","updated_at":"2026-05-30T00:30:47.349Z","avatar_url":"https://github.com/davidix.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Video Optimizer\n\nReduce video file size without visible quality loss. Uses FFmpeg with CRF-based H.265/H.264 encoding under the hood.\n\n## Prerequisites\n\nInstall FFmpeg:\n\n```bash\n# macOS\nbrew install ffmpeg\n\n# Ubuntu / Debian\nsudo apt install ffmpeg\n```\n\n## Install (Python)\n\n```bash\npython -m venv venv\nsource venv/bin/activate   # Windows: venv\\Scripts\\activate\npip install -r requirements.txt\n```\n\n## Web UI (Flask)\n\nBootstrap + drag-and-drop multi-file uploads; same encoding as the CLI (`optimize_file`). **Advanced** options (container mp4/mkv, FFmpeg `-preset`, audio policy, CRF/codec overrides, keep-if-larger, hwaccel) use the same `apply_encode_overrides` rules as `optimize`. Each queued job has **Cancel** and shows **Before / After** sizes. Outputs go to `web_outputs/\u003cjob_id\u003e/` and can be downloaded from the browser.\n\n```bash\nsource venv/bin/activate\npython web.py\n# Open http://127.0.0.1:5000\n```\n\nSet `PORT=8080` to listen on another port.\n\n## Usage\n\nThe CLI is **`vopt`**-style: subcommands (`optimize`, `info`, `presets`, `watch`). For convenience, paths without a subcommand are treated as **`optimize`** (same as before).\n\n```bash\n# Help\npython video_optimizer.py --help\npython video_optimizer.py optimize --help\n\n# Optimize a single video (default: medium preset)\npython video_optimizer.py optimize video.mp4\n# Legacy (equivalent — inserts \"optimize\" automatically):\npython video_optimizer.py video.mp4\n\n# Light / aggressive presets\npython video_optimizer.py optimize -p light video.mp4\npython video_optimizer.py optimize -p aggressive video.mp4\n\n# Output container, audio, FFmpeg encoder speed (also on `watch`)\npython video_optimizer.py optimize clip.mp4 -f mkv --audio copy --ffmpeg-preset slow\npython video_optimizer.py optimize clip.mp4 --audio aac --audio-bitrate 192k --container mp4\n\n# Batch folder, recursive, custom output directory\npython video_optimizer.py optimize -r ./videos/ -o ./output/\n\n# Dry-run: probe and show planned ffmpeg command (no encode)\npython video_optimizer.py optimize --dry-run video.mp4\n\n# JSON summary (machine-readable, no Rich styling)\npython video_optimizer.py optimize video.mp4 --json\n\n# Skip if `\u003cstem\u003e_optimized.mp4` already exists in output dir\npython video_optimizer.py optimize --skip-existing -o ./out/ video.mp4\n\n# Parallel encodes (separate progress tasks)\npython video_optimizer.py optimize -j 2 ./clips/*.mp4\n\n# CI / logs: no colors or Rich progress\npython video_optimizer.py optimize video.mp4 --plain\n\n# List presets (table)\npython video_optimizer.py presets\n\n# Inspect a file (ffprobe, Rich tables)\npython video_optimizer.py info video.mp4\n\n# Watch a directory for new videos and optimize them\npython video_optimizer.py watch ./incoming/ -o ./out/\n```\n\n## Presets\n\n| Preset       | CRF | Codec   | Description                                  |\n|--------------|-----|---------|----------------------------------------------|\n| `light`      | 18  | H.265   | Minimal compression, virtually lossless      |\n| `medium`     | 23  | H.265   | Balanced compression, near-transparent       |\n| `aggressive` | 28  | H.265   | Maximum compression, minor quality trade-off   |\n\n## Commands\n\n| Command    | Description |\n|------------|-------------|\n| `optimize` | Encode inputs with the chosen preset (default when omitted). |\n| `presets`  | Print preset table. |\n| `info`     | Show container + stream details via ffprobe. |\n| `watch`    | Watch a directory and run `optimize` on new video files (requires `watchdog`). |\n\n## `optimize` options\n\n| Flag | Description |\n|------|-------------|\n| `-p`, `--preset` | `light`, `medium`, or `aggressive` (default: `medium`). |\n| `-o`, `--output-dir` | Output directory (default: same as each input). |\n| `-r`, `--recursive` | Recurse into directories. |\n| `--hwaccel` | Enable FFmpeg `-hwaccel auto`. |\n| `--keep` | Keep output even if larger than the source. |\n| `--crf` | Override CRF (0–51). |\n| `--codec` | `h264` or `h265` (maps to libx264 / libx265). |\n| `--dry-run` | Probe only; print planned output path and ffmpeg command. |\n| `--json` | Print JSON summary to stdout. |\n| `--skip-existing` | Skip if `{stem}_optimized` with the chosen extension already exists in the output dir. |\n| `-j`, `--workers` | Parallel jobs (default: 1). |\n| `--plain`, `--no-color` | Disable colors and Rich progress. |\n| `-f`, `--container` | Output container for H.264/H.265: `mp4` (default, `+faststart`) or `mkv`. |\n| `--ffmpeg-preset` | Override FFmpeg encoder `-preset` (e.g. `slow`, `veryfast`). |\n| `--audio` | `preset` (recipe default), `copy`, `aac`, or `none` (strip). |\n| `--audio-bitrate` | AAC bitrate when using `--audio aac`, or override when preset uses AAC (e.g. `128k`). |\n\n## How it works\n\nThe tool re-encodes videos using **Constant Rate Factor (CRF)** mode, which targets a consistent perceptual quality level rather than a fixed bitrate. Combined with **H.265 (HEVC)**, this typically achieves a large size reduction vs. older H.264 encodes at similar visual quality. Audio is either copied (`light`) or re-encoded to AAC (`medium`, `aggressive`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidix%2Fvideo-optimizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidix%2Fvideo-optimizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidix%2Fvideo-optimizer/lists"}