转换和规范化音频文件会创建不可用的文件

转换和规范化音频文件会创建不可用的文件

我正在尝试使用 ffmpeg 在 Windows 7 计算机上转换和规范化 wav 文件中的音频。似乎我可以毫无问题地执行其中任何一项,但每当我尝试同时执行这两项操作时,我都会收到 Windows Media Player 尝试播放该文件时发出的此错误:“Windows Media Player 无法播放该文件。播放器可能不支持该文件类型,或者可能不支持用于压缩该文件的编解码器。”

现在,这对我来说很奇怪,因为如果我只是转换文件或只是将其标准化,播放它就没有问题。此外,无论我按照什么顺序执行操作或是否在一行中尝试这些操作似乎都无关紧要;结果总是一样的。

作为参考,当我转换我正在使用的文件时ffmpeg -i infile.wav -c:a aac -b:a 64k outfile.m4a以及当我对其进行规范化时,我使用ffmpeg -i infile -af "loudnorm" outfile

有人遇到过这个问题或有什么解决办法吗?

更新日志: 我现在无法访问我正在转换的全尺寸文件,但下面是在同一设备上对测试文件进行组合调用的日志。

ffmpeg started on 2017-06-12 at 10:11:32
Report written to "ffmpeg-20170612-101132.log"
Command line:
ffmpeg -i R_20170515-195003.wav -af loudnorm -report -c:a aac -b:a 64k outfile.m4a
ffmpeg version 3.3.1 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavdevice    57.  6.100 / 57.  6.100
  libavfilter     6. 82.100 /  6. 82.100
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
  libpostproc    54.  5.100 / 54.  5.100
Splitting the commandline.
Reading option '-i' ... matched as input url with argument 'R_20170515-195003.wav'.
Reading option '-af' ... matched as option 'af' (set audio filters) with argument 'loudnorm'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'aac'.
Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '64k'.
Reading option 'outfile.m4a' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url R_20170515-195003.wav.
Successfully parsed a group of options.
Opening an input file: R_20170515-195003.wav.
[file @ 03309820] Setting default whitelist 'file,crypto'
[wav @ 03309100] Format wav probed with size=2048 and score=99
[wav @ 03309100] Before avformat_find_stream_info() pos: 44 bytes read:65580 seeks:1 nb_streams:1
[wav @ 03309100] probing stream 0 pp:32
[wav @ 03309100] probing stream 0 pp:31
[wav @ 03309100] probing stream 0 pp:30
[wav @ 03309100] probing stream 0 pp:29
[wav @ 03309100] probing stream 0 pp:28
[wav @ 03309100] probing stream 0 pp:27
[wav @ 03309100] probing stream 0 pp:26
[wav @ 03309100] probing stream 0 pp:25
[wav @ 03309100] probing stream 0 pp:24
[wav @ 03309100] probing stream 0 pp:23
[wav @ 03309100] probing stream 0 pp:22
[wav @ 03309100] probing stream 0 pp:21
[wav @ 03309100] probing stream 0 pp:20
[wav @ 03309100] probing stream 0 pp:19
[wav @ 03309100] probing stream 0 pp:18
[wav @ 03309100] probing stream 0 pp:17
[wav @ 03309100] probing stream 0 pp:16
[wav @ 03309100] probing stream 0 pp:15
[wav @ 03309100] probing stream 0 pp:14
[wav @ 03309100] probing stream 0 pp:13
[wav @ 03309100] probing stream 0 pp:12
[wav @ 03309100] probing stream 0 pp:11
[wav @ 03309100] probing stream 0 pp:10
[wav @ 03309100] probing stream 0 pp:9
[wav @ 03309100] probing stream 0 pp:8
[wav @ 03309100] probing stream 0 pp:7
[wav @ 03309100] probing stream 0 pp:6
[wav @ 03309100] probing stream 0 pp:5
[wav @ 03309100] probing stream 0 pp:4
[wav @ 03309100] probing stream 0 pp:3
[wav @ 03309100] probing stream 0 pp:2
[wav @ 03309100] probing stream 0 pp:1
[wav @ 03309100] probed stream 0
[wav @ 03309100] parser not found for codec pcm_s16le, packets or times may be invalid.
[wav @ 03309100] All info found
[wav @ 03309100] After avformat_find_stream_info() pos: 204844 bytes read:294956 seeks:1 frames:50
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'R_20170515-195003.wav':
  Duration: 00:00:02.73, bitrate: 1536 kb/s
    Stream #0:0, 50, 1/48000: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
