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 -
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.
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.
You can use the channelsplit filter to split the audio channels and run silencedetect on each.
Example:
ffmpeg -i test2.mp4 -filter_complex "[0:a]channelsplit=channel_layout=7.1:channels=FC[fc];[fc]silencedetect" -f null /dev/null
You can find more on audio channel manipulation here: https://trac.ffmpeg.org/wiki/AudioChannelManipulation