也可以通过av_find_best_stream()函数来获取流的索引:例: audioStream = av_find_best_stream(ic, AVMEDIA_TYPE_AUDIO, -, -, NULL, ); LOGI("av_find_best_stream, audio index is: %d", audioStream);