如何使用ffmpeg获取歌词
How to use FFmpeg to get lyrics?
ffmpeg版本:3.3.2
我尝试使用流来获取歌词,但不能。
代码:
AVFormatContext* fmt_ctx = NULL;
int ret;
av_register_all();
if ((ret = avformat_open_input(&fmt_ctx, "media path", NULL, NULL))){
printf("Fail to open file");
return;
}
if (fmt_ctx->iformat->read_header(fmt_ctx) < 0) {
printf("No header format");
return;
}
for (uint i = 0; i < fmt_ctx->nb_streams; i++){
auto stream=fmt_ctx->streams[i];
if(stream->disposition==AV_DISPOSITION_LYRICS){
printf("lyrics!");//"will not print"
}
}
流 disposition
是一个野外场,因此请尝试不严格的平等。条件应为:
stream->disposition & AV_DISPOSITION_LYRICS
相关文章:
- C++为构建时间获取QDateTime的可靠方法
- lambda参数转换为constexpr技巧,然后获取带链接的数组
- 如何使用 < 和 > 命令获取 c++ 中的输入和输出?
- 使用指针从C++中的数组中获取最大值
- 如何获取std::result_of函数的返回类型
- 如何在openssl-ecc中获取十六进制格式的私钥
- 使用Unreal C++获取VR耳机的世界位置/方向
- 如何在 c++ 中使用 ffmpeg 获取 DirectShow 设备列表?
- 如何使用ffmpeg获取歌词
- 如何使用C 中的FFMPEG获取视频fps
- 如何使用FFMPEG使用DXVA2来解码并获取框架
- 获取具有FFMPEG样品的总数
- ffmpeg,C++-在程序中获取fps
- 使用FFmpeg解码视频帧时获取的撕裂图像
- FFmpeg - 如何获取打开 ALAC 编解码器所需的额外数据
- 如何从FFMPEG获取文件描述符
- 从AVPicture中获取RGB值,并在FFMPEG中更改为灰度
- 获取ffmpeg格式的帧时间
- 如何从ffmpeg打开的文件中获取流信息
- 如何获取 ffmpeg 中可用的所有编解码器的列表