Class FFmpegUtils

java.lang.Object
net.bramp.ffmpeg.FFmpegUtils

public final class FFmpegUtils extends Object
Helper class with commonly used methods
  • Method Details

    • millisecondsToString

      @Deprecated public static String millisecondsToString(long milliseconds)
      Deprecated.
      please use #toTimecode() instead.
      Convert milliseconds to "hh:mm:ss.ms" String representation.
      Parameters:
      milliseconds - time duration in milliseconds
      Returns:
      time duration in human-readable format
    • toTimecode

      public static String toTimecode(long duration, TimeUnit units)
      Convert the duration to "hh:mm:ss" timecode representation, where ss (seconds) can be decimal.
      Parameters:
      duration - the duration.
      units - the unit the duration is in.
      Returns:
      the timecode representation.
    • fromTimecode

      public static long fromTimecode(String time)
      Returns the number of nanoseconds this timecode represents. The string is expected to be in the format "hour:minute:second", where second can be a decimal number.
      Parameters:
      time - the timecode to parse.
      Returns:
      the number of nanoseconds.
    • parseBitrate

      public static long parseBitrate(String bitrate)
      Converts a string representation of bitrate to a long of bits per second
      Parameters:
      bitrate - in the form of 12.3kbits/s
      Returns:
      the bitrate in bits per second or -1 if bitrate is 'N/A'