【问题标题】:ffmpeg FLAC 24 bit 96khz to 16 bit 48khzffmpeg FLAC 24 位 96khz 到 16 位 48khz
【发布时间】:2017-01-02 01:01:59
【问题描述】:

试图弄清楚 ffmpeg,目前正在努力将 24bit/96khz FLAC 文件转换为 16bit/48khz。

【问题讨论】:

  • 11 票赞成,0 票赞成?!

标签: audio ffmpeg bitrate flac


【解决方案1】:

基本示例

ffmpeg -i input.flac -sample_fmt s16 -ar 48000 output.flac
  • 列表示例格式:ffmpeg -sample_fmts
  • 列出其他 flac 编码选项:ffmpeg -h encoder=flac

aresample过滤器示例

ffmpeg -i input.flac -af aresample=out_sample_fmt=s16:out_sample_rate=48000 output.flac

这两个示例都会产生相同的输出:您可以使用hash muxer 进行验证。


更改抖动方法

请参阅-dither_method option,了解可用抖动方法和其他重采样选项的列表。示例:

ffmpeg -i input.flac -dither_method triangular_hp -sample_fmt s16 -ar 48000 output.flac

SoX 重采样器

FFmpeg 支持两种重采样器:默认的 swresample 库和外部的 SoX resampler (soxr)。

要使用 soxr,您的 ffmpeg 必须使用 --enable-libsoxr 编译。然后使用-resampler 选项选择它:

ffmpeg -i input.flac -resampler soxr -sample_fmt s16 -ar 48000 output.flac

或使用aresample 过滤器完成所有操作:

ffmpeg -i input.flac -af aresample=resampler=soxr:out_sample_fmt=s16:out_sample_rate=48000 output.flac

更多信息

【讨论】:

    【解决方案2】:

    作为一个 bash 脚本,它会生成带有 -16 附加到其名称的新文件;可以在脚本中轻松重命名然后删除原始文件,但我对此有点过于偏执了。

    #!/bin/sh
    # requires: ffmpeg
    for f in *.flac;
    do
    echo "Processing $f"
    ffmpeg -i "$f" -sample_fmt s16 -ar 48000 "${f%.flac}-16.flac"
    done
    

    【讨论】:

      猜你喜欢
      • 2011-01-23
      • 1970-01-01
      • 1970-01-01
      • 2011-01-27
      • 1970-01-01
      • 1970-01-01
      • 2020-06-30
      • 2021-07-09
      • 1970-01-01
      相关资源
      最近更新 更多