Video Content in a Game

Started by
4 comments, last by frob 8 years, 1 month ago

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?

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software. The better the workflow pipeline, then the greater the potential output for a quality game. Completing projects is the last but finest order.

by Clinton, 3Ddreamer

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.

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.

"The code you write when you learn a new language is shit.
You either already know that and you are wise, or you don’t realize it for many years and you are an idiot. Either way, your learning code is objectively shit." - L. Spiro

"This is called programming. The art of typing shit into an editor/IDE is not programming, it's basically data entry. The part that makes a programmer a programmer is their problem solving skills." - Serapth

"The 'friend' relationship in c++ is the tightest coupling you can give two objects. Friends can reach out and touch your privates." - frob

You might want to look at ffmpeg
Google result with using ffmpeg with opengl seem promising
https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=ffmpeg%20with%20opengl

My current game project Platform RPG

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! :)

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.

This topic is closed to new replies.

Advertisement