Render video (e.g. QuickTime) to buffer or texture?

Member
Posts: 260
Joined: 2005.05
Post: #1
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?
Quote this message in a reply
Member
Posts: 283
Joined: 2006.05
Post: #2
The CIVideoDemoGL sample code works for me, though it has a lot of extra functionality that complicates it a bit.
Quote this message in a reply
Member
Posts: 260
Joined: 2005.05
Post: #3
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!
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
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)
Quote this message in a reply
Member
Posts: 260
Joined: 2005.05
Post: #5
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?
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #6
It's times like this that remind me Apple's developers are only human Smile
Quote this message in a reply
Moderator
Posts: 3,577
Joined: 2003.06
Post: #7
Ingemar Wrote:Maybe I should try... ffmpeg?

Seems reasonable.
Quote this message in a reply
Member
Posts: 260
Joined: 2005.05
Post: #8
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!>
Quote this message in a reply
Moderator
Posts: 3,577
Joined: 2003.06
Post: #9
Let us know if you get it working! Smile
Quote this message in a reply
Member
Posts: 245
Joined: 2005.11
Post: #10
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.
Quote this message in a reply
Member
Posts: 260
Joined: 2005.05
Post: #11
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.
Quote this message in a reply
Member
Posts: 260
Joined: 2005.05
Post: #12
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.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #13
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...
Quote this message in a reply
Member
Posts: 260
Joined: 2005.05
Post: #14
(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.
Quote this message in a reply
Apprentice
Posts: 9
Joined: 2011.06
Post: #15
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/compatibil...-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
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Render to Texture behaves weirdly ardowz 2 1,455 Feb 17, 2014 04:50 PM
Last Post: ardowz
  OpenGL Texture from Char* Buffer gradyeightythree 0 4,070 May 15, 2009 08:26 PM
Last Post: gradyeightythree
  Texture size for HDR buffer sohta 6 4,581 Jan 14, 2008 05:13 PM
Last Post: sohta
  Fullscreen Quicktime-Video bonanza 1 3,220 Oct 5, 2007 06:41 AM
Last Post: PowerMacX
  Render to Texture? IBethune 5 6,250 May 2, 2007 04:25 AM
Last Post: IBethune