头像
zys4416
帖子: 29
注册时间: 2010-12-11 9:32

x264(lavf)编码蓝光片源解码错误:number of reference frames (0+5) ex...

我在linux下用x264 cli编码蓝光片源(ffmpeg做lavf输入支持),少部分片源会出现如图红字的错误,因为没有给出具体解码哪些帧出现了错误,因此没法检查输出成品。
未命名.PNG
Google过这个错误,无解……最近实在是纠结因此出来求解
头像
zys4416
帖子: 29
注册时间: 2010-12-11 9:32

Re: x264(lavf)编码蓝光片源解码错误:number of reference frames (0+5) ex

经过测试发现修改这个错误应该不是解码的问题,与编码参数有关……具体哪些参数继续测试中
头像
06_taro
核心会员
核心会员
帖子: 998
注册时间: 2010-09-22 18:32
来自: United Kingdom
联系: 网站

Re: x264(lavf)编码蓝光片源解码错误:number of reference frames (0+5) ex

[syntax lang="c" filename="libavcodec/h264_refs.c"] if (h->long_ref_count + h->short_ref_count -
(h->short_ref[0] == s->current_picture_ptr) > h->sps.ref_frame_count){

/* We have too many reference frames, probably due to corrupted
* stream. Need to discard one frame. Prevents overrun of the
* short_ref and long_ref buffers.
*/
av_log(h->s.avctx, AV_LOG_ERROR,
"number of reference frames (%d+%d) exceeds max (%d; probably "
"corrupt input), discarding one\n",
h->long_ref_count, h->short_ref_count, h->sps.ref_frame_count);
err = AVERROR_INVALIDDATA;

if (h->long_ref_count && !h->short_ref_count) {
for (i = 0; i < 16; ++i)
if (h->long_ref)
break;

assert(i < 16);
remove_long(h, i, 0);
} else {
pic = h->short_ref[h->short_ref_count - 1];
remove_short(h, pic->frame_num, 0);
}
}
[/syntax]
顯然是解碼過程的,x264連coloring都沒有的……
つまんねー事聞くなよ!

I, personally, for me, believe (obviously sometimes) that my OS choice is right. That's me. I'm not telling you that you should believe it. Learn the facts, and the origins behind the facts, and make up your own damn mind. That's why you have one. (source)

Follow me: @06_taro

304——
为纪念伟大的宇宙史上最强压制304先生,联合国教科文组织决定,将每年的第304天,即平年的10月31日或者闰年的10月30日,定为世界304日。
头像
zys4416
帖子: 29
注册时间: 2010-12-11 9:32

Re: x264(lavf)编码蓝光片源解码错误:number of reference frames (0+5) ex

囧...我源码盲
因此还是只能从压制参数上去试验,最近试验加了--min-keyint 2后(其他参数都用--preset veryslow预设),就没有这个错误了 {:cat_2}
emzt
帖子: 10
注册时间: 2012-01-12 0:00

Re: x264(lavf)编码蓝光片源解码错误:number of reference frames (0+5) ex

其实用x264一些默认参数就够了,加多了出问题几率也多

回到 “视频编码器 / Video encoder discussion”