chroma
This commit is contained in:
parent
14a36a18c5
commit
a4d439922f
|
@ -0,0 +1,13 @@
|
|||
#!/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)
|
|
@ -0,0 +1,16 @@
|
|||
#!/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", "-")
|
|
@ -0,0 +1,11 @@
|
|||
filters and generator should accept and produce sequences of images. Each sequence has the following format:
|
||||
|
||||
width unsigned 4 bytes big-endian
|
||||
height unsigned 4 bytes big-endian
|
||||
|
||||
followed by one or more arrays of pixels:
|
||||
|
||||
pixels array of 4 byte big-endian ARGB pixels, width * height in length
|
||||
pixel_index(x, y) = x + y * width
|
||||
|
||||
if a filter does not use alpha in any way it's best practice to copy the input alpha to the output.
|
Loading…
Reference in New Issue