Skip to content

Instantly share code, notes, and snippets.

@ucnv
Created May 11, 2010 22:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ucnv/397961 to your computer and use it in GitHub Desktop.
Save ucnv/397961 to your computer and use it in GitHub Desktop.
require 'ubygems'
require 'finalcut' # http://gist.github.com/397955
files = ARGV
tick = 0.2
margin = 0.2
out = 'out.mp4'
FinalCut.open(*files) do |fc|
durations = files.map {|f| fc.get_duration f }
durations.inject(0) do |s, d|
d = d - margin
fc.cut(
:from => 0,
:duration => margin,
:size => '1920x1080',
) if s == 0
fc.cut(
:from => s + margin,
:duration => d,
:framerate => 30,
:size => '1920x1080',
:datamosh => true
)
fc.cut(
:from => s + d - tick,
:duration => tick,
:framerate => 60,
:repeat => 100,
:speed => 10,
:size => '1920x1080',
:datamosh => true,
)
s + d
end
fc.output out
end
FinalCut.open(out) do |fc|
fc.cut(:duration => :whole, :size => '640x360')
fc.output(out)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment