我有一个录音设备,可以生成“几乎单声道”文件 - 左右音轨的差异可以忽略不计。
这个答案告诉我如何提取左声道。
ffmpeg -i in.flac -af 'pan=mono|c0=c0' out.flac
这个答案显示了渠道的差异有多大:
ffmpeg -i in.flac -filter_complex "stereotools=phasel=1[tmp];[tmp]pan=1c|c0=0.5*c0+0.5*c1,volumedetect" -f null /dev/null
输出示例:
[Parsed_volumedetect_2 @ 0x7fc11920d500] n_samples: 125219672
[Parsed_volumedetect_2 @ 0x7fc11920d500] mean_volume: -91.0 dB
[Parsed_volumedetect_2 @ 0x7fc11920d500] max_volume: -50.8 dB
[Parsed_volumedetect_2 @ 0x7fc11920d500] histogram_50db: 1
[Parsed_volumedetect_2 @ 0x7fc11920d500] histogram_51db: 0
[Parsed_volumedetect_2 @ 0x7fc11920d500] histogram_52db: 0
[Parsed_volumedetect_2 @ 0x7fc11920d500] histogram_53db: 0
[Parsed_volumedetect_2 @ 0x7fc11920d500] histogram_54db: 0
[Parsed_volumedetect_2 @ 0x7fc11920d500] histogram_55db: 0
[Parsed_volumedetect_2 @ 0x7fc11920d500] histogram_56db: 1
[Parsed_volumedetect_2 @ 0x7fc11920d500] histogram_57db: 0
...
[Parsed_volumedetect_2 @ 0x7fc11920d500] histogram_89db: 0
[Parsed_volumedetect_2 @ 0x7fc11920d500] histogram_90db: 0
[Parsed_volumedetect_2 @ 0x7fc11920d500] histogram_91db: 125219661
(有点啰嗦,但它足够好地表明最大差异非常安静,并且几乎所有样本都是相同的。)
我根本不喜欢更改过滤器命令。有没有办法转换为单声道并检查“单声道”而无需读取文件两次?
这是组合命令。
ffmpeg -i in.flac -filter_complex "asplit=2[mono][diff];[diff]stereotools=phasel=1,pan=1c|c0=0.5*c0+0.5*c1,volumedetect,anullsink;[mono]pan=mono|c0=c0" out.flac