我需要能够分析包含多个音轨的视频文件并将结果输出到文本文件。我知道有几种过滤器可以给我想要的结果,但我几乎找不到有关语法的信息。最后,我有一个包含 3 个音轨(每个音轨 2 个声道)的视频。音轨 1(0:1)包含立体声音频,其他音轨(0:2、0:3)为静音。有没有办法使用 volumedetect 过滤器、silencedetect 过滤器或 astats 过滤器来读取这些音轨并提供这些信息?
到目前为止我已经尝试过:
ffmpeg -i "mov" -af astats=metadata=1:reset=1,ametadata=print:key=lavfi.astats.Peak_level.Peak_count:file=log.txt -f null -y "log.txt"
我得到的是一个带有此标题但没有元数据的 txt 文件:
;FFMETADATA1 major_brand=qt minor_version=512 compatible_brands=qt encoder=Lavf57.72.101
控制台输出为:
video:3867kB audio:56252kB subtitle:0kB other streams:0kB global headers:0kB mux
ing overhead: unknown
[Parsed_astats_0 @ 000000000206ec00] Channel: 1
[Parsed_astats_0 @ 000000000206ec00] DC offset: 0.002583
[Parsed_astats_0 @ 000000000206ec00] Min level: -188217600.000000
[Parsed_astats_0 @ 000000000206ec00] Max level: 159772160.000000
[Parsed_astats_0 @ 000000000206ec00] Min difference: 512.000000
[Parsed_astats_0 @ 000000000206ec00] Max difference: 7082496.000000
[Parsed_astats_0 @ 000000000206ec00] Mean difference: 1883352.211144
[Parsed_astats_0 @ 000000000206ec00] RMS difference: 2358521.937019
[Parsed_astats_0 @ 000000000206ec00] Peak level dB: -21.145393
[Parsed_astats_0 @ 000000000206ec00] RMS level dB: -28.110640
[Parsed_astats_0 @ 000000000206ec00] RMS peak dB: -28.110640
[Parsed_astats_0 @ 000000000206ec00] RMS trough dB: -28.110640
[Parsed_astats_0 @ 000000000206ec00] Crest factor: 2.229782
[Parsed_astats_0 @ 000000000206ec00] Flat factor: 0.000000
[Parsed_astats_0 @ 000000000206ec00] Peak count: 2
[Parsed_astats_0 @ 000000000206ec00] Bit depth: 24/24
[Parsed_astats_0 @ 000000000206ec00] Channel: 2
[Parsed_astats_0 @ 000000000206ec00] DC offset: 0.002886
[Parsed_astats_0 @ 000000000206ec00] Min level: -182797568.000000
[Parsed_astats_0 @ 000000000206ec00] Max level: 178699776.000000
[Parsed_astats_0 @ 000000000206ec00] Min difference: 3584.000000
[Parsed_astats_0 @ 000000000206ec00] Max difference: 7476224.000000
[Parsed_astats_0 @ 000000000206ec00] Mean difference: 1951990.490714
[Parsed_astats_0 @ 000000000206ec00] RMS difference: 2428434.732920
[Parsed_astats_0 @ 000000000206ec00] Peak level dB: -21.399189
[Parsed_astats_0 @ 000000000206ec00] RMS level dB: -28.031096
[Parsed_astats_0 @ 000000000206ec00] RMS peak dB: -28.031096
[Parsed_astats_0 @ 000000000206ec00] RMS trough dB: -28.031096
[Parsed_astats_0 @ 000000000206ec00] Crest factor: 2.145830
[Parsed_astats_0 @ 000000000206ec00] Flat factor: 0.000000
[Parsed_astats_0 @ 000000000206ec00] Peak count: 2
[Parsed_astats_0 @ 000000000206ec00] Bit depth: 24/24
[Parsed_astats_0 @ 000000000206ec00] Overall
[Parsed_astats_0 @ 000000000206ec00] DC offset: 0.002886
[Parsed_astats_0 @ 000000000206ec00] Min level: -188217600.000000
[Parsed_astats_0 @ 000000000206ec00] Max level: 178699776.000000
[Parsed_astats_0 @ 000000000206ec00] Min difference: 512.000000
[Parsed_astats_0 @ 000000000206ec00] Max difference: 7476224.000000
[Parsed_astats_0 @ 000000000206ec00] Mean difference: 1917671.350929
[Parsed_astats_0 @ 000000000206ec00] RMS difference: 2393733.587876
[Parsed_astats_0 @ 000000000206ec00] Peak level dB: -21.145393
[Parsed_astats_0 @ 000000000206ec00] RMS level dB: -28.070686
[Parsed_astats_0 @ 000000000206ec00] RMS peak dB: -28.031096
[Parsed_astats_0 @ 000000000206ec00] RMS trough dB: -28.110640
[Parsed_astats_0 @ 000000000206ec00] Flat factor: 0.000000
[Parsed_astats_0 @ 000000000206ec00] Peak count: 2.000000
[Parsed_astats_0 @ 000000000206ec00] Bit depth: 24/24
[Parsed_astats_0 @ 000000000206ec00] Number of samples: 1024
问题是音轨 2 和 3 被忽略了。
如何读取多个音轨?
谢谢。