ruby-av / paperclip-av-transcoder

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

thumbnail geometry ignores "!#<>" #46

Open andyryan opened 8 years ago

andyryan commented 8 years ago

I need to be able to upload videos of any size up to a maximum of 1080 pixels in either direction and create an equivalent thumbnail image.

However the options !, #, >, and < are ignored

full_thumb: { geometry: '1080x1080>', format: 'jpg', time: 1 }

produces the following log

[AV] Adding output parameter ["f", "image2"] [AV] Adding output parameter ["vframes", "1"] [AV] Adding input parameter [:ss, 1] [AV] Adding output parameter [:s, "1080x1080"]

and the output image is always 1080x1080 regardless of input dimensions (in test case 640x360)

kinoute commented 8 years ago

same problem here.

andyryan commented 8 years ago

I managed to work around this by directly invoking the scale filter using the convert_options param

convert_options: {
    output: {
        vf: 'scale="min(1080\, iw):min(1080\, ih)":force_original_aspect_ratio=decrease'
     }
}
kilink commented 7 years ago

The code that parses the geometry actually expects the modifier as the first character (e.g., "#100x100"), which differs from the README; but even if you pass the geometry in this way, the parsed flags are ignored.