]> git.sesse.net Git - ffmpeg/blobdiff - doc/ffmpeg-resampler.texi
Merge commit 'e568db40258d549777ac1c16971678e18a18f5f5'
[ffmpeg] / doc / ffmpeg-resampler.texi
index 15fc0edc19c979c6dc05663debd2cd950940fa05..d45126f11f0f5a2fe845c93d5aff558432f6c1f9 100644 (file)
@@ -25,7 +25,8 @@ and convert audio format and packing layout.
 The audio resampler supports the following named options.
 
 Options may be set by specifying -@var{option} @var{value} in the
-FFmpeg tools, or by setting the value explicitly in the
+FFmpeg tools, @var{option}=@var{value} for the aresample filter,
+by setting the value explicitly in the
 @code{SwrContext} options or using the @file{libavutil/opt.h} API for
 programmatic use.
 
@@ -103,41 +104,94 @@ select rectangular dither
 select triangular dither
 @item triangular_hp
 select triangular dither with high pass
+@item lipshitz
+select lipshitz noise shaping dither
+@item shibata
+select shibata noise shaping dither
+@item low_shibata
+select low shibata noise shaping dither
+@item high_shibata
+select high shibata noise shaping dither
+@item f_weighted
+select f-weighted noise shaping dither
+@item modified_e_weighted
+select modified-e-weighted noise shaping dither
+@item improved_e_weighted
+select improved-e-weighted noise shaping dither
+
+@end table
+
+@item resampler
+Set resampling engine. Default value is swr.
+
+Supported values:
+@table @samp
+@item swr
+select the native SW Resampler; filter options precision and cheby are not
+applicable in this case.
+@item 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.
 @end table
 
 @item filter_size
-Set resampling filter size, default value is 16.
+For swr only, set resampling filter size, default value is 32.
 
 @item phase_shift
-Set resampling phase shift, default value is 10, must be included
+For swr only, set resampling phase shift, default value is 10, must be included
 between 0 and 30.
 
 @item linear_interp
 Use Linear Interpolation if set to 1, default value is 0.
 
 @item cutoff
-Set cutoff frequency ratio. Must be a float value between 0 and 1,
-default value is 0.8.
+Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
+value between 0 and 1.  Default value is 0.97 with swr, and 0.91 with soxr
+(which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
+
+@item 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'.
+
+@item cheby
+For soxr only, selects passband rolloff none (Chebyshev) & higher-precision
+approximation for 'irrational' ratios. Default value is 0.
+
+@item async
+For swr only, simple 1 parameter audio sync to timestamps using stretching,
+squeezing, filling and trimming. Setting this to 1 will enable filling and
+trimming, larger values represent the maximum amount in samples that the data
+may be stretched or squeezed for each second.
+Default value is 0, thus no compensation is applied to make the samples match
+the audio timestamps.
 
 @item min_comp
-Set minimum difference between timestamps and audio data (in seconds)
-below which no timestamp compensation of either kind is applied.
-Default value is @code{FLT_MAX}.
+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
+(@option{min_comp} = @code{FLT_MAX}).
 
 @item min_hard_comp
-Set minimum difference between timestamps and audio data (in seconds)
-to trigger padding/trimming the data. Must be a non-negative double,
-default value is 0.1.
+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 @option{min_comp}.
+The default is 0.1.
 
 @item comp_duration
-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.
+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.
 
 @item max_soft_comp
-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.
+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.
 
 @item matrix_encoding
 Select matrixed stereo encoding.
@@ -155,7 +209,7 @@ select Dolby Pro Logic II
 Default value is @code{none}.
 
 @item filter_type
-Select resampling filter type. This only affects resampling
+For swr only, select resampling filter type. This only affects resampling
 operations.
 
 It accepts the following values:
@@ -169,8 +223,8 @@ select Kaiser Windowed Sinc
 @end table
 
 @item kaiser_beta
-Set Kaiser Window Beta value. Must be an integer included between 2
-and 16, default value is 9.
+For swr only, set Kaiser Window Beta value. Must be an integer included between
+and 16, default value is 9.
 
 @end table
 
@@ -180,7 +234,7 @@ and 16, default value is 9.
 
 @ifhtml
 @url{ffmpeg.html,ffmpeg}, @url{ffplay.html,ffplay}, @url{ffprobe.html,ffprobe}, @url{ffserver.html,ffserver},
-@url{libswresample.html}
+@url{libswresample.html,libswresample}
 @end ifhtml
 
 @ifnothtml