mpv-player / mpv-examples

📚
224 stars 77 forks source link

Example using a FBO #19

Closed jorgefm closed 4 years ago

jorgefm commented 6 years ago

Hi, I'm using the sdl example and works as expected but I would like to know is it possible to render the video frame to a FBO an use it to show the video in a OpenGL texture.

ghost commented 4 years ago

It is possible, just pass a FBO handle instead of 0. It's all documented.

Asday commented 6 months ago

Please forgive me for being extremely stupid.

Where is it "all documented"? The comment in libmpv/sdl/main.c references render_gl.h, which I think might be mpv/libmpv/render_gl.h which in turn references glGenFrameBuffers(), which isn't mentioned in the SDL docs I found, nor is "frame", nor "buffer".

Googling for "sdl glgenframebuffers", or "sdl get framebuffer", or "sdl get fbo" all lead to the same couple of StackOverflow questions about directly modifying pixels, not getting an int I can give to mpv_opengl_fbo.fbo.

Googling for "sdl mpv fbo" gets me an example of using the opengl-cb API which the README in this repo says doesn't exist any more, an arch linux BBS thread where some guy symlinks his system python2 to python to get libreoffice to work, and this dang issue.

Could someone please point me towards where this is "all documented"? Please remember that if I try really hard, I can just about reach 30 IQ.