{"id":20105086,"url":"https://github.com/jdee/video_converter","last_synced_at":"2025-09-20T23:32:46.019Z","repository":{"id":138590886,"uuid":"177829794","full_name":"jdee/video_converter","owner":"jdee","description":"Video converter gem","archived":false,"fork":false,"pushed_at":"2019-08-01T16:52:50.000Z","size":92,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-13T17:51:17.902Z","etag":null,"topics":["cli","gem","mp4","rake","ruby","video"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/jdee.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-26T16:39:56.000Z","updated_at":"2023-09-15T08:27:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"2d4e75c3-2a25-4b8c-96e8-aaec15c02265","html_url":"https://github.com/jdee/video_converter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Fvideo_converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Fvideo_converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Fvideo_converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Fvideo_converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdee","download_url":"https://codeload.github.com/jdee/video_converter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233694811,"owners_count":18715506,"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":["cli","gem","mp4","rake","ruby","video"],"created_at":"2024-11-13T17:45:47.934Z","updated_at":"2025-09-20T23:32:45.625Z","avatar_url":"https://github.com/jdee.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# video_converter gem\n\n[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/jdee/video_converter/blob/master/LICENSE)\n[![CircleCI](https://img.shields.io/circleci/project/github/jdee/video_converter.svg)](https://circleci.com/gh/jdee/video_converter)\n\n## Overview\n\nBatch-converts videos to MP4 format from any recognized format, including MP4.\nConverting\nMP4 files can be useful to reduce the bitrate. Depends on ffmpeg, mp4v2 and\nterminal-notifier from homebrew. Automatically checks for and installs these\ndependencies if they are absent at runtime.\n\nThe `convert_videos` command scans an input folder (~/Downloads by default,\noverridden with the `-f` option) for all video files with\nsuffixes mp4, mov, avi, wmv, flv and vob. This is done by globbing for both\nall-lowercase and all-uppercase suffixes. The command will recognize file.mov\nand file.MOV, but not file.Mov. Searching is not recursive.\n\nOutput files are always MP4. They will have the same name as the originals, with\nsuffix .mp4. **Note:** Currently if the input and output folders are the same,\nan input MP4 video may be overwritten and lost, causing the conversion\nto fail. By default, the output folder\nis ~/Desktop. This may be overridden with the `-o` option.\n\nMP4 files are generated using the H.264 codec using a CRF that may be specified\nas an option. Legal values are 0-51. Recommended values are 18-28. The default\nis 28. Override this using the `-c` option.\n\nBy default, the command starts a backround job and leaves log files in a folder\n(~/logs/video_converter by default, overridden with the `-l` option). It\nremoves and recreates the folder each time the script runs. It generates a file\nthere called `convert_videos.log` as well as a log file for each conversion.\n\nTo run the command in the foreground, specify `-F` or `--foreground`.\n\nIf the script runs in the background, it will use `terminal-notifier` to\ngenerate a desktop notification when it completes. Clicking on the notification\nwill open the Photos app.\n\nWhen a source video is MP4, the converted file is compared with the original\nafter conversion. If the converted file is 90% or more of the original file\nsize, the original file is copied over the converted file, since the conversion\nmakes little difference and presumably only degrades quality. Otherwise the\nconverted file is retained. For non-MP4 source videos, no comparison is made.\n\nModification times of converted files will always be the same as the originals\nafter conversion.\n\nAfter conversion, by default, all source videos are removed from the input\nfolder if it is writable. Override this behavior using the `--no-clean` option.\n\n### Non-macOS install\n\nInstall `ffmpeg` and `mp4v2` manually in order to use this utility. When\nrunning `convert_videos` in the background, no\nnotification will be generated. If `ffmpeg` and `mp4v2` are not available,\nthis is a fatal error unless they can be installed automatically via `brew`.\n\n## Try it out\n\nConvert all videos in `~/Downloads`, generating output in `~/Desktop`.\n\n```bash\ngit clone https://github.com/jdee/video_converter\ncd video_converter\nbundle check || bundle install\nbundle exec rake convert\n```\n\n## Build and install the gem\n\n```bash\n$ bundle check || bundle install\n$ [sudo] bundle exec rake install:local\n```\n\n## CLI Usage\n\n```bash\n$ convert_videos -h\n```\n\n### Convert VOB videos in /Volumes/DVD/VIDEO_TS and output to ~/Desktop\n\nThe default input folder is `~/Downloads`.\n\n```bash\n$ convert_videos -f /Volumes/DVD/VIDEO_TS\n```\n\n### Specify a custom output folder\n\nThe default output folder is '~/Desktop'.\n\n```bash\n$ convert_videos -o ~/myvideos\n```\n\n### Specify a custom log folder\n\nThe default log folder is '~/logs/video_converter'.\n\n```bash\n$ convert_videos -l ~/mylogs\n```\n\n### Convert videos in the foreground and write to a custom output folder\n\n```bash\n$ convert_videos -Fo ~/myvideos\n```\n\n### Convert videos with a CRF of 23\n\n```bash\n$ convert_videos -c 23\n```\n\n## Environment variables\n\nAll modes of invocation (CLI, Rake, Ruby) recognize the following environment\nvariables:\n\n```\nVIDEO_CONVERTER_VERBOSE\nVIDEO_CONVERTER_FOREGROUND\nVIDEO_CONVERTER_CLEAN\nVIDEO_CONVERTER_FOLDER\nVIDEO_CONVERTER_LOG_FOLDER\nVIDEO_CONVERTER_OUTPUT_FOLDER\nVIDEO_CONVERTER_CRF\n```\n\nThe first three all represent Boolean flags. Any value starting with y or\nt (case-insensitive) indicates a value of true. Any other value will be\ninterpreted as false.\n\n## With a Gemfile\n\n```Ruby\nsource 'https://rubygems.org'\n\ngem 'rake', '~\u003e 12.3' # If you want the Rake task\ngem 'video_converter', path: '~/video_converter'\n```\n\n```bash\n$ bundle check || bundle install\n$ bundle exec bin/convert_videos -h\n```\n\n## Rake task\n\n```Ruby\n# Add to Rakefile\nrequire 'video_converter/rake_task'\nVideoConverter::RakeTask.new(\n  :convert_videos,\n  verbose: false,\n  foreground: false,\n  clean: true,\n  input_folder: '~/Downloads',\n  output_folder: '~/Desktop',\n  log_folder: '~/logs/video_converter',\n  crf: 28.0\n)\n```\n\n```bash\n$ rake convert_videos\n```\n\n## Ruby code\n\n```Ruby\nrequire 'video_converter/converter'\nVideoConverter::Converter.new(\n  verbose: false,\n  foreground: false,\n  clean: true,\n  input_folder: '~/Downloads',\n  log_folder: '~/logs/video_converter',\n  output_folder: '~/Desktop',\n  crf: 28.0\n).run\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdee%2Fvideo_converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdee%2Fvideo_converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdee%2Fvideo_converter/lists"}