I am working on a project that reads the meta data of video files with MediaInfo and processes the results. While testing my code with some sample files I noticed that the audio track of a .mkv
file has two different samling rates. The file has two different audio tracks (English and Japanese) but they are listed separately and both tracks show two different sampling rates. Here is the according output of MediaInfo
for clarification:
Audio #1
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : HE-AAC / LC
Codec ID : A_AAC
Duration : 22mn 46s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz / 24.0 KHz <-- here
Compression mode : Lossy
Delay relative to video : 31ms
Language : English
Default : Yes
Forced : No
Audio #2
ID : 3
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : HE-AAC / LC
Codec ID : A_AAC
Duration : 22mn 46s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz / 24.0 KHz <-- and here
Compression mode : Lossy
Delay relative to video : 31ms
Language : Japanese
Default : No
Forced : No
Can anyone explain what this means? I always thought one audio track can only have one sampling rate. Is this just a different way of describing one sampling rate? Or is it really possible to use two different sampling rates for one audio track? At the moment, the the software just expects single values for the meta data, so storing two different values for the sampling rate would make things more complicated. Would it be possible to either convert these two values to one value or just choose one of them?
Thanks for your help!
ffmpeg -i input.mkv -vn -c:a copy -map_channel 0.1.0 eng-left.aac -map_channel 0.1.1 eng-right.aac -map_channel 0.2.0 jap-left.aac -map_channel 0.2.1 jap-right.aac
and then run ffprobe on the 4 files.-strict -2
it's still not working. Is there another way to get the sample rate of one specific channel?