Advertisement Jump to content
Sign in to follow this  
kaitodomoto

Playing a video in OpenGL

This topic is 1740 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

 

Hopefully I made some sense,

 

Thanks for reading,

    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.

Share this post


Link to post
Share on other sites
Advertisement

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!