Class FFmpegUtil


  • public class FFmpegUtil
    extends ExternalExecution
    This class wrapp FFmpeg command line execution.
     ffmpeg -ss $i*$interval -i /path/to/video.mov -vframes 1 -filter:v scale="600:-1" /path/to/thumbnail_$i.jpg
     
    Author:
    ebonnet
    • Constructor Detail

      • FFmpegUtil

        public FFmpegUtil()
    • Method Detail

      • isActivated

        public static boolean isActivated()
      • extractVideoThumbnail

        public static List<String> extractVideoThumbnail​(File videoFile,
                                                         File outputFile,
                                                         double position)
        Extracts a frame of the specified video at the given position and stores the obtained image into the specified output file. The type of the image is get from the output file extension.
        Parameters:
        videoFile - the file containing the video.
        outputFile - the file into which will be registered the extracted thumbnail.
        position - the position of the frame in the video from which a thumbnail will be extracted. Note that in most formats it is not possible to seek exactly, so the extraction will seek to the closest seek point before the given position.
        Returns:
        a List of console lines written by the image extraction command.