Tag: 渲染到纹理

ffmpegvideo到opengl纹理

我试图渲染帧抓取和转换使用ffmpegvideo到OpenGL纹理放在一个四。 我已经非常疲惫的谷歌,没有find答案,以及我find答案,但他们似乎没有工作。 基本上,我使用avcodec_decode_video2()解码帧,然后sws_scale()将帧转换为RGB,然后glTexSubImage2D()创build一个openGL纹理,但似乎无法得到任何工作。 我已经确定“目标”AVFrame在SWS上下文设置中具有2维的权力。 这是我的代码: SwsContext *img_convert_ctx = sws_getContext(pCodecCtx->width, pCodecCtx->height, pCodecCtx->pix_fmt, 512, 256, PIX_FMT_RGB24, SWS_BICUBIC, NULL, NULL, NULL); //While still frames to read while(av_read_frame(pFormatCtx, &packet)>=0) { glClear(GL_COLOR_BUFFER_BIT); //If the packet is from the video stream if(packet.stream_index == videoStream) { //Decode the video avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet); //If we got a frame then convert it and […]

在iPhone上渲染到非二次幂的纹理

是否可以在iPhone(2G及以上版本)上使用OpenGL ES 1.1进行纹理渲染? 如果我将纹理绑定为渲染缓冲区,则必须是不是POT大小的渲染缓冲区的大小。 但是OpenGL ES 1.1要求纹理是POT。 也许它不能在ES 1.1上完成?