Draw frame from FFMpeg lazarus / 70-OpenGL ---------------------------------------------------------------------- RedCat · 2020-04-19 11:56 Kind time of the day, the question of drawing using OpenGL means a frame received from the ffmpeg decoder (continuation of this topic:htt ps://forum.lazarus.freepascal.org/index.php/topic,49196.msg356348.html #msg356348) I listened to the tips that were given to me and tried to manually copy the bytes, it seemed to work better than with direct rendering of data from the decoder, but still it is not drawn as it should and I used pixel-by-pixel copying, which is very slow here is the code:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure SwapTB(dataIN,dataOUT : Pointer;SizeX,SizeY : Integer);var  x,y:GLint;  temp1,temp2,temp3: GLbyte;beginfor y := 0 to (SizeY*SizeX)-2 do   begin      With TWrap(DataIN^)[SizeY*SizeX-y*4] do     begin       TWrap(DataOUT^)[y].R:=R+y*SizeX*4;       TWrap(DataOUT^)[y].G:=G+y*SizeX*4;       TWrap(DataOUT^)[y].B:=B+y*SizeX*4;     end;   end; end;  //........sw s_scale(img_convert_context,@frame^.data,@frame^.linesize,0,codec_cont ext^.height,@pFrameYUV420P^.data,@pFrameYUV420P^.linesize); SwapTB(pFr ameYUV420P^.data[0],pData,codec_context^.width,codec_context^.height);  //.......gluBuild2DMipmaps(GL_TEXTURE_2D, 3, Width, Height, GL_RGB, GL_UNSIGNED_BYTE, pData);//.......   please tell me the normal way to draw frames from ffmpeg (avcodec) to opengl texture the rendering result is also attached rendermustbe - original frame renderresult -  direct rendering of data from a decoder renderresultnew -  rendering by copying pixels