Sha256: c3bb9b1a85467e9a1556dc595b263753e3b394e57caf3f015081f4913b78e8bb

Contents?: true

Size: 918 Bytes

Versions: 28

Compression:

Stored size: 918 Bytes

Contents

# frozen_string_literal: true

module Ehbrs
  module Videos
    module Unsupported
      module Fixes
        class SupportedCodec
          TRACK_TYPE_OPTIONS = {
            audio: '-acodec',
            video: '-vcodec',
            subtitle: '-scodec'
          }.freeze

          TRACK_TYPE_FIX_CODECS = {
            audio: 'aac',
            video: 'libx264',
            subtitle: 'ass'
          }.freeze

          def ffmpeg_args(track)
            ["#{track_codec_option_by_type(track.codec_type)}:#{track.index}",
             track_codec_fix_by_type(track.codec_type)]
          end

          def track_codec_option_by_type(track_type)
            TRACK_TYPE_OPTIONS.fetch(track_type.to_s.underscore.to_sym)
          end

          def track_codec_fix_by_type(track_type)
            TRACK_TYPE_FIX_CODECS.fetch(track_type.to_s.underscore.to_sym)
          end
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
ehbrs-tools-0.39.0 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.38.0 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.37.0 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.36.0 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.35.1 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.35.0 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.34.0 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.33.0 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.32.0 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.31.1 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.31.0 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.30.0 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.29.0 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.28.3 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.28.2 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.28.1 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.28.0 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.27.0 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.26.0 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb
ehbrs-tools-0.25.1 lib/ehbrs/videos/unsupported/fixes/supported_codec.rb