ffmpeg - 将 PCM 音频复用到 WMA 会显着增加文件大小

标签 ffmpeg

虽然我试图将 wav 文件转换为 wma 文件大小变得比原始源文件大得多:

  • input.wav - 11M
  • output.wma - 16M

  • 有什么办法可以减少输出文件的文件大小?

    命令和输出:
    $ ffmpeg -i input.wav -c copy output.wma
    
    ffmpeg version N-80797-g8b4d6cc Copyright (c) 2000-2016 the FFmpeg developers
      built with gcc 6.1.1 (GCC) 20160501
      configuration: --enable-gpl
      libavutil      55. 27.100 / 55. 27.100
      libavcodec     57. 48.101 / 57. 48.101
      libavformat    57. 40.101 / 57. 40.101
      libavdevice    57.  0.102 / 57.  0.102
      libavfilter     6. 46.102 /  6. 46.102
      libswscale      4.  1.100 /  4.  1.100
      libswresample   2.  1.100 /  2.  1.100
      libpostproc    54.  0.100 / 54.  0.100
    Guessed Channel Layout for Input Stream #0.0 : stereo
    Input #0, wav, from 'input.wav':
      Metadata:
        encoder         : Lavf57.40.101
      Duration: 00:01:00.00, bitrate: 1411 kb/s
        Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2 channels, s16, 1411 kb/s
    Output #0, asf, to 'output.wma':
      Metadata:
        WM/EncodingSettings: Lavf57.40.101
        Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, 1411 kb/s
    Stream mapping:
      Stream #0:0 -> #0:0 (copy)
    Press [q] to stop, [?] for help
    size=   16150kB time=00:01:00.00 bitrate=2205.1kbits/s speed=1.9e+03x    
    video:0kB audio:10336kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 56.255745%
    

    最佳答案

    WMA 很烂。尝试更改数据包大小。来自 FFmpeg ASF muxer documentation :

    -packet_size
    Set the muxer packet size. By tuning this setting you may reduce data fragmentation or muxer overhead depending on your source. Default value is 3200, minimum is 100, maximum is 64k.



    例子:
    ffmpeg -i input.wav -c copy -packet_size 65536 output_64k.wma
    

    文件大小:
  • input.wav - 11M
  • output_64k.wma - 11M
  • output_default.wma - 16M
  • 关于ffmpeg - 将 PCM 音频复用到 WMA 会显着增加文件大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38007019/

    相关文章:

    ffmpeg - 如何(以编程方式)检查视频/音频文件是否具有 DRM 保护?

    c - C 流媒体引擎最佳实践

    video - 提取视频文件中每个摄像机变化的缩略图

    android - 无法使用 JavaCV 在 Android 中合并视频 ("Sample Description"错误)

    objective-c - 无法使用 ffmpeg 对图像进行编码

    video - RTSP 流如何在低 FPS 下工作

    ffmpeg - 如何在不同的音轨上输入多个音频设备

    python - 同时实时将视频和数据流映射到一个子流程管道

    image - ffmpeg:从 .mp3 和 .jpg 创建 .mp4

    FFMPEG RTSP IP 流 (H.264) 转换为 RTSP 流 (MPEG-2)