Video Playback error after K-Lite install


#1

Hey guys,

Really new to Of and wanted to try my first project being to play a simple video. I’ve installed K-Lite full and placed my .mp4 in a file called “movies” which is located in the bin/data file. But I’m still getting this error “Error occured while playing or pausing or opening the file”

I’m using VS community 2017 on Win 10 64 bit.

Does anyone know what i could be doing wrong?

Thanks in advance!


#2

bump, also having this exact issue.


#3

Can you post your code?
And which codec are you using?


#4

Ok so in the ofApp.h I have an ofVideoPlayer object called my_movie

ofVideoPlayer my_movie;

Then in the ofApp.cpp I’ve loaded, updated and drawn that object

void ofApp::setup(){

	my_movie.load("movies\openFrameworks tutorial - 001 using the project ge.mp4");
	my_movie.play();

}

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

	my_movie.update();

}

//--------------------------------------------------------------
void ofApp::draw(){
	my_movie.draw(0, 0, 400, 300);

}

I’m not sure I find which codec I’m using, do you mean with K-Lite?


#5

This might be unrelated, but could you try renaming your mp4 to not have any spaces and then try? Even if that doesn’t work, I’d think that’s good practise any way.


#6

Hey ayruos,

Yup, just renamed the file to “vid” but I’m still getting this error:
“Error occured while playing or pausing or opening the file”


#7

"\" in C (and most programming languages) indicates that the following character is a special character. so in this case the “\o” is not interpreted as a folder separator + an o but as something else. probably just an o

You can use a double bar like:

my_movie.load("movies\\openFrameworks tutorial - 001 using the project ge.mp4");

or just use unix like directory separators which should work fine when used from c in windows like:

my_movie.load("movies/openFrameworks tutorial - 001 using the project ge.mp4");