• Create Account

## Playing a video in OpenGL

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

7 replies to this topic

### #1kaitodomoto  Members

117
Like
0Likes
Like

Posted 11 April 2014 - 05:04 PM

Hi, I'm not new to C# but I can't say I'm an expert in it either. But that's off-topic. Okay so, Let me break down what I'm trying to do.

So, I have a game that I'm trying to make a executable(EXE) file to run it, but what I want to do is when the client(or exe whatever you want to call it) is ran, I would like it to play a certain video(e.g. like 5 secs long) then go it to the main menu screen. But so far I can't seem to find anyway to do this in OpenGL or in this case SharpGL(.NET version of OpenGL). People keep telling me make textures and add the video to it, but when I go through the code I can't seem to find anything there(unless I'm completely missing something), unless I'm not using the right library, I don't know what to do. A friend of mine was able to do it in C++ with OpenGL but that, in my opinion is completely different, since I'm still learning C++, I cannot attempt to make it in that language without taking weeks to look stuff up and learn.

So to summarize is there a way to play a video using this library? If not is there an alternative that I can use to do this.

Small note: Basically what I'm trying to achieve, is go from a normal game, to a client-server game, and eventually learn to make a mmo(dream a very far dream.) So far, I'm trying to make the client-server part, which this is for.

kaitodomoto

P.S: I'm new to the forum, I have yet to read the rules(if any), not sure if this belongs here, if it doesn't, then the mods can do what they want with it.

### #2Vortez  Members

2705
Like
1Likes
Like

Posted 11 April 2014 - 05:16 PM

You could take a look at this tutorial from nehe, a bit outdated but it still work. Otherwise, you need to find a library that can decompress the video frame and render those as texture.

Edited by Vortez, 11 April 2014 - 05:17 PM.

### #3kaitodomoto  Members

117
Like
0Likes
Like

Posted 11 April 2014 - 05:47 PM

I can't seem to find the code in the SharpGL library, the closest thing I found was

SharpGL.SceneGraph.Assets.Texture


But other then that nothing.

I guess it time to look for a library, I know there's SDL.NET but I tried using that once and it did not work out well.

Do you by any chance have any library's that you'd recommend, if you don't its alright.

But thanks for the help.

### #4TheChubu  Members

8954
Like
0Likes
Like

Posted 11 April 2014 - 05:48 PM

Not mentioning that decoding things by hand isn't quite fun.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

### #5kaitodomoto  Members

117
Like
0Likes
Like

Posted 11 April 2014 - 05:53 PM

Not mentioning that decoding things by hand isn't quite fun.

Not trying to sound rude, but what do you mean?

### #6TheChubu  Members

8954
Like
3Likes
Like

Posted 11 April 2014 - 06:08 PM

Videos are compressed, thus to be used they need to be decoded first. Otherwise a 3min videogame intro would weigh a couple hundred of MBs.

OpenGL doesn't understands of "videos", the closest thing it understands is textures. And that would mean decoding the video to get each single of its frames, then pass them to OpenGL for rendering one after the other.

That's why vortez suggested an aditional library for decoding the video. Video compression algorithms are complex and ever evolving. And at least for me, decoding compressed formats by hand isn't fun at all.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

### #7kaitodomoto  Members

117
Like
0Likes
Like

Posted 11 April 2014 - 06:53 PM

Videos are compressed, thus to be used they need to be decoded first. Otherwise a 3min videogame intro would weigh a couple hundred of MBs.

OpenGL doesn't understands of "videos", the closest thing it understands is textures. And that would mean decoding the video to get each single of its frames, then pass them to OpenGL for rendering one after the other.

That's why vortez suggested an aditional library for decoding the video. Video compression algorithms are complex and ever evolving. And at least for me, decoding compressed formats by hand isn't fun at all.

Oh, I understand, and I get your point, though I don't have first hand experience of what you are talking about, but I'll take your advice and see what I can do.

Thanks for the information though.

### #8Vortez  Members

2705
Like
0Likes
Like

Posted 11 April 2014 - 06:58 PM

Do you by any chance have any library's that you'd recommend, if you don't its alright.

ffmpeg has a very nice library, at least, last time i used it i was able to encode a mp1 movie frame by frame, im pretty sure there is a decoder too, and i think it work for multiples format. Here's the wikipedia article on it.

Edited by Vortez, 11 April 2014 - 07:01 PM.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.