Good day!<div>I use theoralib and want understand how to create simple encoder.Now i do:</div><div><br></div><div>1) create frame (640x480 pixels 4:2:0) and init yuv_buffer variable:</div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>yuv.uv_height<span class="Apple-tab-span" style="white-space:pre">        </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>240;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>yuv.uv_width<span class="Apple-tab-span" style="white-space:pre">        </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>320;<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>yuv.y_height<span class="Apple-tab-span" style="white-space:pre">        </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>480;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>yuv.y_width<span class="Apple-tab-span" style="white-space:pre">                </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>640;<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>yuv.uv_stride<span class="Apple-tab-span" style="white-space:pre">        </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>320;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>yuv.y_stride<span class="Apple-tab-span" style="white-space:pre">        </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>640;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>yuv.u<span class="Apple-tab-span" style="white-space:pre">        </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>(unsigned char*)Cb_chroma;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>yuv.v<span class="Apple-tab-span" style="white-space:pre">        </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>(unsigned char*)Cr_chroma;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>yuv.y<span class="Apple-tab-span" style="white-space:pre">        </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>(unsigned char*)Y_luma;</div>
</div><div>2) create th_enc_ctx variable:</div><div><div> ti.frame_height<span class="Apple-tab-span" style="white-space:pre">                </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>480;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ti.frame_width<span class="Apple-tab-span" style="white-space:pre">                </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>640;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>ti.pic_height<span class="Apple-tab-span" style="white-space:pre">                </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>480;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ti.pic_width<span class="Apple-tab-span" style="white-space:pre">                </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>640;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>ti.pic_x<span class="Apple-tab-span" style="white-space:pre">                        </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>0;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ti.pic_y<span class="Apple-tab-span" style="white-space:pre">                        </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>0;<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>ti.colorspace<span class="Apple-tab-span" style="white-space:pre">                </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>TH_CS_ITU_REC_470M;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>ti.pixel_fmt<span class="Apple-tab-span" style="white-space:pre">                </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>TH_PF_420;</div><div>
<span class="Apple-tab-span" style="white-space:pre">        </span>ti.target_bitrate<span class="Apple-tab-span" style="white-space:pre">        </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>1;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ti.quality<span class="Apple-tab-span" style="white-space:pre">                        </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>50;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>ti.keyframe_granule_shift<span class="Apple-tab-span" style="white-space:pre">        </span>=<span class="Apple-tab-span" style="white-space:pre">        </span>0;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>td=th_encode_alloc(&ti);</div></div><div><br></div><div>What is the next steps? I need only write to external file 1 theora frame and see it in VLC player. </div>
<div>Thank you!</div>