Skip to content

Video thumbnail converter

Variants images for thumbnail video are generates by ffmpeg installed on your system (including all necessary encoding libraries like libmp3lame or libx264).

It is possible to specify the path of binaries. Useful if your installations are specific or if you are dropping off precompiled versions.

Installation required:

sh
sudo apt-get install ffmpeg
sh
brew install ffmpeg

Configuration

typescript
// config/attachment.ts //
const attachmentConfig = defineConfig({
  converters: {
    preview: { 
      converter: () => import('@jrmc/adonis-attachment/converters/video_thumbnail_converter'),
    }
  }
})

By default, image format is PNG and size is video size. options attribute use image_converter

Sample:

typescript
const attachmentConfig = defineConfig({
  converters: {
    preview: { 
      converter: () => import('@jrmc/adonis-attachment/converters/video_thumbnail_converter'),
      options: {
        format: 'jpeg',
        resize: 720
      }
    }
  }
})