Successfully opened the file.
Parsing a group of options: output url outfile.m4a.
Applying option af (set audio filters) with argument loudnorm.
Applying option c:a (codec name) with argument aac.
Applying option b:a (video bitrate (please use -b:v)) with argument 64k.
Successfully parsed a group of options.
Opening an output file: outfile.m4a.
[file @ 04b90d40] Setting default whitelist 'file,crypto'
Successfully opened the file.
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
detected 4 logical cores
[graph_0_in_0_0 @ 04c14a80] Setting 'time_base' to value '1/48000'
[graph_0_in_0_0 @ 04c14a80] Setting 'sample_rate' to value '48000'
[graph_0_in_0_0 @ 04c14a80] Setting 'sample_fmt' to value 's16'
[graph_0_in_0_0 @ 04c14a80] Setting 'channel_layout' to value '0x3'
[graph_0_in_0_0 @ 04c14a80] tb:1/48000 samplefmt:s16 samplerate:48000 chlayout:0x3
[format_out_0_0 @ 04c14b80] Setting 'sample_fmts' to value 'fltp'
[format_out_0_0 @ 04c14b80] Setting 'sample_rates' to value '96000|88200|64000|48000|44100|32000|24000|22050|16000|12000|11025|8000|7350'
[Parsed_loudnorm_0 @ 04c14a00] auto-inserting filter 'auto_resampler_0' between the filter 'graph_0_in_0_0' and the filter 'Parsed_loudnorm_0'
[format_out_0_0 @ 04c14b80] auto-inserting filter 'auto_resampler_1' between the filter 'Parsed_loudnorm_0' and the filter 'format_out_0_0'
[AVFilterGraph @ 04b954e0] query_formats: 4 queried, 3 merged, 6 already done, 0 delayed
[auto_resampler_0 @ 04c14c00] [SWR @ 05d60060] Using fltp internally between filters
[auto_resampler_0 @ 04c14c00] ch:2 chl:stereo fmt:s16 r:48000Hz -> ch:2 chl:stereo fmt:dbl r:192000Hz
[auto_resampler_1 @ 04c14c80] [SWR @ 05d74580] Using dblp internally between filters
[auto_resampler_1 @ 04c14c80] ch:2 chl:stereo fmt:dbl r:192000Hz -> ch:2 chl:stereo fmt:fltp r:96000Hz
Output #0, ipod, to 'outfile.m4a':
  Metadata:
    encoder         : Lavf57.71.100
    Stream #0:0, 0, 1/96000: Audio: aac (LC) (mp4a / 0x6134706D), 96000 Hz, stereo, fltp, 64 kb/s
    Metadata:
      encoder         : Lavc57.89.100 aac
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[out_0_0 @ 04c14b00] EOF on sink link out_0_0:default.
No more output streams to write to, finishing.
size=       3kB time=00:00:02.73 bitrate=   9.8kbits/s speed=14.6x    
video:0kB audio:2kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 112.246193%
Input file #0 (R_20170515-195003.wav):
  Input stream #0:0 (audio): 128 packets read (524288 bytes); 128 frames decoded (131072 samples); 
  Total: 128 packets (524288 bytes) demuxed
Output file #0 (outfile.m4a):
  Output stream #0:0 (audio): 256 frames encoded (262144 samples); 257 packets muxed (1576 bytes); 
  Total: 257 packets (1576 bytes) muxed
128 frames successfully decoded, 0 decoding errors
[AVIOContext @ 04c6c960] Statistics: 30 seeks, 280 writeouts
[aac @ 04c6b800] Qavg: 65294.412
[AVIOContext @ 04b95c80] Statistics: 589868 bytes read, 1 seeks

答案1

正确检测峰值loudnorm在此过程中更改文件的采样率(例如从 48000 Hz 更改为 96000 Hz)。我认为 WMP 无法处理高采样率,因此输出该错误。

您可以使用 -parameter 指定采样率-ar- 您必须在每个文件的基础上执行此操作,始终使用 指定输出文件的采样率-ar。(CD-rips 通常为 44100 Hz,视频相关音频通常为 48000 Hz;FFmpeg 默认显示输入的采样率。)

例如:

ffmpeg -i infile.wav -af "loudnorm" -ar 48000 -c:a aac -b:a
64k outfile.m4a

答案2

对于真正的峰值限制,此滤波器将上采样至 192 kHz。下采样至合适的采样率则由您决定。

http://k.ylo.ph/2016/04/04/loudnorm.html

相关内容