void DXTencoderApp::loadMovieFile( const fs::path &moviePath )
{
    try {
        mMovie = qtime::MovieSurface::create( moviePath );
        
        console() << "Dimensions:" << mMovie->getWidth() << " x " << mMovie->getHeight() << std::endl;
        console() << "Duration:  " << mMovie->getDuration() << " seconds" << std::endl;
        console() << "Frames:    " << mMovie->getNumFrames() << std::endl;
        console() << "Framerate: " << mMovie->getFramerate() << std::endl;
        console() << "Has audio: " << mMovie->hasAudio() << " Has visuals: " << mMovie->hasVisuals() << std::endl;

        mMovie->setLoop( false );
        mMovie->seekToStart();
        //mMovie->play();
        isStarted = true;
        currentFrame = 0;

        
        std::string basePath = moviePath.parent_path().string();
        string newFilename =   moviePath.filename().string();
        strReplace(newFilename, moviePath.extension().string(), ".dxt5");
                                                  
        mDxtCreator.open(basePath + "/" + newFilename);

    }
    catch( ci::Exception &exc ) {
        console() << "Exception caught trying to load the movie from path: " << moviePath << ", what: " << exc.what() << std::endl;
    }
    
    
    
}
Beispiel #2
0
void FaceOff::update()
{
#ifdef QUICKTIME_ENABLED
    if (MOVIE_MODE)
    {
        if (!mMovie)
        {
            fs::path moviePath = getAssetPath(MOVIE_PATH);
            try
            {
                // load up the movie, set it to loop, and begin playing
                mMovie = qtime::MovieSurface::create(moviePath);
                mMovie->setLoop();
                mMovie->play();
                mOfflineFaceTex.reset();
            }
            catch (ci::Exception &exc)
            {
                console() << "Exception caught trying to load the movie from path: " << MOVIE_PATH << ", what: " << exc.what() << std::endl;
                mMovie.reset();
            }
        }
        else
        {
            if (mMovie->checkNewFrame())
            {
                auto surface = mMovie->getSurface();
                if (!mOfflineFaceTex)
                {
                    mOfflineFaceTex = gl::Texture2d::create(*surface, gl::Texture::Format().loadTopDown());
                }
                else
                {
                    mOfflineFaceTex->update(*surface);
                }
            }
        }
    }
    else
    {
        mMovie.reset();
        mOfflineFaceTex = mPhotoTex;
    }
#endif

    if (mDeviceId != DEVICE_ID)
    {
        mDeviceId = DEVICE_ID;
        mCapture.setup(CAM_W, CAM_H, mDevices[DEVICE_ID]);
        mDoesCaptureNeedsInit = true;
    }
    
    if (mCapture.isBackCamera)
        mCapture.flip = false;
    else
        mCapture.flip = CAM_FLIP;
}
void QTimeIterApp::loadMovieFile( const fs::path &moviePath )
{
	try {
		mMovie = qtime::MovieSurface::create( moviePath );

		console() << "Dimensions:" << mMovie->getWidth() << " x " << mMovie->getHeight() << std::endl;
		console() << "Duration:  " << mMovie->getDuration() << " seconds" << std::endl;
		console() << "Frames:    " << mMovie->getNumFrames() << std::endl;
		console() << "Framerate: " << mMovie->getFramerate() << std::endl;
		console() << "Has audio: " << mMovie->hasAudio() << " Has visuals: " << mMovie->hasVisuals() << std::endl;
		mMovie->setLoop( true, true );
		mMovie->seekToStart();
		mMovie->play();
	}
	catch( ci::Exception &exc ) {
		console() << "Exception caught trying to load the movie from path: " << moviePath << ", what: " << exc.what() << std::endl;
	}	
}