[Top] [Contents] [Index] [ ? ]

FFmpeg Resampler Documentation

1. Description

The FFmpeg resampler provides an high-level interface to the libswresample library audio resampling utilities. In particular it allows to perform audio resampling, audio channel layout rematrixing, and convert audio format and packing layout.

2. Resampler Options

The audio resampler supports the following named options.

Options may be set by specifying -option value in the FFmpeg tools, option=value for the aresample filter, by setting the value explicitly in the SwrContext options or using the `libavutil/opt.h' API for programmatic use.

` ich, in_channel_count'

Set the number of input channels. Default value is 0. Setting this value is not mandatory if the corresponding channel layout `in_channel_layout' is set.

` och, out_channel_count'

Set the number of output channels. Default value is 0. Setting this value is not mandatory if the corresponding channel layout `out_channel_layout' is set.

` uch, used_channel_count'

Set the number of used channels. Default value is 0. This option is only used for special remapping.

` isr, in_sample_rate'

Set the input sample rate. Default value is 0.

` osr, out_sample_rate'

Set the output sample rate. Default value is 0.

` isf, in_sample_fmt'

Specify the input sample format. It is set by default to none.

` osf, out_sample_fmt'

Specify the output sample format. It is set by default to none.

` tsf, internal_sample_fmt'

Set the internal sample format. Default value is none.

` icl, in_channel_layout'

Set the input channel layout.

` ocl, out_channel_layout'

Set the output channel layout.

` clev, center_mix_level'

Set center mix level. It is a value expressed in deciBel, and must be inclusively included between -32 and +32.

` slev, surround_mix_level'

Set surround mix level. It is a value expressed in deciBel, and must be inclusively included between -32 and +32.

` lfe_mix_evel'

Set LFE mix level.

` rmvol, rematrix_volume'

Set rematrix volume. Default value is 1.0.

` flags, swr_flags'

Set flags used by the converter. Default value is 0.

It supports the following individual flags:

` res'

force resampling

` dither_scale'

Set the dither scale. Default value is 1.

` dither_method'

Set dither method. Default value is 0.

Supported values:

` rectangular'

select rectangular dither

` triangular'

select triangular dither

` triangular_hp'

select triangular dither with high pass

` resampler'

Set resampling engine. Default value is swr.

Supported values:

` swr'

select the native SW Resampler; filter options precision and cheby are not applicable in this case.

` soxr'

select the SoX Resampler (where available); compensation, and filter options filter_size, phase_shift, filter_type & kaiser_beta, are not applicable in this case.

` filter_size'

For swr only, set resampling filter size, default value is 16.

` phase_shift'

For swr only, set resampling phase shift, default value is 10, must be included between 0 and 30.

` linear_interp'

Use Linear Interpolation if set to 1, default value is 0.

` cutoff'

Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float value between 0 and 1. Default value is 0.8 with swr, and 0.91 with soxr (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).

` precision'

For soxr only, the precision in bits to which the resampled signal will be calculated. The default value of 20 (which, with suitable dithering, is appropriate for a destination bit-depth of 16) gives SoX's 'High Quality'; a value of 28 gives SoX's 'Very High Quality'.

` cheby'

For soxr only, selects passband rolloff none (Chebyshev) & higher-precision approximation for 'irrational' ratios. Default value is 0.

` min_comp'

For swr only, set the minimum difference between timestamps and audio data (in seconds) to trigger stretching/squeezing/filling or trimming of the data to make it match the timestamps. The default is that stretching/squeezing/filling and trimming is disabled (`min_comp' = FLT_MAX).

` min_hard_comp'

For swr only, set the minimum difference between timestamps and audio data (in seconds) to trigger adding/dropping samples to make it match the timestamps. This option effectively is a threshold to select between hard (trim/fill) and soft (squeeze/stretch) compensation. Note that all compensation is by default disabled through `min_comp'. The default is 0.1.

` comp_duration'

For swr only, set duration (in seconds) over which data is stretched/squeezed to make it match the timestamps. Must be a non-negative double float value, default value is 1.0.

` max_soft_comp'

For swr only, set maximum factor by which data is stretched/squeezed to make it match the timestamps. Must be a non-negative double float value, default value is 0.

` matrix_encoding'

Select matrixed stereo encoding.

It accepts the following values:

` none'

select none

` dolby'

select Dolby

` dplii'

select Dolby Pro Logic II

Default value is none.

` filter_type'

For swr only, select resampling filter type. This only affects resampling operations.

It accepts the following values:

` cubic'

select cubic

` blackman_nuttall'

select Blackman Nuttall Windowed Sinc

` kaiser'

select Kaiser Windowed Sinc

` kaiser_beta'

For swr only, set Kaiser Window Beta value. Must be an integer included between 2 and 16, default value is 9.

3. See Also

ffmpeg.html,ffmpeg, ffplay.html,ffplay, ffprobe.html,ffprobe, ffserver.html,ffserver, libswresample.html,libswresample

4. Authors

The FFmpeg developers.

For details about the authorship, see the Git history of the project (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command git log in the FFmpeg source directory, or browsing the online repository at http://source.ffmpeg.org.

Maintainers for the specific components are listed in the file `MAINTAINERS' in the source code tree.

[Top] [Contents] [Index] [ ? ]

Table of Contents

[Top] [Contents] [Index] [ ? ]

About This Document

This document was generated by Software on April, 15 2013 using texi2html 1.70.

The buttons in the navigation panels have the following meaning:

Button Name Go to From 1.2.3 go to
[ < ] Back previous section in reading order 1.2.2
[ > ] Forward next section in reading order 1.2.4
[ << ] FastBack beginning of this chapter or previous chapter 1
[ Up ] Up up section 1.2
[ >> ] FastForward next chapter 2
[Top] Top cover (top) of document  
[Contents] Contents table of contents  
[Index] Index index  
[ ? ] About about (help)  

where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure: