1音频的通道是否静音

1音频的通道是否静音

本文介绍了FFmpeg检查7.1音频的通道是否静音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我上一个问题的后续问题,,在这里我需要在特定音轨中寻找静音.这是ffmpeg救生解决方案,可帮助您获取一些元数据:

This is a follow-up question from my previous question asked here, where I needed to look for silence within a specific audio track. Here is the ffmpeg life-saver solution where helps to get some metadata:

ffmpeg -i file -map 0:a:1 -af astats -f null -

但是我还有其他类型的输入.mp4文件,其中它们具有一个单一轨道的8(即7.1)音频通道.显然,这些文件是从原始文件转码的(以某种方式将4个轨道立体声压缩为这些文件).现在类似于我以前的内容,我需要知道原始文件是2声道立体声还是5.1(6)声道.

But I have other type of input .mp4 files where they have one single track of 8 (i.e. 7.1) audio channels. Apparently these files are transcoded from an original file (somehow the 4 track stereos are squished into these files). Now similar to my previous, I need to know if the original file was 2-channel stereo or 5.1 (6) channel.

如何知道音频轨道的特定通道(例如Center通道)是否静音/静音(可能使用ffmpeg)? 此处是示例.mp4文件.

How to know if a specific channel of an audio track (say Center channel) is silent/mute, possibly using ffmpeg? Here is a sample .mp4 file.

推荐答案

您可以使用 channelsplit 过滤器以拆分音频通道,并在每个音频过滤器上运行 silencedetect .

You can use the channelsplit filter to split the audio channels and run silencedetect on each.

示例:

ffmpeg -i test2.mp4 -filter_complex "[0:a]channelsplit=channel_layout=7.1:channels=FC[fc];[fc]silencedetect" -f null /dev/null

您可以在此处找到有关音频通道操作的更多信息: https://trac.ffmpeg.org/wiki/AudioChannelManipulation

You can find more on audio channel manipulation here:https://trac.ffmpeg.org/wiki/AudioChannelManipulation

这篇关于FFmpeg检查7.1音频的通道是否静音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 19:13