It is possible to send the video flux of an OpenGL desktop app via UDP on Linux ? I looked up FBO and off-screen rendering but I still can't figure out how to extract the video flux and send it.

I'm working with C++ but if you have explanations in others langages go ahead.


My original post on stack overflow.


closed as off-topic by Josh Apr 5 '16 at 15:13

  • This question does not appear to be about game development within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • \$\begingroup\$ What's your problem exactly? You render a frame into a FBO, extract it from FBO, send it, then repeat with another frame. You also should use some king of codec, because uncompressed video is too heavy. \$\endgroup\$ – HolyBlackCat Apr 5 '16 at 11:39
  • \$\begingroup\$ My problem was about retrieving each frame and send it via UDP but now it's ok, I understood how to do it. Now I need to render off screen with FBO but I don't know how to, so I'll search. If you have links about it i'd be happy ! \$\endgroup\$ – geauser Apr 5 '16 at 12:02
  • \$\begingroup\$ I'm voting to close this question as off-topic because it is a intra-network cross-post. Please post your question on only one SE site. \$\endgroup\$ – Josh Apr 5 '16 at 15:13

I understood by myself how to retrieve the frame rendered and now I have this method :

void Renderer::getVideoStream(){

    int width = m_window->width();
    int height = m_window->height();

    vector< unsigned char > buf( width * height * 3 );

    glPixelStorei( GL_PACK_ALIGNMENT, 1 );
    glReadPixels( 0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, &buf[0] );

    // compress the image

    // send it via UDP

It works good with screenshots and I should be able to send it via UDP but I don't understand how to use it with FBO so I'll do some search and eventually post another question about it in an other thread.


Not the answer you're looking for? Browse other questions tagged or ask your own question.