{"id":16646663,"url":"https://github.com/alexdelorenzo/cast_convert","last_synced_at":"2025-06-26T12:06:10.240Z","repository":{"id":62347493,"uuid":"70820599","full_name":"alexdelorenzo/cast_convert","owner":"alexdelorenzo","description":"📽️ Convert videos to Chromecast compatible formats","archived":false,"fork":false,"pushed_at":"2024-09-30T04:28:25.000Z","size":328,"stargazers_count":8,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T02:51:47.777Z","etag":null,"topics":["chromecast","converter","ffmpeg","transcoding","video","video-processing"],"latest_commit_sha":null,"homepage":"https://alexdelorenzo.dev","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexdelorenzo.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},"funding":{"github":["alexdelorenzo"]}},"created_at":"2016-10-13T15:26:15.000Z","updated_at":"2024-11-20T12:14:58.000Z","dependencies_parsed_at":"2023-11-28T07:27:54.838Z","dependency_job_id":"6d324cff-c6cd-42a7-90e8-39f2c507f36c","html_url":"https://github.com/alexdelorenzo/cast_convert","commit_stats":{"total_commits":324,"total_committers":4,"mean_commits":81.0,"dds":"0.12345679012345678","last_synced_commit":"2aa0f87defbcb0841ac0672c2fb152c04c418529"},"previous_names":["thismachinechills/cast_convert"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdelorenzo%2Fcast_convert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdelorenzo%2Fcast_convert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdelorenzo%2Fcast_convert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdelorenzo%2Fcast_convert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexdelorenzo","download_url":"https://codeload.github.com/alexdelorenzo/cast_convert/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244829398,"owners_count":20517300,"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":["chromecast","converter","ffmpeg","transcoding","video","video-processing"],"created_at":"2024-10-12T08:42:45.656Z","updated_at":"2025-03-21T16:30:52.229Z","avatar_url":"https://github.com/alexdelorenzo.png","language":"Python","funding_links":["https://github.com/sponsors/alexdelorenzo"],"categories":[],"sub_categories":[],"readme":"# 📽️ Convert videos for Chromecasts\n\nIdentify and convert videos to formats that are Chromecast supported.\n\nCast Convert can tell you whether videos will play correctly on your casting devices. If they won't, this project can convert videos into formats that devices do support.\n\n[Click here to see a list of supported devices](#supported-devices).\n\n### What Cast Convert does\n\n`cast-convert` can identify and correct a video's incompatibility with a device caused by the video's:\n\n- Video encoding\n- Audio encoding\n- Encoder profile\n- Encoder level\n- Container file format\n- Frame rate\n- Resolution\n- Subtitle format\n\nThis utility can tell you if a video will or won't play correctly on your casting device. It can then efficiently modify\nthe video so that it will play on the device.\n\n### Why use Cast Convert over other options?\n\nCast Convert calculates the least amount of transcoding required to playback videos. It also has detailed support profiles for every format supported by each  device, whereas other transcoding options tend to force all videos into one format.\n\nFor example, you may have a video named `video.mp4` that isn't compatible with your device. Cast Convert can generate a transcoding plan that does the least amount of transcoding necessary instead of blindly transcoding every video into the same format.\n\nYou can use `cast-convert inspect` to scan the video and come up with the most efficient transcoding plan:\n```bash\n$ cast-convert inspect --name '1st Gen' video.mp4\n[❌️] Need to convert \"~/video.mp4\" to play on Chromecast 1st Gen...\n  Must convert from:\n    - File Container: mp4\n    - Video Codec: vp9\n    - Resolution: 640x480\n    - Frame Rate: 29.970\n    - Audio Codec: mp3\n  To:\n    - Video Codec: avc\n    - Encoder Level: 4.1\n```\n\nSince the video is encoded with a supported audio codec, within a supported container and supported framerate and resolution, only the video encoding must change.\n\nIf you used another tool, it may have tried to convert *all* videos to the same format, no matter how inefficient it is. That means `video.mp4` might have more than its video encoding changed, it might have to have its container, audio codec and framerate changed, as well. That can take up an unnecessary amount of time and resources.\n\nSimilarly, the following might have its video track transcoded, too, despite only the audio track needing to be converted to a supported format:\n\n```bash\n$ cast-convert inspect --name '1st Gen' video.mp4\n[❌️] Need to convert \"~/video.mp4\" to play on Chromecast 1st Gen...\n  Must convert from:\n    - File Container: mp4\n    - Video Codec: vp9\n    - Resolution: 640x480\n    - Frame Rate: 29.970\n    - Audio Codec: dts\n  To:\n    - Audio Codec: mp3\n```\n\n### About Cast Convert\n\nIndividual casting devices like the Chromecast have unique video encoding, audio encoding and container support\ncombinations for video files. Cast Convert has detailed compatibility profiles for each individual Chromecast model on\nthe market.\n\n`cast-convert` will inspect a video's metadata to determine what video attributes must get changed to successfully play\nit. To use resources efficiently, it will determine only the minimum amount of transcoding needed to successfully play\neach video back.\n\n### Supported devices\n\n- Chromecast 1st Gen\n- Chromecast 2nd Gen\n- Chromecast 3rd Gen\n- Chromecast Ultra\n- Chromecast with Google TV\n- Google Nest Hub\n- Nest Hub Max\n\n## Requirements\n\n### Minimum\n\n- [Python 3.12](https://www.python.org/downloads/)\n- [`mediainfo`](https://mediaarea.net/en/MediaInfo)\n- [`ffmpeg`](https://ffmpeg.org/)\n\n### Encoders\n\n- [`libmp3lame`](https://lame.sourceforge.io/)\n- [`x264`](https://www.videolan.org/developers/x264.html)\n\n## Installation\n\n```bash\n$ python3 -m pip install cast_convert\n```\n\n## Usage\n\n### Launch\n\nYou can run the Python module directly:\n\n```bash\n$ python3 -m cast_convert --help\n```\n\nOr you can use launcher that gets added to your `$PATH`:\n\n```bash\n$ cast-convert --help\n```\n\n### Options and commands\n\n```bash\n                        \n Usage: cast-convert [OPTIONS] COMMAND [ARGS]...\n\n 📽️ Identify and convert videos to formats that are Chromecast supported.\n\n See https://github.com/alexdelorenzo/cast_contvert for more information.\n Copyright © 2022 Alex DeLorenzo (https://alexdelorenzo.dev).\n\n╭─ ❓ About ───────────────────────────────────────────────────────────────────╮\n│ --log-level  -l      [critical|debug|error|fata  🪵 Set the minimum logging  │\n│                      l|info|warn]                level.                      │\n│                                                  [default: warn]             │\n│ --version    -v                                  🔢 Show application versio… │\n│                                                  and quit.                   │\n╰──────────────────────────────────────────────────────────────────────────────╯\n╭─ 📊 Analyze ─────────────────────────────────────────────────────────────────╮\n│ command   📜 Get FFmpeg transcoding command.                                 │\n│ inspect   🔎 Inspect videos to see what attributes should get transcoded.    │\n╰──────────────────────────────────────────────────────────────────────────────╯\n╭─ 📽️ Convert ─────────────────────────────────────────────────────────────────╮\n│ convert   📼 Convert videos so they're compatible with specified device.     │\n│ watch     👀 Watch directories for new or modified videos and convert them.  │\n╰──────────────────────────────────────────────────────────────────────────────╯\n╭─ 🛠️ Hardware Support ────────────────────────────────────────────────────────╮\n│ devices          📺 List all supported devices.                              │\n╰──────────────────────────────────────────────────────────────────────────────╯\n```\n\n### Parameters\n\n#### `--log-level`\n\nYou can set the log level using the `--log-level` flag:\n\n```bash\n$ cast-convert --log-level debug devices\n[06:12:49] DEBUG    DEBUG:root:Loaded devices from file     base.py:201\nYou can use these device names with the --name flag:\n    - Chromecast 1st Gen\n    - Chromecast 2nd Gen\n    - Chromecast 3rd Gen\n    - Chromecast Ultra\n    - Chromecast with Google TV\n    - Google Nest Hub\n    - Nest Hub Max\n```\n\nDefault log level is `warn`.\n\n#### `--name`\n\nYou can specify the model of your device with the `--name` flag. It uses fuzzy matching, so you don't have to type out\ndevice names completely.\n\nThe `--name` flag comes *after* [`cast-convert` commands](#commands).\n\n```bash\n$ cast-convert inspect --name '1st Gen' ~/video.webm\n[🔄️] Need to convert \"/home/user/video.webm\" to play on Chromecast 1st Gen...\n  Must convert from:\n    - Container: webm\n    - Codec: vp9\n    - Resolution: 406x260\n    - Fps: 25.000\n    - Level: 0\n  To:\n    - Codec: avc\n    - Level: 4.1\n```\n\nDefault device name is `Chromecast 1st Gen`.\n\n#### `PATHS`\n\nYou can specify one or more file or directory paths as `PATHS` arguments.\n\nYou must specify at least one path. Paths are supplied after commands, and they are the *last* arguments\nto `cast-convert`.\n\n```bash\n$ cast-convert command vid1.mkv vid2.mkv\nffmpeg -fflags +genpts -i 'vid1.mkv' -acodec copy -movflags faststart -scodec \ncopy -threads 12 -vcodec libx264 -vlevel 4.1 'vid1_transcoded.mkv' -y\n\nffmpeg -fflags +genpts -i 'vid2.mkv' -acodec copy -movflags faststart -scodec \ncopy -threads 12 -vcodec libx264 -vlevel 4.1 'vid2_transcoded.mkv' -y\n```\n\n### Commands\n\n#### `convert`\n\n```bash\n Usage: cast-convert convert [OPTIONS] 📂PATHS\n\n 📼 Convert videos so they're compatible with specified device.\n\n╭─ Arguments ──────────────────────────────────────────────────────────────────╮\n│ *    paths      📂PATHS  Path(s) to video(s). [required]                     │\n╰──────────────────────────────────────────────────────────────────────────────╯\n╭─ Options ────────────────────────────────────────────────────────────────────╮\n│ --help          Show this message and exit.                                  │\n╰──────────────────────────────────────────────────────────────────────────────╯\n╭─ 📺 Device ──────────────────────────────────────────────────────────────────╮\n│ --name  -n      TEXT  📛 Device model name. [default: Chromecast 1st Gen]    │\n╰──────────────────────────────────────────────────────────────────────────────╯\n╭─ 🖥 Encoder Options ──────────────────────────────────────────────────────────╮\n│ --replace  -r               💾 Replace original file with transcoded video.  │\n│ --threads  -t      INTEGER  🧵 Number of threads to tell FFMPEG to use per   │\n│                             job.                                             │\n│                             [default: 12]                                    │\n╰──────────────────────────────────────────────────────────────────────────────╯\n```\n\n#### `devices`\n\n```bash\n Usage: cast-convert devices [OPTIONS]\n\n 📺 List all supported devices.\n\n╭─ Options ────────────────────────────────────────────────────────────────────╮\n│ --help          Show this message and exit.                                  │\n╰──────────────────────────────────────────────────────────────────────────────╯\n╭─ 📺 Device ──────────────────────────────────────────────────────────────────╮\n│ --details  -d        ℹ Show detailed device information.                     │\n╰──────────────────────────────────────────────────────────────────────────────╯\n```\n\n#### `command`\n\n```bash\n Usage: cast-convert command [OPTIONS] 📂PATHS\n\n 📜 Get FFmpeg transcoding command.\n\n╭─ Arguments ──────────────────────────────────────────────────────────────────╮\n│ *    paths      📂PATHS  Path(s) to video(s). [required]                     │\n╰──────────────────────────────────────────────────────────────────────────────╯\n╭─ Options ────────────────────────────────────────────────────────────────────╮\n│ --help          Show this message and exit.                                  │\n╰──────────────────────────────────────────────────────────────────────────────╯\n╭─ 📺 Device ──────────────────────────────────────────────────────────────────╮\n│ --name  -n      TEXT  📛 Device model name. [default: Chromecast 1st Gen]    │\n╰──────────────────────────────────────────────────────────────────────────────╯\n╭─ 🖥 Encoder Options ──────────────────────────────────────────────────────────╮\n│ --replace  -r               💾 Replace original file with transcoded video.  │\n│ --threads  -t      INTEGER  🧵 Number of threads to tell FFMPEG to use per   │\n│                             job.                                             │\n│                             [default: 12]                                    │\n╰──────────────────────────────────────────────────────────────────────────────╯\n```\n\n#### `inspect`\n\n```bash\n Usage: cast-convert inspect [OPTIONS] 📂PATHS \n\n 🔎 Inspect videos to see what attributes should get transcoded.                \n\n╭─ Arguments ──────────────────────────────────────────────────────────────────╮\n│ *    paths      📂PATHS  Path(s) to video(s). [required]                     │\n╰──────────────────────────────────────────────────────────────────────────────╯\n╭─ Options ────────────────────────────────────────────────────────────────────╮\n│ --help          Show this message and exit.                                  │\n╰──────────────────────────────────────────────────────────────────────────────╯\n╭─ 📺 Device ──────────────────────────────────────────────────────────────────╮\n│ --name  -n      TEXT  📛 Device model name. [default: Chromecast 1st Gen]    │\n╰──────────────────────────────────────────────────────────────────────────────╯\n```\n\n#### `watch`\n\n```bash\n Usage: cast-convert watch [OPTIONS] 📂PATHS\n\n 👀 Watch directories for new or modified videos and convert them.\n\n╭─ Arguments ──────────────────────────────────────────────────────────────────╮\n│ *    paths      📂PATHS  Path(s) to video(s). [required]                     │\n╰──────────────────────────────────────────────────────────────────────────────╯\n╭─ Options ────────────────────────────────────────────────────────────────────╮\n│ --help          Show this message and exit.                                  │\n╰──────────────────────────────────────────────────────────────────────────────╯\n╭─ 📺 Device ──────────────────────────────────────────────────────────────────╮\n│ --name  -n      TEXT  📛 Device model name. [default: Chromecast 1st Gen]    │\n╰──────────────────────────────────────────────────────────────────────────────╯\n╭─ 🖥 Encoder Options ──────────────────────────────────────────────────────────╮\n│ --jobs     -j      INTEGER  🔢 Number of simultaneous transcoding jobs.      │\n│                             [default: 2]                                     │\n│ --replace  -r               💾 Replace original file with transcoded video.  │\n│ --threads  -t      INTEGER  🧵 Number of threads to tell FFMPEG to use per   │\n│                             job.                                             │\n│                             [default: 12]                                    │\n╰──────────────────────────────────────────────────────────────────────────────╯\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexdelorenzo%2Fcast_convert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexdelorenzo%2Fcast_convert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexdelorenzo%2Fcast_convert/lists"}