Created
September 22, 2012 06:37
-
-
Save cxx/3765371 to your computer and use it in GitHub Desktop.
EasyCAP
This file contains hidden or 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
#!/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