Videoinfo
Videoinfo is a simple tool for aggregating video metadata and capturing/uploading screenshots.
Installation
First, you'll want to install the prerequisite binaries and make sure they are in your PATH.
Add this line to your application's Gemfile:
gem 'videoinfo'
And then execute:
bundle install
Or install it yourself with:
$ gem install videoinfo
Configuration
There are only a few configuration options:
Videoinfo.mediainfo_binary = '/path/to/mediainfo'
Videoinfo.ffmpeg_binary = '/path/to/ffmpeg'
Videoinfo.image_host = ImageHosts::Imgur.new
Videoinfo.interactive = true
Usage
Command Line
$ videoinfo -h
Usage: videoinfo [options] "MOVIENAME/SHOWNAME" file
-i, --image-host=IMAGEHOST The image host to use for uploading screenshots. Default: Imgur
-s, --screenshots=SCREENSHOTS The number of screenshots to create, max 6. Default: 2
-e, --episode=EPISODE The TV show episode or season number. Formats: S01E01 or S01
-n, --no-prompt Disable interactive mode
-h, --help Show this message
$ videoinfo -s 5 -i Imgur 'Hackers' Hackers.1995.mkv > hackers.txt
Is your movie "Hackers (1995)" (tt0113243)? [Y/n] y
In scripts
The simpliest way to analyze a movie is with Videoinfo.analyze_movie()
:
result = Videoinfo.analyze_movie('hackers', 'Hackers.1995.mkv', 0)
result.imdb_id
result.title
result.plot_summary
result.release_date
result.rating
result.rating_over_ten
result.genres
result.director
result.writers
result.runtime
result.imdb_url
result.wiki_url
result.trailer_url
result.screenshot_urls
result.mediainfo
Or, you can be more explicit:
movie = Videoinfo::Videos::Movie.new('hackers', 'Hackers.1995.mkv', 5)
movie.populate_result!
movie.result
movie.search_imdb
movie.search_wiki
movie.search_youtube
movie.read_mediainfo
movie.capture_screenshots
Videoinfo.upload_screenshot(file)
It works with TV shows too:
result = Videoinfo.analyze_tv('survivor s01e01', 'survivor.s01e01.mkv', 0)
tv = Videoinfo::Videos::Tv.new('survivor s01e01', 'survivor.s01e01.mkv', 3)
Contributing
You are welcome to submit patches with bug fixes or feature additions. Please
make sure to test your changes throughly and keep to the style you see throughout
the rest of the code base. Indent with 2 spaces and no trailing spaces at the end
of lines. Just follow the steps below.
- Fork and clone the repository
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a Pull Request
Links
Author/Maintainter
License
Videoinfo is released under the MIT License.