chromagarden/bin/from-chroma

14 lines
355 B
Ruby
Executable File

#!/usr/bin/env ruby
if ARGV.length < 1
STDERR.puts "Usage: #{__FILE__} [ffmpeg_args] <output> < command"
STDERR.puts ARGV.length.to_s
exit 1
end
resolution = STDIN.read(8).unpack("L>L>")
width = resolution[0]
height = resolution[1]
exec("ffmpeg", "-v", "error", "-f", "rawvideo", "-pix_fmt", "argb", "-s", "#{width}x#{height}", "-i", "-", *ARGV)