<div dir="ltr"><div><span style="color:rgb(0,0,0)">Hi,</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">I am trying to encode to dnxhd with libavcodec. The result is quite glitchy with stuttering and anomalies on most frames.</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">During encoding I see the following message almost continuously.</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">> Internal error, put_bits buffer too small</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">I have tried to understand what this buffer is, how it is set up and I am struggling. From what I can understand the puts_bit buffer is DNXHDEncContext->m->pb which is initialised via init_put_bits() in dnxhd_encode_thread(). <br></span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">The 2 arguments used in init_put_bits() are DNXHDEncContext->slice_offs and DNXHDEncContext->slice_size. These 2 are configured in dnxhd_setup_thread_slices() with 2 variables MpegEncContext->mb_width and MpegEncContext->mb_bits.</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">If my understanding is correct the 2 aforementioned variables in MpegEncContext are the variables I need to set. However, I have no idea what they mean or how they are accessed outside of AVCodecContext->priv_data.</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">Is my understanding correct? How does one setup the puts_bit buffer correctly for a dnxhd encode?</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">Kind regards</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">Jon Noble<br></span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)"><br></span></div></div>