Created
January 28, 2012 00:30
-
-
Save bmarini/1691792 to your computer and use it in GitHub Desktop.
Toying with apis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it "has a nice api" do | |
# To set the video bitrate of the output file to 64kbit/s: | |
# ffmpeg -i input.avi -b:v 64k output.avi | |
builder = FastForward.build do |ff| | |
ff.input "input.avi" | |
ff.output "output.avi" do |o| | |
o.bitrate("64k").stream("video") | |
end | |
end | |
builder.to_s.should == "ffmpeg -i input.avi -b:v 64k output.avi" | |
# To force the frame rate of the output file to 24 fps: | |
# ffmpeg -i input.avi -r 24 output.avi | |
FastForward.build do |ff| | |
ff.input "input.avi" | |
ff.output "output.avi" do |o| | |
o.frame_rate(24) | |
end | |
end | |
builder.to_s.should == "ffmpeg -i input.avi -r 24 output.avi" | |
# To force the frame rate of the input file (valid for raw formats only) to 1 | |
# fps and the frame rate of the output file to 24 fps: | |
# ffmpeg -r 1 -i input.m2v -r 24 output.avi | |
builder = FastForward.build do |ff| | |
ff.input "input.m2v" do |i| | |
i.frame_rate(1) | |
end | |
ff.output "output.avi" do |o| | |
o.frame_rate(24) | |
end | |
end | |
builder.to_s.should == "ffmpeg -r 1 -i input.m2v -r 24 output.avi" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment