[英]Convert video to audio using FFMPEG with android native c
您无法将视频转换为音频。 但是,您可以提取并仅存储AVFormatContext的音频子流。 伪代码:
// look for the first auid substream, and save its index:
for (size_t i = 0; i < AvFormatContextInstance->nb_streams; ++i)
if (AvFormatContextInstance->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
streamindex = i;
现在您需要做的就是丢弃其他索引上的所有其他流,并从识别的音频流中保存AVPackets。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.