FFMPEG avcodec_decode_video2函数错误代码
ffmpeg avcodec_decode_video2 function error codes
我在函数中使用avcodec_decode_video2
在流动方式:
if (packet.isEOF()) {
AVPacket eofpkt;
av_init_packet(&eofpkt);
eofpkt.data = NULL;
eofpkt.size = 0;
ret = avcodec_decode_video2(d.codec_ctx, d.frame, &got_frame_ptr, &eofpkt);
} else {
ret = avcodec_decode_video2(d.codec_ctx, d.frame, &got_frame_ptr, (AVPacket*)packet.asAVPacket());
}
//qDebug("pic_type=%c", av_get_picture_type_char(d.frame->pict_type));
d.undecoded_size = qMin(packet.data.size() - ret, packet.data.size());
if (ret < 0) {
//qWarning("[VideoDecoderFFmpegBase] %s", av_err2str(ret));
return false;
}
if (!got_frame_ptr) {
qWarning("no frame could be decompressed: %s %d/%d", av_err2str(ret), d.undecoded_size, packet.data.size());
return !packet.isEOF();
}
当我运行它时,我收到一个错误(我进入if(!got_frame_ptr)
(,在打印中我得到的 ret 值是: 203,3053,5120 (或者更准确的是我的打印:
Warning: "no frame could be decompressed: Error number 203 occurred 0/203"
Warning: "no frame could be decompressed: Error number 3053 occurred 0/3053"
Warning: "no frame could be decompressed: Error number 5120 occurred 0/5120"
(av_err2str(ret)
只是打印装饰的ret,仅此而已((
avcodec_decode_video2
docomentatin 说:On error a negative value is returned, otherwise the number of bytes used or zero if no frame could be decompressed.
我的情况不是avcodec_decode_video2返回负值,但我确实在got_frame_ptr时得到零,而不是got_frame_ptr的值将与ret
相同的值,就像 Doc. 说我得到这个奇数值 (203,3053,5120(。
我的问题是:
此错误代码是什么意思?(我在FFMPEG文档上搜索,我没有找到每个数值应该代表什么的好记录(
为什么我从这个函数中得到这个值?是ffmpeg错误吗? 还是我没有理解 FFMPEG ?
谢谢 克。
没有完成解压缩帧并不是错误,帧解码往往会延迟几帧以启用帧多线程。
[编辑] 换句话说,如果ret >= 0 && got_frame_ptr == 0
,只需照常继续并假设它成功但输出延迟。延迟的数据将在最后用NULL
数据包刷新队列时返回。
- "error: no matching function for call to"构造函数错误
- 为什么我在使用void函数时得到错误代码C2276
- 使用另一个函数调用一个函数(都在类中)时出现问题.没有错误代码C++
- 如何从构造函数返回错误代码?
- 在 c++ 代码中将数组传递给函数错误
- FFMPEG avcodec_decode_video2函数错误代码
- 错误代码:无匹配函数供呼叫
- C++ 为什么不使用已删除的函数时编译器失败并显示错误代码 C2280
- 使用创建进程函数创建"dir"命令失败,错误代码为 2
- C++错误处理-使用std::pair或std::tuple返回错误代码和函数返回的缺点
- ldap_search函数使用 C++ Win32 API 返回错误代码 10
- 对ReadFile函数的异步调用返回6个错误代码
- 如何从C++中的主函数返回错误代码
- 为什么编译带有-O3标志函数的c++代码后会产生错误的输出
- 代码块C++类构造函数错误
- 我如何从CreateDIBitmap()函数获得错误代码
- 有效代码无法通过visual studio 2015编译(std函数错误?)
- send()函数中的错误代码88(套接字编程)
- C++ 代码中的 getline() 函数错误
- Eclipse:编译,但 CODAN(内部代码分析器)给出C++ 11 <includes>中的函数错误