Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Play a video file in c++


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
33 replies to this topic

#21 Servant of the Lord   Crossbones+   -  Reputation: 21159

Like
0Likes
Like

Posted 28 March 2012 - 03:41 PM

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?
It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


Sponsor:

#22 Nypyren   Crossbones+   -  Reputation: 4818

Like
0Likes
Like

Posted 28 March 2012 - 08:41 PM


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?


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.

#23 SimonForsman   Crossbones+   -  Reputation: 6318

Like
0Likes
Like

Posted 28 March 2012 - 11:20 PM

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.
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!

#24 Evil Steve   Members   -  Reputation: 1987

Like
0Likes
Like

Posted 29 March 2012 - 03:03 AM

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.

Steve Macpherson
Systems Programmer

Rockstar North


#25 MattProductions   Members   -  Reputation: 834

Like
0Likes
Like

Posted 30 March 2012 - 04:18 PM

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

Attached Files



#26 ApochPiQ   Moderators   -  Reputation: 16413

Like
3Likes
Like

Posted 30 March 2012 - 05:13 PM

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.

#27 MLillowitz   Banned   -  Reputation: 23

Like
0Likes
Like

Posted 30 March 2012 - 06:37 PM

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).

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 you'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 then there is an ActiveX control you can use to display all kinds of video formats (especially if codecs are installed on your system). Try searching for "AVI" or something similar.

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

Good luck! If any help, just ask!

- Mikey

#28 Cornstalks   Crossbones+   -  Reputation: 6991

Like
0Likes
Like

Posted 30 March 2012 - 10:31 PM

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.
[ 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 ]

#29 SimonForsman   Crossbones+   -  Reputation: 6318

Like
0Likes
Like

Posted 31 March 2012 - 12:27 AM

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 us for indie game pricing!


on their website i'd assume that they do offer reasonably affordable licenses for indies.
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!

#30 MattProductions   Members   -  Reputation: 834

Like
0Likes
Like

Posted 31 March 2012 - 02:22 AM

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.

#31 Antheus   Members   -  Reputation: 2397

Like
0Likes
Like

Posted 31 March 2012 - 06:37 AM

A quick scan of the sources shows it's using DirectDraw.

These are somewhat dated, but look at this example. The AviStreamOpenFromFile and friends, just replace the OGL call with DX equivalent.

It gives you frame-by-frame access. Decode each frame as a bitmap, blit it to surface/texture. You can even render on top of it if you wish.

Sound will likely be a problem, unless you want to muck around with sound buffers and frame skipping. I also don't recall which codecs are supported, so you might need to reencode the video.


A more up to date solution would be DirectShow, but that requires a few hundred lines of code just to set up render graphs and whatnot. It would definitely support everything, from video, audio, any codec, etc., but it's quite a chore to get going, with a bunch of COM incantations.

#32 MattProductions   Members   -  Reputation: 834

Like
0Likes
Like

Posted 31 March 2012 - 06:56 AM

Allrighty, this looks promising.

I don't need sound in the video, so that I won't have issues with that.

#33 Servant of the Lord   Crossbones+   -  Reputation: 21159

Like
0Likes
Like

Posted 31 March 2012 - 10:33 AM

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?

It lists the prices on the website, but not on the Bink Video page (Click the 'Pricing' tab at the top) - slightly confusing. Posted Image
Bink Video is $8500 (they also offer indie discounts when you email) per platform per product, with a discount per additional platform purchased.

"Pricing-wise, we charge on a per-product, per-platform basis. There are no royalties! Buying multiple platforms or multiple products at once will get you big discounts.

We also have bulk licenses, per-site licenses, and per-publisher licenses available - you can email us if you are interested in one of these licenses.

Also note that most publishers already have bulk licenses purchased, so if you are using a major publisher - email us, you might already have a license!"


It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#34 MLillowitz   Banned   -  Reputation: 23

Like
0Likes
Like

Posted 31 March 2012 - 04:43 PM

Hi there.

You don't need to spend money to write a GUI that renders videos.

Please let me know if you need help on this.

- Mikey




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS