ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 (filename)
is how to retrieve the codec_name of the first video stream in a file via FFprobe.
Replace v:0 with a:0 to get the first audio stream, and it returns the codec_name of the first audio stream in the file.
And replace v:0 with s:0 to get the codec_name of the first subtitle stream in the file.
Awesome.
What isn't awesome, is having to call FFprobe three times for these operations and having to hit the file three times.
Is there a way to call FFProbe once, and have FFProbe return the codec_name of the first video, audio, and subtitle stream (instead of separate calls)?