ofxQTKitVideoPlayer in OF 07

hi all!

has anyone managed to get ofxQTKitVideoPlayer working with OF 07?

thanx!

,r

nevermind- it does work like a charm! (at least n initial testing!)
my problem was that i forgot to include Quartz framework…!

* )

.r

Brilliant, glad you posted about Quartz.

I’m still getting a couple of linker errors but hopefully someone else has posted about them?

  
Undefined symbols for architecture i386:  
  "_QTMakeTime", referenced from:  
      -[QTKitMovieRenderer setPosition:] in QTKitMovieRenderer.o  
      -[QTKitMovieRenderer setFrame:] in QTKitMovieRenderer.o  
      -[QTKitMovieRenderer loadMovie:allowTexture:allowPixels:] in QTKitMovieRenderer.o  
  "_QTMovieOpenAsyncOKAttribute", referenced from:  
      -[QTKitMovieRenderer loadMovie:allowTexture:allowPixels:] in QTKitMovieRenderer.o  
  "_QTMovieURLAttribute", referenced from:  
      -[QTKitMovieRenderer loadMovie:allowTexture:allowPixels:] in QTKitMovieRenderer.o  
  "_QTMovieLoopsAttribute", referenced from:  
      -[QTKitMovieRenderer setLoops:] in QTKitMovieRenderer.o  
      -[QTKitMovieRenderer loops] in QTKitMovieRenderer.o  
  "_QTMovieNaturalSizeAttribute", referenced from:  
      -[QTKitMovieRenderer loadMovie:allowTexture:allowPixels:] in QTKitMovieRenderer.o  
  ".objc_class_name_QTMovie", referenced from:  
      pointer-to-literal-objc-class-name in QTKitMovieRenderer.o  
  "_QTMovieOpenForPlaybackAttribute", referenced from:  
      -[QTKitMovieRenderer loadMovie:allowTexture:allowPixels:] in QTKitMovieRenderer.o  
ld: symbol(s) not found for architecture i386  
collect2: ld returned 1 exit status  
  

Update: Needs also QTKit.framework.

Hey all,

both the ofxQTKitVideoPlayer and ofxQTKitVideoGrabber are updated for 007 now

https://github.com/Flightphase/ofxQTKitVideoGrabber
https://github.com/Flightphase/ofxQTKitVideoPlayer

Although I haven’t looked into how relevant these are now with 10.7 Lion… Anyone give them a try yet? Does AVFoundation put them into obsolescence?

Hi James,

I just tried QTKitVideoPlayerExample under Lion and it does not work anymore. Could it be easy to fix ?

-h

I can confirm that this doesn’t work in Lion. I don’t get any build errors, but my screen is full of crazy glitch.
works fine on 10.6 though.

it worked for me under lion, but i’m pretty sure i heavily modified it. delete any MonoCallbacks.h references and handleVideoEnded and handleVideoLoaded references, and give this a shot… (untested recently, might have some errors in there…) - beware! this is an application-specific fork, and it may not run at all.
www.chasalow.com/OF/ofxQTKitMoviePlayer-experimental.zip

you also may want to delete glTranslatef(0, 0, -1); from the QTKitMovieRenderer draw:(NSRect)drawRect method.

experiment with the following line with YES or NO to turn on/off quicktime X playback, which may be better on Lion:
[NSNumber numberWithBool:NO], QTMovieOpenForPlaybackAttribute,

Hey guys,

Unfortunately i don’t have Lion to test on but i confirmed today that it doesn’t work, but only when you are going for Pixels, Texture modes seem to work ok

here’s my hunch:

Brian implemented a way to grab native YUV2 pixels… before i am using kCVPixelFormatType_32ARGB which seems to be not the most comfy way for QTKit to work.

I’m going to look at his changes now and see if I can’t integrate it back into the main repository

Also the ‘open for playback’ key is the Quicktime X opt in, and sometimes speeds stuff up, sometimes slows stuff down, depending on the codec.

oh man how embarrassing

  
  
bool ofxQTKitVideoPlayer::update()  
{  
	if(moviePlayer == NULL) return false;  
  
	bNewFrame = [moviePlayer update];  
	if (bNewFrame) {  
		bHavePixelsChanged = true;  
	}  
}  
  

