image processing experiments
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
481 B

#!/usr/bin/env ruby
if ARGV.length != 1
STDERR.puts "Usage: #{__FILE__} <input> | command"
STDERR.puts ARGV.length.to_s
exit 1
end
resolution = IO.popen(["ffprobe", "-v", "error", "-select_streams", "v:0", "-show_entries", "stream=width,height", "-of", "default=noprint_wrappers=1:nokey=1", ARGV[0]]).read.split.map{ |x| x.to_i }
STDOUT.write(resolution.pack("L>L>"))
STDOUT.flush
exec("ffmpeg", "-v", "error", "-i", ARGV[0], "-f", "rawvideo", "-pix_fmt", "argb", "-")