ruby-av / paperclip-av-transcoder

Audio/Video Transcoder for Paperclip using FFMPEG/Avconv
MIT License
136 stars 83 forks source link

Thumbnail bad quality #52

Open eugen0329 opened 7 years ago

eugen0329 commented 7 years ago

Hi! I use your gem with the following settings:

  has_attached_file :video, styles:  {
    medium: { geometry: "640x480",  format: 'mp4' },
    thumbnail:  {  geometry: "220x130#",  format: 'jpg',  time: 3 }
  },
  processors: [:transcoder]

Somehow video without any defects looks a bit stretched horizontally on a thumbnail.

Do you have any ideas what could it be?

From Gemfile.lock:

    paperclip-av-transcoder (0.6.4)
      av (~> 0.9.0)
      paperclip (>= 2.5.2)
pashazel commented 7 years ago

@eugen0329 Hello! Use convert_options

has_attached_file :video, styles:  {
    medium: { geometry: "640x480",  format: 'mp4' },
    thumbnail:  {  
      geometry: "220x130#",  
      format: 'jpg',  
      time: 3,  
      convert_options: {
        output: {
          'q:v' => 1 # range from 1 to 31, where lower means better 
        }
      }
    }
  },  processors: [:transcoder]
eugen0329 commented 7 years ago

I haven't tried this yet due to a bunch of another activities. But it looks like a solution. I'll let you know whether it helped or not. Thanks!