Get audio stream details
inspection
// what it does
The audio counterpart to the video query: `-select_streams a:0` targets the first audio track and `-show_entries stream=codec_name,sample_rate,channels` returns the codec, sample rate in Hz, and channel count as a headerless CSV line. Handy for confirming a source is, say, 48000 Hz stereo AAC before remuxing or normalizing loudness.
// shell
$ ffprobe -v error -select_streams a:0 -show_entries stream=codec_name,sample_rate,channels -of csv=p=0 input.mp4// gotcha
If the file has no audio stream the command prints nothing and still exits 0, so an empty result means "no audio," not an error. Also `channels` is just a number (2), not a layout name — query channel_layout if you need "stereo" or "5.1".