should have been

  
  
bool ofxQTKitVideoPlayer::update()  
{  
	if(moviePlayer == NULL) return false;  
  
	bNewFrame = [moviePlayer update];  
	if (bNewFrame) {  
		bHavePixelsChanged = true;  
	}  
	return bHavePixelsChanged;  
}  
  

It must have only cropped up because of LLVM or Lion compiler changes forcing a non-present return value to false…

fixed in git:
https://github.com/Flightphase/ofxQTKitVideoPlayer

PS: I still think forcing ARGB slows things down… but it wasn’t what broke it

hey james- the YUV additions i did were in the Grabber not the Player, but I’m sure it should work the same by adding the changes I did in the Grabber here too. the changes i did here were more related to creating a callback to handle asynchronous loading, i think? I also made it so that LOOP_STATE is always NONE, even if you ‘actually’ want it to be ‘OF_LOOP_NORMAL’ - this way the end-of-movie callback triggers properly, (in that case, it will reset your movie to frame 0 on callback, but at least you got your callback!)

check that issues request btw, this should have a return value too. :wink:

  • (float) volume
    {
    [_movie volume];
    }

Tested out the new version. working much better now. Thanks for the fix!! Performance for HD video is dramatically better than the standard ofVideoPlayer.

I am trying to compile the example from git in windows XP with CodeBlocks. I copied the zip to addons folder.
of_preRelease_v007_win_cb\addons\ofxQTKitVideoPlayer\src

Then I took the all addons example and added that address above to the “Project/Build Options/Search Directories”, but now I get another error. I guess I might need QTKit dev files?? but since there is no documentation I am a bit lost. I am not very good at understanding this errors sorry, thanks for any help!

