play video using opengles, android
how to play video using opengl es in android?
Asked by: Vanessa693 | Posted: 24-01-2022
Answer 1
Your question is a bit vague. If all you want to do is to play a video in a GL surface, it's possible. See the Media Player
sample code that Dave was referring to in his sample. All you have to do there is to replace the SurfaceView
with a GLSurfaceView
in both the MediaPlayerDemo_Video.java file as well as in the corresponding layout file (mediaplayer_2.xml).
Also you need to create a custom Renderer class (one that implements the GLSurfaceView.Renderer
interface) and set it to your GLSurfaceView
.
After you do all this, you will have your video playing on a GL surface, but that would be all.
If, on the other hand, you want to manipulate the video, i.e. to draw the video frames in a GL texture and add effects to it or transform it (for example scale, rotate, etc.), then I'm afraid this can't be done. The reason is that you don't have access to the raw video frames in your application.
Answered by: Fiona259 | Posted: 25-02-2022Answer 2
I'm not sure why you're metioning OpenGL here, but probably the easiest way to play video is using the VideoView
class. You'll want to have a look at the MediaPlayer
class too.
You might find the Audio and Video page in the Android Developer Documentation helpful.
There's VideoView
sample code and MediaPlayer
sample code in the API demos provided with the Android SDK.
Similar questions
opengl es - Draw Pixel using OpenGLEs for Android
How can I draw a pixel(2D view)for Android using OpenGlEs?
It is simple when we use for drawing
draw(Canvas canvas)
{
...
}
So using it we draw
canvas.drawPoint(i, j, paint);
But in OpenGlEs I still haven't got any function like it.
Please reply
Thank in Advance
opengl es - Draw Pixel using OpenGLEs for Android
How can I draw a pixel(2D view)for Android using OpenGlEs?
It is simple when we use for drawing
draw(Canvas canvas)
{
...
}
So using it we draw
canvas.drawPoint(i, j, paint);
But in OpenGlEs I still haven't got any function like it.
Please reply
Thank in Advance
opengl es - Draw Pixel using OpenGLEs for Android
How can I draw a pixel(2D view)for Android using OpenGlEs?
It is simple when we use for drawing
draw(Canvas canvas)
{
...
}
So using it we draw
canvas.drawPoint(i, j, paint);
But in OpenGlEs I still haven't got any function like it.
Please reply
Thank in Advance
opengl es - OpenglES Ellipse in Android
I'm trying to draw an ellipse/circle in android, but I'm having trouble getting it to show up. I can do it fine in OpenGL in C (not in android) using an inefficent loop and glVertex, but OpenGL ES seems different enough that I'm somewhat lost. My ellipse class is below. I want to be able to define all the vertices in the constructor and draw them with the draw() method.
public class Ellipse {
private fl...
android - openglES - give a curved effect to a wall of pictures
I am starting with openglES (on android).
I have in my app a wall of pictures. I have already made a simple tiled wall where I can browse with translations and zooms, and implemented a simple picking system.
Now I would like to give this wall a curved effect like we can see often (like in safari, see my images)
Do you think i can do it by applying simples (naive..) Y-rotations and Z-translations on ...
Android opengles animated text logic?
I have gotten text to render using opengl es on android and currently am trying to find out how to "animate" it like in pokemon games where it "reveals" the characters from left to right at a certain speed.
How is this done?
How to display a bitmap in android through OpenGLES in C++?
I have a class in my Java layer which implement Renderer. Inside this class I have a bitmap which I want to pass to JNI layer. JNI layer would be responsible for displaying bitmap by using OpenGL. Can anyone tell me how this can be done?
Update:
I know there is an open gl method glTexImage2D which can be used to display a simple 2D image. Can anyone tell me how can I use i...
android - OpenGLES 1.0 Lighting : Specular Light shine only one side of the object
I am developing an android app with OpenGLES but when i add a specular light the object shine only one side of object while i use the same code and a little modify for complatible with glut it work fine.
Here is my Code in activity
private Handler handler = new Handler();
private Handler handlerz = new Handler();
private ArrayList<Bottle> objecttable = new ArrayList<Bottle>();
private b...
opengl es - How to convert a JPG or PNG file to RGB_565 format and load to opengles 2.0 in android?
I am working on a application for android with Opengl es 2.0. Currently I am loading a huge file of size 2048x2048 for texture. I basically have a lot of 256x256 images merged into this one big file to save time loading into the app. I got to know that by converting this jpg file to a RGB_565 i can save some meory and there by loading faster.
I tried to google this but did not find any direct way to convert a jpg ...
opengl es - Android OpenGLES drawing buffer, blank screen
Im trying to draw primitives using a FloatBuffer for my vertices and a ShortBuffer for the indexes. Everything works fine with no crashes or warnings but the screen is blank. I can draw with glDrawTexfOES without trouble.
If anyone could take a look at the code I would appreciate it alot.
public abstract class PrimitiveBase extends DrawableEntity {
protected float[] _vertices;
protected short[] _in...
opengl es - grid of cubes android opengles
I read the dimensions of a cube from a file (x,y,z) and create opengl vertex array with equally spaced points. I am able to display the points as a 3d point cube of dimension (x,y,z). However, I want to display small cubes instead of points so that the output will look like a grid of cubes of dimension x*Y*Z instead of 3d points. How can I achieve this in android openges1.0 in java?
Thanks.
android - Opengles 1.1 render complete image to array
Is there any way to render image to array without using glreadpixel since i'm going to use it for color picking object and reading pixel from framebuffer seem to have a problem with different hardware.
for example
there is image which came from render pipeline and normally render to screen but i want opengles to render it to array.
Still can't find your answer? Check out these communities...
Android Google Support | Android Community | Android Community (Facebook) | Dev.io Android