Skip to content

icelander/mattermost-video-preview

Repository files navigation

mattermost-video-preview

This Ruby script will generate preview images and clips for video files using the ffmpeg utility. By default it will generate a 5x6 grid of images from every 1 second of video, with each image being 120px tall. For example:

An example of the generated image

You can also configure commands to run against these files in a YAML file to post process them. The default implementation includes commands for transcoding for Web, iPhone, Roku, and also deleting the file.

Dependencies

To use this you'll need to install the following:

  • ffmpeg
  • JSON Ruby Gem
  • YAML Ruby Gem
  • RestClient Ruby Gem
  • My MediaInfo Ruby Gem
  • Digest Ruby Gem
  • Syslog/Logger Ruby Gem

Usage Instructions

First, create the file video_preview_config.yaml using video_preview_config.example.yaml as an example and configure it for your environment.

Next, call the script and pass the video file as the first parameter. For example

$ mattermost-video-preview.rb preview video_file.mp4

This will post a message to the specified channel with the preview image, some file information, and buttons to activate the configured commands.

An example of the message posted

Here's a video walkthrough of how it works

Version History

  • 0.1.0 - Now includes actions!
  • 0.0.2 - Now automatically sets interval based on video length. Sends useful output to Mattermost including filename, duration, file size, and format
  • 0.0.1 - Initial release

About

Generates preview images containing frames of a video file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages