Socket
Book a DemoInstallSign in
Socket

polly-rffmpeg

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

polly-rffmpeg

0.0.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

= rFFmpeg

A tiny wrapper for ffmpeg

== Requirements

rFFmpeg requires that you already have ffmpeg installed, obviously :)

== Install

gem install polly-rffmpeg --source http://gems.github.com

== Note

Please note that this is still pretty experimental and should be viewed more as an api proposal rather than production ready. However it does work so you can use it right now, if you so choose, but expect some major api changes as time goes on.

== Usage

=== You can use RFFmpef like so:

require 'rubygems'
require 'rffmpeg'

include RFFmpeg

capture_stream "/path/to/video/<filename>.<ext>" do |input_stream|
input_stream.seek                 "00:02:10"
  input_stream.duration             "00:04:53"

  input_stream.output_to "/path/to/video/<filename>.<ext>" do |output_stream|
    output_stream.resolution           "800x600"
    output_stream.overwrite_existing   true
  end
end
	
RFFmpeg::run

=== or like this:

require 'rubygems'
require 'rffmpeg'

include RFFmpeg  

capture_stream("/path/to/video/<filename>.<ext>").output_to("/path/to/video/<filename>.<ext>")
	
RFFmpeg::run

=== or how about:

require 'rubygems'
require 'rffmpeg'

include RFFmpeg

capture_stream("/path/to/video/<filename>.<ext>")
output_to("/path/to/video/<filename>.<ext>")
	
RFFmpeg::run

=== this also works:

require 'rubygems'
require 'rffmpeg'

include RFFmpeg

capture_stream("/path/to/video/<filename>.<ext>").seek("00:02:10").output_to("/path/to/video/<filename>.<ext>").resolution("800x600")
	
RFFmpeg::run

== Extending

You can extend it with your own methods if they aren't already available, or even overide the default behaviour of existing ones. Here's how you would go about it:

RFFmpeg::add_method :my_extension, :args do |args| RFFmpegCommand.add args end

So if you wanted to add a method for say, setting the video quantizer scale blur for example, here's how you could do it:

RFFmpeg::add_method :quantizer_scale_blur, :blur do |blur| RFFmpegCommand.add "-qblur #{blur}" end

You would then call it just like any other method:

capture_stream "/path/to/video/." do |input_stream| input_stream.quantizer_scale_blur "0.5" # Your method is now available just like any other # library method.

input_stream.output_to "/path/to/video/<filename>.<ext>" do |output_stream|
  output_stream.resolution           "800x600"
  output_stream.overwrite_existing   true
end

end

RFFmpeg::run

FAQs

Package last updated on 10 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.