Video on OpenGL window, from image frames
-
Hi to all of you, I am a new programmer on OpenGL. I am currently working on an application where I have a Debian Linux PC with two usb industrial cameras,acquiring images at a rate of 25fps. Each image data is sent by sockets to a windows PC. The format of the received buffer at the windows PC side is buffer[0]='top left image pixel', buffer[640*480]='bottom right image pixel'. I want know to proccess these buffers an display a video on an OpenGL window at a similar frame rate, or even lower,i.e. even 5-10 frames per second will do for me. I am using Dev-C++ on the windows PC. Can anynone advised me with an appropriate approach?,i.e. what is I mean the most appropriate method to follow. Cheers, DoctorDoctor
-
Hi to all of you, I am a new programmer on OpenGL. I am currently working on an application where I have a Debian Linux PC with two usb industrial cameras,acquiring images at a rate of 25fps. Each image data is sent by sockets to a windows PC. The format of the received buffer at the windows PC side is buffer[0]='top left image pixel', buffer[640*480]='bottom right image pixel'. I want know to proccess these buffers an display a video on an OpenGL window at a similar frame rate, or even lower,i.e. even 5-10 frames per second will do for me. I am using Dev-C++ on the windows PC. Can anynone advised me with an appropriate approach?,i.e. what is I mean the most appropriate method to follow. Cheers, DoctorDoctor
DoctorDoctor wrote:
Can anynone advised me with an appropriate approach?,i.e. what is I mean the most appropriate method to follow.
The easiest, and one line solution, for you is glDrawPixels()[^], you have the right format, direction is easily manipulated with glPixelZoom()[^] and it is compatible with all levels of OpenGL. but... it does not make it available as a texture. Do you need it as a texture within OpenGL? what graphics card do you have? There are several solutions here, the best are avail on recent generation cards.
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
DoctorDoctor wrote:
Can anynone advised me with an appropriate approach?,i.e. what is I mean the most appropriate method to follow.
The easiest, and one line solution, for you is glDrawPixels()[^], you have the right format, direction is easily manipulated with glPixelZoom()[^] and it is compatible with all levels of OpenGL. but... it does not make it available as a texture. Do you need it as a texture within OpenGL? what graphics card do you have? There are several solutions here, the best are avail on recent generation cards.
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
Yes, I need it as texture since its a 2D object. I managed to display a single frame. How can I redraw on the same window? I am using myInit();//reads in the pixels glutDisplayFunc(myDisplay);// display callback function glutMainLoop();// shows the window and loops to accepts and processes input events Myproblem is that now I need to continue displaying frames on the same opened OpenGL window, in order for it to look like video.
-
Yes, I need it as texture since its a 2D object. I managed to display a single frame. How can I redraw on the same window? I am using myInit();//reads in the pixels glutDisplayFunc(myDisplay);// display callback function glutMainLoop();// shows the window and loops to accepts and processes input events Myproblem is that now I need to continue displaying frames on the same opened OpenGL window, in order for it to look like video.
DoctorDoctor wrote:
that now I need to continue displaying frames on the same opened OpenGL window
what you probably want is a PBO (Pixel Buffer Object). This allows rapid transfer of texture objects to and from the card. http://http.download.nvidia.com/developer/Papers/2005/Fast_Texture_Transfers/Fast_Texture_Transfers.pdf[^] you can find more information in the OpenGL SDK from nVidia, Version 9 had the demo of the PBO transfers, not sure about 10. http://download.developer.nvidia.com/developer/SDK/Individual_Samples/3dgraphics_samples.html[^] http://developer.nvidia.com/object/sdk-9.html[^] http://developer.nvidia.com/object/sdk_home.html[^]
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)