Jump to content
  • Advertisement
Sign in to follow this  
3Ddreamer

Video Content in a Game

This topic is 947 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 am learning OpenGL, using C and eventually C++ and C#.  SDL is kind of where I am leaning, but I have some questions, whether or not I actually use SDL in the future.

 

For an intro of a game, I want the game to start with a short video of 20 seconds or so. Do you have any ideas on a way to open a video in the game script in a way which is reliably OS crossplatform for computers ( Windows, Linux, etc) ?  I am thinking that Flash video might be the way to go. Is there another good alternative?  Any pitfalls which I am not aware? Any ideas on a configuration file format which would be crossplatform and could place videos at different locations during gameplay?

Share this post


Link to post
Share on other sites
Advertisement

You will need a video library to open the video for you, and render the frame into a frame buffer for display. Same deal with the video's sound, except for a sound buffer or stream, it's usually streamed directly into what ever library you are using to control your sound.

 

So your script layer will be an abstraction on top of an abstraction. It will simply be something like a function that tells the engine to load this video, and play it. And how to play it. As in, render it to the main swap buffer, or to hold it in another frame buffer for use in a material that displays as a projection or on a tv screen.

Below that your C++ function could just look like...


LoadVideo( char* FilePath, enum RenderTo = Swap Buffer, float TimeAdjustment = 0)

 

Time Adjustment would be if you want to render the same video multiple times, but at different points in the film. Or you just want to skip a few things.

 

Though on the sidelines you may want to hold the video in memory, or a reference to it in case you will have multiple video feeds.

Edited by Tangletail

Share this post


Link to post
Share on other sites

You will need a video library to open the video for you, and render the frame into a frame buffer for display. Same deal with the video's sound, except for a sound buffer or stream, it's usually streamed directly into what ever library you are using to control your sound.

This.

As a sidenote, I've worked on two games that use Adobe Flash for the cutscreens and the UI and I would recommend staying far away from Flash. The lack of tools aside, Flash is an absolute nightmare and you will spend more time fighting it then building on it.

Share this post


Link to post
Share on other sites

You can try writing your own player for the format which the player will support.That means you can write a player, which supports a format which you want to support! :)

Share this post


Link to post
Share on other sites

You can try writing your own player for the format which the player will support

 
But then instead of writing a game the person will spend their valuable time writing video codecs.  (Codec = "coder/decoder".)  If they wanted to write video codecs, they'd have asked in a math-heavy video processing website rather than gamedev.
 
As we should assume they are trying to write a game, the better suggestion is to use an existing video codec library.

There are quite a few tutorials online about hooking up SDL with ffmpeg or with VLCPlayer. Both are good tools.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!