Play a video file in c++

Started by
32 comments, last by MLillowitz 12 years ago

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


+1 for Bink.

From your experience, what makes Bink better than other options?
Advertisement

[quote name='Nypyren' timestamp='1332905809' post='4925877']
Bink video is one of my favorites, but you have to license it (last I checked).


+1 for Bink.

From your experience, what makes Bink better than other options?
[/quote]

I've only ever had to play video in console games, so I've never even *seen* any other options. It's pretty simple and has never caused any headaches for us.

I've also done a bit of video recording/encoding with DirectShow in Windows. It takes a bit to learn how the graphs work, and after that it's just a matter of debugging them when they don't work. Playback sounds easier, though (the graph will be built automatically?!)

On Windows, as long as you have proper codecs, DirectShow is probably the best bet since you can use it for free. I have no idea what's available for Unix-based systems.

I have no idea what's available for Unix-based systems.


http://sourceforge.net/apps/mediawiki/libtheoraplayer/index.php?title=Main_Page

you also got libvpx (for VP8) and ffmpeg.

The patent situation is, as always a bit murky with these. (for most of the mpeg formats its pretty clear, someone has to pay, VP8 and Theora is a bit of an unknown, there have been some saber rattling from the MPEG-LA about them but AFAIK noone has been sued yet), If you want to play it safe you can either:

1) Use ffmpeg but don't provide codecs, (not a great idea as many free distros don't provide the codecs either due to the patent issues).

2) Use ffmpeg and pay the necessary patentlicenses for the codecs you need to distribute.

3) and ofcourse, if you want to avoid all the hassle and has the budget for it, use Bink, it works on Win/Mac/Linux and all the modern consoles.
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

From your experience, what makes Bink better than other options?
It's got a really nice, clean interface - Bink does rendering into a texture and notifies you when it's ready, it handles all of the timing and audio internally, and you don't need to mess around with codecs, etc as Nypyren mentioned. And it's cross platform, which is especially important for us.
After some days of trying and failing, I want to change direction a bit.
I'm going to provide you guys the most basic files I have (A working project without any additional code).

You've got the skills to add video support to the engine.
So this is a list what should be done.

- Let a video play on screen (without any controls).
I've included an .avi for testing purposes.
- When the video is finished, the program has to quit
- If it's possible, it would be cool if the video was included in the project (so that I have 1 .exe file to share).

I would be very thankfull if somebody could pull it of for me.

Thanks a 1000x in advance, seriously
I'll be happy to do that for you.

My hourly contractual rate is $150/hr and I have a minimum charge of 4 hours. I also require a $200 good-faith advance payment.

Please let me know via PM where to send my invoice.

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

Hi, thanks for posting and asking a great question.

To make it blunt, no, in C++ directly you can't play a video because to play a video you must facilitate a layer beneath the code and the actual display: a GUI(graphical user interface).

[color=#303030][font=Verdana, Geneva, sans-serif]

First of all, to play video you have to build this GUI, and provide whatever video library you're using with a space on which to render the video. The library you have to use really depends on the display/OS y[/font][color=#303030]

ou're using (also true for audio), but Windows might have an API function to play AVI files, and then I'm completely wrong. If you wanna use something[color=#303030]

then there is an [color=#303030]

ActiveX control you can use to display all kinds of video formats (especially if codecs are installed on your system). Try searching [color=#303030]

for "AVI" or something similar.

[color=#303030]

And one more thing. I hate Java. You're far off better with C++.

[color=#303030]

Good luck! If any help, just ask!

[color=#303030]

- Mikey

Question: how much are Bink licenses? I see you have to email for a quote, so I'm sure it varies, but is it at all feasible for indie game devs?

@MattProductions: Nobody is going to write your code for free, so I'd either take ApochPiQ's offer, purchase a Bink license, or write the code to use a free one. If I were you and if I didn't want to spend any money, I'd use libavcodec (which is the library used in FFmpeg), and if I didn't want to use an LGPL library, I'd use libwebm/libvpx/libvorbis. I wouldn't use the AVI file format (it's a pretty terrible container format) (I'd probably use webm), and I'd be very careful about which codecs I'd use (I'd probably use the VP8 and Vorbis codecs) (because, as others have said, there are patents on lots of codecs, and while some may have doubts about VP8 and Vorbis, you've got Google backing and defending you). In other words: playing a video really isn't as easy as we'd all like it to be.
[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

Question: how much are Bink licenses? I see you have to email for a quote, so I'm sure it varies, but is it at all feasible for indie game devs?


Seeing as they have:

Indie game developers: [email="sales3@radgametools.com"]Email us[/email] for indie game pricing!
[/quote]

on their website i'd assume that they do offer reasonably affordable licenses for indies.
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
Hmmm, I really didn't realise that it was that hard to let a video play in a c++ project.
I don't have that much money to spend, so the service that ApochPiQ offers, is not a reachable solution (too bad)

Anyway, I'll will try (and fail) and hopefully, something magical will happen and it will suddenly work.

This topic is closed to new replies.

Advertisement