Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to set encoder options #26

Open
shir opened this issue Apr 8, 2014 · 2 comments
Open

No way to set encoder options #26

shir opened this issue Apr 8, 2014 · 2 comments

Comments

@shir
Copy link
Contributor

shir commented Apr 8, 2014

There is encoder_options in CarrierWave::Video:: FfmpegOptions which is hardcoded to { preserve_aspect_ratio: :width }. But I want to set video size by height nad so I should change this to { preserve_aspect_ratio: :height }.

I think there should be a way to pass encoder options as other options.

@shir
Copy link
Contributor Author

shir commented Apr 8, 2014

A quick way to fix. Create a file config/initializer/carrierwave_video.rb with content:

module CarrierWave
  module Video
    class FfmpegOptions
      def encoder_options
        { preserve_aspect_ratio: :height }
      end
    end
  end
end

@Nitrodist
Copy link
Contributor

+1

The flexibility of this gem to manipulate ffmpeg options is very specific to whoever made this project. Example: maybe I don't want a default resolution of 640x360?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants