Class: Float

Inherits:
Object
  • Object
show all
Defined in:
lib/scissor-video/float.rb

Instance Method Summary collapse

Instance Method Details

#to_ffmpegtimeObject

for Scissor::FFmpeg#cut



7
8
9
10
11
12
13
14
15
16
# File 'lib/scissor-video/float.rb', line 7

def to_ffmpegtime
  min = 60
  hour = 60 * min

  h = self.to_i / hour
  m = (self.to_i - h * hour) / min
  sec = self.to_i - h * hour - m * min
  msec = (self * 1000 % 1000).to_i
  sprintf "%02d:%02d:%02d.%03d", h, m, sec, msec
end

#to_msecObject



2
3
4
# File 'lib/scissor-video/float.rb', line 2

def to_msec
  (self * 1000).to_i
end