||Warning: .drectve -defaultlib:LIBCMT ' unrecognized| ||Warning: .drectve-defaultlib:OLDNAMES ’ unrecognized|
||Warning: .drectve -defaultlib:LIBCMT ' unrecognized| ||Warning: .drectve-defaultlib:OLDNAMES ’ unrecognized|
||Warning: .drectve -defaultlib:LIBCMT ' unrecognized| ||Warning: .drectve-defaultlib:OLDNAMES ’ unrecognized|
||Warning: .drectve -defaultlib:LIBCMT ' unrecognized| ||Warning: .drectve-defaultlib:OLDNAMES ’ unrecognized|
||Warning: .drectve -defaultlib:LIBCMT ' unrecognized| ||Warning: .drectve-defaultlib:OLDNAMES ’ unrecognized|
||Warning: .drectve -defaultlib:uuid.lib ' unrecognized| ||Warning: .drectve-defaultlib:uuid.lib ’ unrecognized|
||Warning: .drectve -defaultlib:LIBCMT ' unrecognized| ||Warning: .drectve-defaultlib:OLDNAMES ’ unrecognized|
||Warning: .drectve -defaultlib:LIBCMT ' unrecognized| ||Warning: .drectve-defaultlib:OLDNAMES ’ unrecognized|
||Warning: .drectve /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized| obj\release\src\main.o:main.cpp|| undefined reference toofxQTKitVideoPlayer::ofxQTKitVideoPlayer()’|
obj\release\src\main.o:main.cpp|| undefined reference to ofxQTKitVideoPlayer::~ofxQTKitVideoPlayer()'| obj\release\src\testApp.o:testApp.cpp|| undefined reference toofxQTKitVideoPlayer::getMovieLoopState()’|
obj\release\src\testApp.o:testApp.cpp|| undefined reference to ofxQTKitVideoPlayer::isPaused()'| obj\release\src\testApp.o:testApp.cpp|| undefined reference toofxQTKitVideoPlayer::update()’|
obj\release\src\testApp.o:testApp.cpp|| undefined reference to ofxQTKitVideoPlayer::isFrameNew()'| obj\release\src\testApp.o:testApp.cpp|| undefined reference toofxQTKitVideoPlayer::getPixels()’|
obj\release\src\testApp.o:testApp.cpp|| undefined reference to ofxQTKitVideoPlayer::getHeight()'| obj\release\src\testApp.o:testApp.cpp|| undefined reference toofxQTKitVideoPlayer::getWidth()’|
obj\release\src\testApp.o:testApp.cpp|| undefined reference to ofxQTKitVideoPlayer::draw(float, float)'| obj\release\src\testApp.o:testApp.cpp|| undefined reference toofxQTKitVideoPlayer::getIsMovieDone()’|
obj\release\src\testApp.o:testApp.cpp|| undefined reference to ofxQTKitVideoPlayer::getMovieLoopState()'| obj\release\src\testApp.o:testApp.cpp|| undefined reference toofxQTKitVideoPlayer::getPosition()’|
obj\release\src\testApp.o:testApp.cpp|| undefined reference to ofxQTKitVideoPlayer::getTotalNumFrames()'| obj\release\src\testApp.o:testApp.cpp|| undefined reference toofxQTKitVideoPlayer::getCurrentFrame()’|
obj\release\src\testApp.o:testApp.cpp|| undefined reference to ofxQTKitVideoPlayer::getDuration()'| obj\release\src\testApp.o:testApp.cpp|| undefined reference toofxQTKitVideoPlayer::getPositionInSeconds()’|
obj\release\src\testApp.o:testApp.cpp|| undefined reference to ofxQTKitVideoPlayer::getHeight()'| obj\release\src\testApp.o:testApp.cpp|| undefined reference toofxQTKitVideoPlayer::getWidth()’|
obj\release\src\testApp.o:testApp.cpp|| undefined reference to ofxQTKitVideoPlayer::getHeight()'| obj\release\src\testApp.o:testApp.cpp|| undefined reference toofxQTKitVideoPlayer::loadMovie(std::string, int)’|
obj\release\src\testApp.o:testApp.cpp|| undefined reference to ofxQTKitVideoPlayer::play()'| obj\release\src\testApp.o:testApp.cpp|| undefined reference toofxQTKitVideoPlayer::getHeight()’|
obj\release\src\testApp.o:testApp.cpp|| undefined reference to ofxQTKitVideoPlayer::getWidth()'| obj\release\src\testApp.o:testApp.cpp|| undefined reference toofxQTKitVideoPlayer::setLoopState(bool)’|
obj\release\src\testApp.o:testApp.cpp|| undefined reference to ofxQTKitVideoPlayer::play()'| obj\release\src\testApp.o:testApp.cpp|| undefined reference toofxQTKitVideoPlayer::setPosition(float)’|
obj\release\src\testApp.o:testApp.cpp|| undefined reference to ofxQTKitVideoPlayer::setFrame(int)'| obj\release\src\testApp.o:testApp.cpp|| undefined reference toofxQTKitVideoPlayer::pause()’|
obj\release\src\testApp.o:testApp.cpp:(.text$_ZN7testAppD1Ev[testApp::~testApp()]+0x64)||undefined reference to ofxQTKitVideoPlayer::~ofxQTKitVideoPlayer()'| obj\release\src\testApp.o:testApp.cpp:(.text$\_ZN7testAppD1Ev[testApp::~testApp()]+0xa5)||undefined reference toofxQTKitVideoPlayer::~ofxQTKitVideoPlayer()’|
obj\release\src\testApp.o:testApp.cpp:(.text$_ZN7testAppD0Ev[testApp::~testApp()]+0x64)||undefined reference to ofxQTKitVideoPlayer::~ofxQTKitVideoPlayer()'| obj\release\src\testApp.o:testApp.cpp:(.text$\_ZN7testAppD0Ev[testApp::~testApp()]+0xad)||undefined reference toofxQTKitVideoPlayer::~ofxQTKitVideoPlayer()’|
||=== Build finished: 33 errors, 17 warnings ===|

@altern ofxQTKitVideoPlayer only works on the Mac

oops… but there is a Visual Studio project file in the zip. I thought VS was only windows. sorry.

No problem. You are right - VS is Windows only. Those files are probably just leftover from a copied example

This addon saved my life.

Works like a charm in OSX Lion, with large amount of HD video loading periodically in a 3840x720 project.

I would just add that a couple frameworks need to be added to the project ( Corevideo.framework and QTKit.framework).

Really usefull.