Method: Timecode#with_frames_as_fraction
- Defined in:
- lib/timecode.rb
#with_frames_as_fraction(pattern = WITH_FRACTIONS_OF_SECOND) ⇒ Object Also known as: with_fractional_seconds
FFmpeg expects a fraction of a second as the last element instead of number of frames. Use this method to get the timecode that adheres to that expectation. The return of this method can be fed to ffmpeg directly.
Timecode.parse("00:00:10:24", 25).with_frames_as_fraction #=> "00:00:10.96"
466 467 468 469 470 |
# File 'lib/timecode.rb', line 466 def with_frames_as_fraction(pattern = WITH_FRACTIONS_OF_SECOND) vp = value_parts.dup vp[-1] = (100.0 / @fps) * vp[-1] pattern % vp end |