我已经将FFMPEG集成到我的应用程序中,并希望将视频转换为音频文件,但我想使用本地实现(JNI),而不是使用ffmpeg脚本。我已经尝试过this。
你不能将视频转换为音频。但是,你可以提取并仅存储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;