Play a video file in c++

Started by
32 comments, last by MLillowitz 12 years ago
Hi guys


I'm coding a small game atm (using a game engine) and I want to implement a video.
Since there isn't a video class included in the engine, I'm looking for some c++ code to do it for me.

I've been looking all over the internet for a few hours now, without any succes.
Most of them have dead links or talk about a win32 form (and not an application, which I use).

So hopefully anybody of you guys can help me solve this problem (I need it pretty quick).


Thanks in advance!
Advertisement
You could try http://fobs.sourceforge.net/
Many thanks for your reply, but unfortunately that's not really what I'm looking for.

I'm looking more for a code that I can paste (and maybe adjust a bit) in my engine to make it work.
Is their something like that available or is it just a weird idea?
Virtually nothing is truly copy-and-paste in the programming world, unless you're doing it wrong.

You'll have to live with at least a modicum of adjustment and customization for almost any system, especially one as large and complex as video rendering. Sometimes you must bend your code to fit the tool, and sometimes (for the better tools) you can bend the tool to fit your code.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]


I'm looking more for a code that I can paste (and maybe adjust a bit) in my engine to make it work.
Is their something like that available or is it just a weird idea?


Sure. '<embed src="www.youtube.com/..../>

But if working in C++, then no...

Reason for that is somewhat convoluted and not entirely technical.
a) you use proprietary codec, which comes with proprietary encoding and playback tools. How well they mesh with your way of doing graphics is down to luck
b) you use one of standard codecs, in which case third-party implementations aren't licensed for distribution (patents, IP, copyrights, etc.), so they're either reference implementations or long abandoned projects before this became a major issue
c) you use whatever OS provides. Unfortunately, most OSes come with quirks, so unless you want to encode same content for different formats, you need to redistribute the media frameworks (such as DX or DirectShow or similar). Most of these again come with various restrictions so they are not convenient to use by design.

Media is just a legal mess, it's also a reason why Java gave up on JMF and why browser vendors are having all those debates about what the content should look like.
What engine are you using? OpenGL or DirectX?

What engine are you using? OpenGL or DirectX?


Neither OpenGL nor DirectX (nor, more pedantically, Direct3D) is an "engine." OGL and D3D are graphics APIs, which sit below the level of an engine.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]


[quote name='DvDmanDT' timestamp='1332891708' post='4925837']
What engine are you using? OpenGL or DirectX?


Neither OpenGL nor DirectX (nor, more pedantically, Direct3D) is an "engine." OGL and D3D are graphics APIs, which sit below the level of an engine.
[/quote]

Ahh, yes, ofcourse. I should probably consume my caffeine before I post. What I mean was "Are you using an engine, if so, which one? Or have you rolled your own? Does the engine use OpenGL or Direct[2D|3D|Draw]"?

Many thanks for your reply, but unfortunately that's not really what I'm looking for.

I'm looking more for a code that I can paste (and maybe adjust a bit) in my engine to make it work.
Is their something like that available or is it just a weird idea?


Bink video is one of my favorites, but you have to license it (last I checked).

Since there isn't a video class included in the engine, I'm looking for some c++ code to do it for me.
I have successfully streamed webcam input to a D3D9 surface using DirectShow in the past. DirectShow is old and perhaps deprecated by now but I'm fairly sure it would happily decode anything you'd throw at it.
If you are really desperate, I could look for the code but it was a project thrown together with no plan of maintaining it so the code is old. And not so nice to look at.

Previously "Krohm"

This topic is closed to new replies.

Advertisement