Skip to content

Instantly share code, notes, and snippets.

@cxx
Created September 22, 2012 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cxx/3765371 to your computer and use it in GitHub Desktop.
Save cxx/3765371 to your computer and use it in GitHub Desktop.
EasyCAP
#!/usr/bin/env ruby
Dir.chdir("#{ENV['HOME']}/Pictures")
rest = 5
device = loop do
dev = Dir["/dev/video*"].first
rest -= 1
break dev if dev || rest == 0
sleep(5)
end
exit(false) unless device
deint = case ARGV[0]
when "24" then "scale,pullup,pp=l5,"
when "30" then "scale,yadif=0,"
when "60" then "scale,yadif=1,"
end
exec("mplayer tv:///5 -tv device=#{device}:norm=NTSC_M:width=720:height=480 -vf #{deint}dsize=873:480,eq2,screenshot -hardframedrop")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment