Hi Thibault! Sorry for the delay, but doing some tests for this my hard disk crashed and I had to stop testing...
Do you have any working code where I could build on? I tried something similar, but I got the frame displayed on grey-scale, and reduced its size by 50% horizontally... and this is VERY memory consuming, because I have separate threads, one for decoding and another for displaying... every frame I decode, I allocate memory for the 2D texture and the AVPicture... it would be better to have one AVPicture and the OpenGL texture mapped on that (I think is called frame buffer object extension). Thanks for the help! -----Missatge original----- De: [email protected] [mailto:[email protected]] En nom de Thibault Daoulas Enviat: martes, 16 de diciembre de 2008 22:18 Per a: Libav* user questions and discussions Tema: Re: [libav-user] FFMpeg and OpenGL Hi, Yes you just have to allocate your source and destination, fill the source with your data, create the SwsContext, use sws_scale, and then the whole data will be in the first field of the "destination.data". And linesize contains the number of bytes per line of your frame. I use AVPictures, but I guess it works the same : - avpicture_alloc src - avpicture_alloc dest - SwsContext* sws_context = sws_getContext(...) - avpicture_fill(src, data, ...) - sws_scale(sws_context, ...) I don't know if you want to render it directly onto a texture, but if so you may have to tell your opengl function the data format is BGR. Hope it helps, Thibault. Arnau Font wrote: > Hi! > > I have the AVFrame with the data returned from FFMEG, and I want to display > the frame as a OpenGL texture, as you do. I mean, I have the source for > sws_scale, but not the destination. I guess I have to reserve some memory to > allocate the texture, that will be the 'dst' parameter, and the linesizes > are the length for each colour... or not? I'm quite confused about that. > > Thanks Thibault! > > > >> -----Missatge original----- >> De: [email protected] [mailto:libav-user- >> [email protected]] En nom de Thibault Daoulas >> Enviat: dilluns, 15 / desembre / 2008 21:28 >> Per a: Libav* user questions and discussions >> Tema: Re: [libav-user] FFMpeg and OpenGL >> >> Hi Arnau, >> >> I'm not sure if that's what you're looking for, but I use from a >> streaming output sws_scale indeed to display my frames as textures with >> OpenGL... So do you already have the data you want to display? >> >> Thibault. >> >> Arnau Font wrote: >> >>> Hi group! >>> >>> >>> >>> I'm trying to develop a videoplayer in opengl. I've followed the SDL >>> >> and >> >>> FFMPEG tutorial and now I have a functional player under SDL, using >>> >> the >> >>> SDL_Overlays and all that. But now I want to use openGL. I guess I >>> >> have to >> >>> do a sws_scale to a opengl format, but I'm quite lost about how to do >>> >> it. >> >>> Does anybody have a working example or some guidelines? >>> >>> >>> >>> Lots of thanks!! >>> >>> >>> >>> Arnau Font >>> >>> >>> >>> >>> >>> --------------------------------------------------------------------- >>> >> --- >> >>> _______________________________________________ >>> libav-user mailing list >>> [email protected] >>> https://lists.mplayerhq.hu/mailman/listinfo/libav-user >>> >>> >> _______________________________________________ >> libav-user mailing list >> [email protected] >> https://lists.mplayerhq.hu/mailman/listinfo/libav-user >> > > _______________________________________________ > libav-user mailing list > [email protected] > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
