<div dir="ltr"><div>I am trying to encode bitstreams from a YUV file same way as avcenc does, I followed pretty much all the steps in my code except I am forcing I-frame only, but my file won't play on mplayer and error out with messages like : <br>
<br>FPS forced to be 30.000  (ftime: 0.033).<br>Starting playback...<br>[h264 @ 0x7ffff1591a80]top block unavailable for requested intra4x4 mode -1 at 0 0<br>[h264 @ 0x7ffff1591a80]error while decoding MB 0 0, bytestream (60613)<br>
[h264 @ 0x7ffff1591a80]concealing 1584 DC, 1584 AC, 1584 MV errors<br>VDec: vo config request - 704 x 576 (preferred colorspace: Planar YV12)<br>VDec: using Planar YV12 as output csp (no 0)<br>Movie-Aspect is undefined - no prescaling applied.<br>
VO: [xv] 704x576 => 704x576 Planar YV12 <br>[h264 @ 0x7ffff1591a80]top block unavailable for requested intra4x4 mode -1 at 0 0<br>[h264 @ 0x7ffff1591a80]error while decoding MB 0 0, bytestream (59875)<br>[h264 @ 0x7ffff1591a80]mmco: unref short failure<br>
[h264 @ 0x7ffff1591a80]concealing 1584 DC, 1584 AC, 1584 MV errors<br>[h264 @ 0x7ffff1591a80]number of reference frames exceeds max (probably corrupt input), discarding one<br>[h264 @ 0x7ffff1591a80]top block unavailable for requested intra4x4 mode -1 at 0 0<br>
[h264 @ 0x7ffff1591a80]error while decoding MB 0 0, bytestream (59896)<br><br><br></div>I stepped thru the libav code to find where its having issues and problem is in this function: <br><br><div><div><div><div><div>int ff_h264_check_intra4x4_pred_mode(H264Context *h){<br>
    MpegEncContext * const s = &h->s;<br>    static const int8_t top [12]= {-1, 0,LEFT_DC_PRED,-1,-1,-1,-1,-1, 0};<br>    static const int8_t left[12]= { 0,-1, TOP_DC_PRED, 0,-1,-1,-1, 0,-1,DC_128_PRED};<br>    int i;<br>
<br>    if(!(h->top_samples_available&0x8000)){<br>        for(i=0; i<4; i++){<br>            int status= top[ h->intra4x4_pred_mode_cache[scan8[0] + i] ];<br>            if(status<0){<br>                av_log(h->s.avctx, AV_LOG_ERROR, "top block unavailable for requested intra4x4 mode %d at %d %d\n", status, s->mb_x, s->mb_y);<br>
                return -1;<br>            } else if(status){<br>                h->intra4x4_pred_mode_cache[scan8[0] + i]= status;<br>            }<br>        }<br>    }<br><br></div>> p i<br><div>> 2<br></div><div>
<div>> p  status <br>> -1 <br></div><div>> p   h->intra4x4_pred_mode_cache[scan8[0] + i]<br>> 6<br><br></div><div>My question is what would cause something like this? When I look at the bitstream, it all looks normal, the headers look ok.<br>
<br></div><div>Ratin<br></div><div><br></div></div></div></div></div></div></div>