iDevGames Forums
Render video (e.g. QuickTime) to buffer or texture? - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Render video (e.g. QuickTime) to buffer or texture? (/thread-63.html)



Render video (e.g. QuickTime) to buffer or texture? - Ingemar - May 11, 2010 06:24 AM

I am trying to figure out how to render to a buffer, like rendering a QuickTime movie to an OpenGL texture. In the past, I used GWorlds, which worked just fine, essentially a one-page-of-code problem.

I have searched for current demos, and all I have found have one thing in common: They don't work! They simply don't compile.

Is there a straight-forward and simple demo for this problem?


Render video (e.g. QuickTime) to buffer or texture? - maximile - May 11, 2010 08:04 AM

The CIVideoDemoGL sample code works for me, though it has a lot of extra functionality that complicates it a bit.


Render video (e.g. QuickTime) to buffer or texture? - Ingemar - May 11, 2010 01:09 PM

maximile Wrote:The CIVideoDemoGL sample code works for me, though it has a lot of extra functionality that complicates it a bit.
OK, I'll give that a shot. Thanks!


Render video (e.g. QuickTime) to buffer or texture? - OneSadCookie - May 11, 2010 03:11 PM

You cannot do in this [without a 3rd-party library] in 64-bit; QuickTime is not available, and QTKit lacks any ability to access the pixel data.

(Xcod on Snow Leopard defaults to building 64-bit as well as 32-bit)


Render video (e.g. QuickTime) to buffer or texture? - Ingemar - May 11, 2010 09:45 PM

OneSadCookie Wrote:You cannot do in this [without a 3rd-party library] in 64-bit; QuickTime is not available, and QTKit lacks any ability to access the pixel data.

(Xcod on Snow Leopard defaults to building 64-bit as well as 32-bit)
And no sign of improvement? I thought QuickTimeX was a modernization; Was that only on the surface? If we don't get full 64-bit, then it is time to consider QuickTime dead!

Maybe I should try... ffmpeg?


Render video (e.g. QuickTime) to buffer or texture? - Josh - May 11, 2010 10:06 PM

It's times like this that remind me Apple's developers are only human Smile


Render video (e.g. QuickTime) to buffer or texture? - AnotherJake - May 11, 2010 10:35 PM

Ingemar Wrote:Maybe I should try... ffmpeg?

Seems reasonable.


Render video (e.g. QuickTime) to buffer or texture? - Ingemar - Jun 21, 2010 02:31 PM

Now I am trying to get ffmpeg rolling, but it is only available as source, and when I follow the instructions to compile it, I get compilation errors. <SIGH!>


Render video (e.g. QuickTime) to buffer or texture? - AnotherJake - Jun 21, 2010 06:10 PM

Let us know if you get it working! Smile


Render video (e.g. QuickTime) to buffer or texture? - backslash - Jun 22, 2010 04:18 AM

I had to compile FFMPEG a while back, and I found it would only work if I used the same version of Make as the developers. I had to download the source for that version of Make and build it myself, then I could get FFMPEG to build happily.


RE: Render video (e.g. QuickTime) to buffer or texture? - Ingemar - Mar 28, 2011 01:48 PM

I left this problem for quite some time. Now I have tried again and, using a partially pre-compiled library (apparently from Audacity) I got the ffplay demo running. That almost feels like a solution... Almost. I am pretty uncomfortable with something that feels like compiling or failing at random. Also, something that isn't available as a nice framework, but that is supposed to be installed... from source... and the makefiles are so badly written that they only work on a specific version of make... It is not that bad with the Audacity libraries, I can install them inside my application bundle, but it might be hard to update the library in the future.

All I really want is a framework, or at least the whole thing compiled to one single dylib or .a. Apparently that can't be done, nobody seems to have built one. Are QuickTime and FFMPEG the only realistic alternatives or am I missing something? There should be tons of codecs out there that could do the job.


RE: Render video (e.g. QuickTime) to buffer or texture? - Ingemar - Mar 29, 2011 12:23 AM

Now I am onto an alternative: Xvid. It is open source, and compiles to a single library, without any of the problems ffmpeg has. So far so good.


RE: Render video (e.g. QuickTime) to buffer or texture? - OneSadCookie - Mar 29, 2011 08:02 AM

Remember, with any codec you may have to have a patent license if you distribute your software to a country which allows such. Ogg Theora may be better in this respect than other codecs. It's not the best codec (compared to eg. H.264) but it's not awful, and should be easy to build...


RE: Render video (e.g. QuickTime) to buffer or texture? - Ingemar - Mar 29, 2011 11:08 PM

(Mar 29, 2011 08:02 AM)OneSadCookie Wrote:  Remember, with any codec you may have to have a patent license if you distribute your software to a country which allows such. Ogg Theora may be better in this respect than other codecs. It's not the best codec (compared to eg. H.264) but it's not awful, and should be easy to build...
That's a good idea. I'll check it out.


RE: Render video (e.g. QuickTime) to buffer or texture? - mdejong1024 - Jun 8, 2011 04:09 PM

If your program is for MacOSX, then use Quicktime directly. If you are creating an iOS app, then you can only use H.264 videos by default. I have also created an animation library for iOS that supports APNG and Quicktime Animation codec formats.

http://www.modejong.com/AVAnimator/

This library basically implements the Quicktime to texture operation, but it uses UIKit, not OpenGL to display the video into a UIView or a CALayer.

As far as using ffmpeg goes, be sure you understand the legal implications of statically linking LGPL code into your iOS app.

http://multinc.com/2009/08/24/compatibility-between-the-iphone-app-store-and-the-lgpl/

I also just released an APNG viewer app for iPhone and iPad, it is free and can be downloaded from iTunes here:

APNG viewer