Unified · Split
| @@ -1870,12 +1870,16 @@ Default value is @var{o}. · 1869 unmodified lines | |||
| 1870 | @itemize | 1870 | @itemize |
| 1871 | @item | 1871 | @item |
| 1872 | One of many usages of this filter is noise reduction, input audio is filtered | 1872 | One of many usages of this filter is noise reduction, input audio is filtered |
| 1873 | with same samples that are delayed by fixed ammount, one such example for stereo audio is: | 1873 | with same samples that are delayed by fixed amount, one such example for stereo audio is: |
| 1874 | @example | 1874 | @example |
| 1875 | asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o | 1875 | asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o |
| 1876 | @end example | 1876 | @end example |
| 1877 | @end itemize | 1877 | @end itemize |
| 1878 | 1878 | ||
| 1879 | @subsection Commands | ||
| 1880 | |||
| 1881 | This filter supports the same commands as options, excluding option @code{order}. | ||
| 1882 | |||
| 1879 | @section anull | 1883 | @section anull |
| 1880 | 1884 | ||
| 1881 | Pass the audio source unchanged to the output. | 1885 | Pass the audio source unchanged to the output. |
| @@ -281,6 +281,22 @@ static av_cold int init(AVFilterContext *ctx) · 280 unmodified lines | |||
| 281 | return 0; | 281 | return 0; |
| 282 | } | 282 | } |
| 283 | 283 | ||
| 284 | static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, | ||
| 285 | char *res, int res_len, int flags) | ||
| 286 | { | ||
| 287 | AudioNLMSContext *s = ctx->priv; | ||
| 288 | int ret; | ||
| 289 | |||
| 290 | if ( !strcmp(cmd, "mu") || !strcmp(cmd, "eps") | ||
| 291 | || !strcmp(cmd, "leakage") || !strcmp(cmd, "out_mode")) { | ||
| 292 | ret = av_opt_set(s, cmd, args, 0); | ||
| 293 | } else { | ||
| 294 | ret = AVERROR(ENOSYS); | ||
| 295 | } | ||
| 296 | |||
| 297 | return ret; | ||
| 298 | } | ||
| 299 | |||
| 284 | static av_cold void uninit(AVFilterContext *ctx) | 300 | static av_cold void uninit(AVFilterContext *ctx) |
| 285 | { | 301 | { |
| 286 | AudioNLMSContext *s = ctx->priv; | 302 | AudioNLMSContext *s = ctx->priv; |
| @@ -325,4 +341,5 @@ AVFilter ff_af_anlms = { · 38 unmodified lines | |||
| 325 | .inputs = inputs, | 341 | .inputs = inputs, |
| 326 | .outputs = outputs, | 342 | .outputs = outputs, |
| 327 | .flags = AVFILTER_FLAG_SLICE_THREADS, | 343 | .flags = AVFILTER_FLAG_SLICE_THREADS, |
| 344 | .process_command = process_command, | ||
| 328 | }; | 345 | }; |