RubyGems Navigation menu

vtools 0.0.1

# VTools Daemon video processor tools to operate the video (get info, encode & generate thumbnails). Under the hood ffmpeg & ffmpegthumbnailer are used. Some ideas has been taken at the streamio-ffmpeg gem (parse output methods). Project was developed for the [WebTV](http://web.tv) ## Installation (sudo) gem install vtools Please read changelog to check ffmpeg versions compatibility. ## Usage ### Getting started Before start, daemon should be correctly configured, to have valid access to the storage. Mandatory methods are: **connect**, **recv** and **send**. ``` ruby #--file library.rb--# # encoding: binary #to setup storage: VTools::Storage.setup do # connection setup connect_action do \ # ... connect to the storage (persistent) end # message reciever # should return JSON encoded string # see complete storage setup reference for details recv_action do # ... job data recieve algorithm end # message sender # recieves hash: { :data => execution_result, :action => executed_action } # execution_result can be video object or array with thumbnails send_action do |result| # ... send action here end end # storage can be setup separate VTools::Storage.connect_action do # ... connect to the storage end ``` ### Setup message (JSON) ``` { "action" : "convert|thumbs|info", "file" : "path/to/file", "setup" : < setup > } # setup can be: # -- "predefined_set_id" # -- { ffmpeg_options_hash } # -- { "set": "predefined_set_str", ffmpeg_options_hash } ``` ### User friendly option names ``` converter (ffmpeg) preserve_aspect (true or false) \ extension (result file extension) width, height resolution duration thumbnailer (ffmpegthumbnailer) thumb_count thumb_start_point (in percents) time (time offset, alias for -t) quality (0 - 10) width ``` ## Start To launch daemon is enough to require library with storage setup: (sudo) vtools start -- -r library ## Options ### Daemon options are start stop restart ### Application options are: -c or --config-file - load config from file -r or --require - load ruby library file (can be used more than once) ### To see complete options list use vtools --help ### Using logger By default the `logger` gem is used. But there is possibility to set custom logger, that is compatible with the default logger. ``` ruby VTools.logger = CustomLoger.new($stdout) ``` ### Additioinal methods Path generator is used by the thumnailer, converter or both to generate necessary dir tree logic for the media. It accepts file name and should return relative path (excluding file name itself) ``` ruby # path generator (used to ) VTools.path_generator do |file_name| # .. end ``` **Network calls** (TCP GET request, that will return message body content, ignoring response headers) ``` ruby # http calls VTools.network_call "site.com/some/uri" VTools.network_call "www.site.com" VTools.network_call "http://www.site.com" ```

Gemfile:
= 複製 已複製

安裝:
=

版本列表:

  1. 1.0.2 - December 25, 2011 (42.0 KB)
  2. 1.0.1 - December 14, 2011 (42.5 KB)
  3. 1.0.0 - December 14, 2011 (42.0 KB)
  4. 0.1.1 - December 13, 2011 (82.5 KB)
  5. 0.1.0 - December 13, 2011 (41.5 KB)
  6. 0.0.1 - November 23, 2011 (42.5 KB)
顯示所有版本(共 8)

Runtime 相依性套件 (2):

daemons >= 1.1.4
json >= 0

Development 相依性套件 (1):

rspec >= 0

擁有者:

作者:

  • tofir

SHA 256 checksum:

eee3f713d35810e2effc2f0074e8737d637f0e1f19b7c987d5972b723ac93978

總下載次數 24,842

這個版本 2,959

License:

Ruby 版本需求: >= 1.9

相關連結: