Skip to content

Instantly share code, notes, and snippets.

@arnaudbenard
Created November 2, 2012 22:36
Show Gist options
  • Save arnaudbenard/4004786 to your computer and use it in GitHub Desktop.
Save arnaudbenard/4004786 to your computer and use it in GitHub Desktop.
Copy paste for ffmpeg
#!/usr/bin/ruby
require "fileutils"
#infos about the images
prefix= "X10s100l5m_MOV4_topo_";
beginning= 5;
ending=114;
produce_name = "img";
filenames = Dir.glob("*.png")
filenames.each do |filename|
filename.slice! prefix.to_s
filename.slice! ".png"
if filename.to_i<= ending and filename.to_i>= beginning
num=filename.to_i-beginning+1
FileUtils.cp(prefix+filename+".png","temp/"+produce_name+num.to_s+".png", :verbose => true,:preserve => true)
end
end
exec "./ffmpeg -f image2 -i temp/#{produce_name}%d.png movies/#{prefix}.mpg"
exec "rm temp/*.png"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment