Is it possible to use OpenGL to display video and be able to resize the view in runtime?
Asked
Active
Viewed 5,602 times
1 Answers
1
Yes, it works by uploading each frame as a texture by glTexSubImage2D. I've tested this for output from FFmpeg based decoder and it's doing fine.

ognian
- 11,451
- 4
- 35
- 33
-
Is this in software or is it hardware accelerated because software would be too slow. – Namratha Jul 26 '10 at 01:56
-
"Would" be too slow? How do you know that without trying? Furthermore OpenGL isn't the best choice for video playing, unless you're after portability or 3D transformation of the video output. The resizing is performed on GPU with this method. However it will be "slow" on specific Snapdragon hardware like Nexus One. – ognian Jul 26 '10 at 05:46
-
Hi, sorry to interfer, but @ognian, you mention that OpenGL isn't ideal for rendering video frames. I just asked a [question about this](http://stackoverflow.com/questions/5666513/how-to-render-video-from-a-custom-decoder), would you mind taking a look? – olivierg Apr 14 '11 at 16:37
-
Of course one needs to try it out but I am sure you will finally realize that HW decoding is necessary on resolutions > 480p. Especially if you decode H264 streams. With MPeg4 part 2 you might be a bit faster but it also uses a 1/3 more bandwidth. – KPK Aug 04 '11 at 23:40