Module: FFMPEG::Transcoders::Autorotator
- Included in:
- FFMPEG::Transcoder
- Defined in:
- lib/ffmpeg/transcoders/autorotator.rb
Instance Method Summary collapse
- #apply_autorotate ⇒ Object
- #autorotate? ⇒ Boolean
-
#changes_orientation? ⇒ Boolean
we need to know if orientation changes when we scale.
Instance Method Details
#apply_autorotate ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/ffmpeg/transcoders/autorotator.rb', line 4 def apply_autorotate return unless autorotate? # remove the rotation information on the video stream so rotation-aware players don't rotate twice @raw_options[:metadata] = 's:v:0 rotate=0' filters = { 90 => 'transpose=1', 180 => 'hflip,vflip', 270 => 'transpose=2' } @raw_options[:video_filter] = filters[@movie.rotation] end |
#autorotate? ⇒ Boolean
21 22 23 |
# File 'lib/ffmpeg/transcoders/autorotator.rb', line 21 def autorotate? @transcoder_options[:autorotate] && @movie.rotation && @movie.rotation != 0 end |
#changes_orientation? ⇒ Boolean
we need to know if orientation changes when we scale
17 18 19 |
# File 'lib/ffmpeg/transcoders/autorotator.rb', line 17 def changes_orientation? autorotate? && [90, 270].include?(@movie.rotation) end |