ffmpeg: check if number of input and output channels are valid.