class VideoBlur::Video

Public Class Methods

new(input:, output:) click to toggle source
# File lib/video_blur/video.rb, line 3
def initialize(input:, output:)
  @input = input
  @output = output
end

Public Instance Methods

height() click to toggle source
# File lib/video_blur/video.rb, line 12
def height
  size.split("x")[1].to_f
end
input() click to toggle source
# File lib/video_blur/video.rb, line 16
def input
  File.absolute_path(@input)
end
output() click to toggle source
# File lib/video_blur/video.rb, line 20
def output
  File.absolute_path(@output)
end
width() click to toggle source
# File lib/video_blur/video.rb, line 8
def width
  size.split("x")[0].to_f
end

Private Instance Methods

size() click to toggle source
# File lib/video_blur/video.rb, line 26
def size
  @video_size ||= `ffmpeg -i '#{input}' 2>&1 | grep Stream | head -n 1`.match(/[0-9]{2,4}x[0-9]{2,4}/)[0]
end