Class: Float
- Inherits:
-
Object
- Object
- Float
- Defined in:
- lib/scissor-video/float.rb
Instance Method Summary collapse
-
#to_ffmpegtime ⇒ Object
for Scissor::FFmpeg#cut.
- #to_msec ⇒ Object
Instance Method Details
#to_ffmpegtime ⇒ Object
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_msec ⇒ Object
2 3 4 |
# File 'lib/scissor-video/float.rb', line 2 def to_msec (self * 1000).to_i end |