检查立体声音频中声道之间的差异并提取其中一个

检查立体声音频中声道之间的差异并提取其中一个

我有一个录音设备,可以制作“几乎单声道”的文件,其中左右音轨之间的差别可以忽略不计。

这个答案告诉我如何提取左声道。

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

(有点罗嗦,但它足以表明最大差异非常安静,并且几乎所有样本都是相同的。)

我根本不习惯更改过滤器命令。有没有办法转换成单声道并检查“单声道性”,而无需读取文件两次?

答案1

这是组合命令。

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

相关内容