Package net.bramp.ffmpeg
Class FFmpegUtils
java.lang.Object
net.bramp.ffmpeg.FFmpegUtils
Helper class with commonly used methods
-
Method Summary
Modifier and TypeMethodDescriptionstatic long
fromTimecode
(String time) Returns the number of nanoseconds this timecode represents.static String
millisecondsToString
(long milliseconds) Deprecated.please use #toTimecode() instead.static long
parseBitrate
(String bitrate) Converts a string representation of bitrate to a long of bits per secondstatic String
toTimecode
(long duration, TimeUnit units) Convert the duration to "hh:mm:ss" timecode representation, where ss (seconds) can be decimal.
-
Method Details
-
millisecondsToString
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
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
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
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'
-