{"id":18760541,"url":"https://github.com/evrone/carrierwave-video-thumbnailer","last_synced_at":"2025-04-05T21:08:56.068Z","repository":{"id":5226353,"uuid":"6402712","full_name":"evrone/carrierwave-video-thumbnailer","owner":"evrone","description":"A thumbnailer plugin for Carrierwave that makes easy thumbnailing of your uploaded videos","archived":false,"fork":false,"pushed_at":"2019-07-09T12:06:41.000Z","size":103,"stargazers_count":95,"open_issues_count":9,"forks_count":45,"subscribers_count":55,"default_branch":"master","last_synced_at":"2025-04-05T18:51:39.287Z","etag":null,"topics":["carrierwave","rails","ruby"],"latest_commit_sha":null,"homepage":"https://evrone.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"easydigitaldownloads/EDD-bbPress-Support","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evrone.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-26T11:19:51.000Z","updated_at":"2024-10-26T19:22:15.000Z","dependencies_parsed_at":"2022-08-19T07:31:52.593Z","dependency_job_id":null,"html_url":"https://github.com/evrone/carrierwave-video-thumbnailer","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evrone%2Fcarrierwave-video-thumbnailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evrone%2Fcarrierwave-video-thumbnailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evrone%2Fcarrierwave-video-thumbnailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evrone%2Fcarrierwave-video-thumbnailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evrone","download_url":"https://codeload.github.com/evrone/carrierwave-video-thumbnailer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399877,"owners_count":20932876,"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":["carrierwave","rails","ruby"],"created_at":"2024-11-07T18:13:06.955Z","updated_at":"2025-04-05T21:08:56.042Z","avatar_url":"https://github.com/evrone.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# carrierwave-video-thumbnailer\n\n[![Build Status](https://travis-ci.org/evrone/carrierwave-video-thumbnailer.png)](https://travis-ci.org/evrone/carrierwave-video-thumbnailer) \n[![Maintainability](https://api.codeclimate.com/v1/badges/a99a88d28ad37a79dbf6/maintainability)](https://codeclimate.com/github/evrone/carrierwave-video-thumbnailer/maintainability)\n[![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)\n\nA thumbnailer plugin for Carrierwave. It mixes into your uploader setup and\nmakes easy thumbnailing of your uploaded videos. This software is quite an\nalpha right now so any kind of OpenSource collaboration is welcome.\n\n\u003ca href=\"https://evrone.com/?utm_source=github.com\"\u003e\n  \u003cimg src=\"https://evrone.com/logo/evrone-sponsored-logo.png\"\n       alt=\"Sponsored by Evrone\" width=\"231\"\u003e\n\u003c/a\u003e\n\n### Demo\n\n![demo image](readme_content/image/demo.png)\n\n## Getting Started\n### Prerequisites\n\n`ffmpegthumbnailer` binary should be present on the PATH.\n\n[ffmpegthumbnailer git repository](https://github.com/dirkvdb/ffmpegthumbnailer)\n\n### Installation\n\n    gem install carrierwave-video-thumbnailer\n\nOr add to your Gemfile:\n\n```ruby\ngem 'carrierwave-video-thumbnailer'\n```\n\nIf you need resize thumbnail add \n[RMagick](https://github.com/rmagick/rmagick) or \n[MiniMagic](https://github.com/minimagick/minimagick)\n\n### Usage\n\n0. Install ffmpegthumbnailer\n\n    linux\n    \n        sudo apt install ffmpegthumbnailer\n    \n    MacOS\n    \n        brew install ffmpegthumbnailer  \n\n1. Create migration for your model:\n\n        rails g migration add_video_to_your_model video:string\n    \n2. Generate uploader\n\n        rails generate uploader Video\n    \n3. Mount uploader in model\n\n        class YourModel \u003c ApplicationRecord\n          mount_uploader :video, VideoUploader\n        end\n\n4. Update your uploader\n\n    In your Rails `app/uploaders/video_uploader.rb`:\n\n    ```ruby\n    class VideoUploader \u003c CarrierWave::Uploader::Base\n        include CarrierWave::Video  # for your video processing\n        include CarrierWave::Video::Thumbnailer\n        \n        storage :file\n        \n        def store_dir\n          \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\n        end\n        \n        version :thumb do\n          process thumbnail: [{format: 'png', quality: 10, size: 192, strip: true, logger: Rails.logger}]\n        \n          def full_filename for_file\n            png_name for_file, version_name\n          end\n        end\n        \n        def png_name for_file, version_name\n          %Q{#{version_name}_#{for_file.chomp(File.extname(for_file))}.png}\n        end\n    end\n    ```\n    \n    For resize thumbnail add version:\n    \n    ```ruby\n        class VideoUploader \u003c CarrierWave::Uploader::Base\n           include CarrierWave::MiniMagick\n        \n           ...\n        \n           version :small_thumb, from_version: :thumb do\n             process resize_to_fill: [20, 200]\n           end\n     \n        end\n    ```     \n\n5. Don't forget add parameter in controller \n    \n    ```ruby\n      def post_params\n        params.require(:post).permit(:title, :body, :video)\n      end\n    ```\n\n6. Add image_tag to your view\n\n    ###### erb example\n        \u003c%= image_tag(@post.video.thumb.url, alt: 'Video') if @post.video? %\u003e\n\nRuns `ffmpegthumbnailer` with CLI keys provided by your configuration or just\nuses quite a reasonable ffmpegthumbnailer's defaults.\n\n##### Thumbnailer Options\n\nThe options are passed as a hash to the `thumbnail` processing callback as\nshown in the example. The options may be, according to ffmpegthumbnailer's\nmanual:\n\n  * format: 'jpg' or 'png' ('jpg' is the default).\n  * quality: image quality (0 = bad, 10 = best) (default: 8) only applies to jpeg output\n  * size: size of the generated thumbnail in pixels (use 0 for original size) \n    (default value: 128 and keep initial aspect ratio).\n  * strip: movie film strip decoration (defaults to `false`).\n  * seek: time to seek to (`percentage` or absolute time `hh:mm:ss`) (default: 10)\n  * square: if set to `true` ignore aspect ratio and generate square thumbnail.\n  * workaround: if set to `true` runs ffmpegthumbnailer in some safe mode\n    (read `man ffmpegthumbnailer` for further explanations).\n  * logger: an object behaving like Rails.logger (may be omitted).\n  \n\n##### film stripes\n  \nFor disable film stripes in thumbnail check strip to false\n\n    process thumbnail: [{format: 'png', quality: 10, size: 192, strip: false, logger: Rails.logger}]\n\n## Contributing\n\nPlease read [Code of Conduct](CODE-OF-CONDUCT.md) and [Contributing Guidelines](CONTRIBUTING.md) for submitting pull requests to us.\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, \nsee the [tags on this repository](https://github.com/evrone/carrierwave-video-thumbnailer/tags). \n\n## Changelog\n\nThe changelog is [here](CHANGELOG.md).\n\n## Authors\n\n* [Pavel Argentov](https://github.com/argent-smith) - *Initial work*\n\nSee also the list of [contributors](https://github.com/evrone/carrierwave-video-thumbnailer/contributors) who participated in this project.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n## Acknowledgments\n\nHuge Thanks to **Rachel Heaton** (\u003chttps://github.com/rheaton\u003e) whose\n`carrierwave-video` gem has inspired me (and where I've borrowed some code as\nwell).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevrone%2Fcarrierwave-video-thumbnailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevrone%2Fcarrierwave-video-thumbnailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevrone%2Fcarrierwave-video-thumbnailer/lists"}