Sha256: ab7d6bbe23fd31b86f85706c4a8cf36cfdf1f1e80c69e0e644dcee72993ba9b3

Contents?: true

Size: 1.51 KB

Versions: 9

Compression:

Stored size: 1.51 KB

Contents

module FFMpeg
  module AudioOptions
    # Set the number of audio frames to record.
    def audio_frames(number)
      FFMpegCommand << "-aframes #{number}"
    end

    # Set the audio sampling frequency (default = 44100 Hz).
    def audio_sampling(frequency)
      FFMpegCommand << "-ar #{frequency}"
    end

    # Set the audio bitrate in bit/s (default = 64k).
    def audio_bitrate(bitrate)
      FFMpegCommand << "-ab #{bitrate}"
    end

    # Set the number of audio channels (default = 1).
    def audio_channels(number)
      FFMpegCommand << "-ac #{number}"
    end

    # Disable audio recording.
    def disable_audio
      FFMpegCommand << "-an"
    end

    # Force audio codec to codec. Use the copy special value to specify that the raw codec data must be copied as is.
    def audio_codec(codec)
      FFMpegCommand << "-acodec #{codec}"
    end

    # Add a new audio track to the output file. If you want to specify parameters, do so before -newaudio (-acodec,
    # -ab, etc..). Mapping will be done automatically, if the number of output streams is equal to the number of input
    # streams, else it will pick the first one that matches. You can override the mapping using -map as usual. Example:
    #
    # ffmpeg -i file.mpg -vcodec copy -acodec ac3 -ab 384k test.mpg -acodec mp2 -ab 192k -newaudio
    def new_audio
      FFMpegCommand << "-newaudio"
    end

    # Set the ISO 639 language code (3 letters) of the current audio stream.
    def audio_language(code)
      FFMpegCommand << "-alang #{code}"
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
polly-ffmpeg-0.1.2 lib/ffmpeg/audio_options.rb
polly-ffmpeg-0.1.3 lib/ffmpeg/audio_options.rb
polly-ffmpeg-0.1.5 lib/ffmpeg/audio_options.rb
polly-ffmpeg-0.1.6 lib/ffmpeg/audio_options.rb
polly-ffmpeg-0.1.7 lib/ffmpeg/audio_options.rb
polly-ffmpeg-0.1.8 lib/ffmpeg/audio_options.rb
polly-ffmpeg-0.1.9 lib/ffmpeg/audio_options.rb
polly-ffmpeg-0.2.1 lib/ffmpeg/audio_options.rb
ffmpeg-0.2.5 lib/ffmpeg/audio_options.rb