Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Help for a very simple video player for slowmo

$
0
0

@Luka_Leroy wrote:

Hi guys !

I filmed slow motion videos with a phantom camera at 1000 fps. I have a slow mo file which is 2 minutes long.

I would like to read this video full screen on a 1920x1080 monitor, speeded up 40 times and when you press a key it's red at a regular speed ( in slow motion ).
I used videoplayerExample and cleaned it to make it to my needs but I don't know how to code.

My problems are:

  • The video is cropped on my 1440x700 monitor, will it be cropped on a 1920x1080 one ?
  • At first the video is red at regular speed, I need to press a key and release it for the video to be red at 40x. Who can it be read at x40 directly?
  • The 40 speed factor doesn't work, but i've just seen a topic about this and don't get too much...
    https://forum.openframeworks.cc/t/playing-movie-very-fast/2561

Here is the code:

#include "ofApp.h"

//--------------------------------------------------------------
void ofApp::setup(){
	ofBackground(255,255,255);
	ofSetVerticalSync(true);
	frameByframe = false;

	// Uncomment this to show movies with alpha channels
	// fingerMovie.setPixelFormat(OF_PIXELS_RGBA);

	fingerMovie.load("movies/fingers.mov");
	fingerMovie.setLoopState(OF_LOOP_NORMAL);
    fingerMovie.play();

}


//--------------------------------------------------------------
void ofApp::update(){
    fingerMovie.update();
}

//--------------------------------------------------------------
void ofApp::draw(){

    ofSetHexColor(0xFFFFFF);

    fingerMovie.draw(0,0);
    ofSetHexColor(0x000000);
    ofPixels & pixels = fingerMovie.getPixels();

    int vidWidth = pixels.getWidth();
    int vidHeight = pixels.getHeight();
    int nChannels = pixels.getNumChannels();

}

//--------------------------------------------------------------
void ofApp::keyPressed  (int key){
    switch(key){
        case 'f':
            fingerMovie.setSpeed(1);
        break;
    }
}

//--------------------------------------------------------------
void ofApp::keyReleased(int key){
    switch(key){
        case 'f':
            fingerMovie.setSpeed(3);
            break;
    }

}

Thank u guys !

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles