ofxGStreamer icon indicating copy to clipboard operation
ofxGStreamer copied to clipboard

Frame are choppy when load mjpeg over http server

Open gongzai1219 opened this issue 6 years ago • 0 comments

I run a ffserver to stream DSLR live view, the format of output stream is mjpeg. When I check the view from a webbrowser, the view is ok and the latency is acceptable. After I load the http url by ofVideoPlayer, the view is shown but the frames are very choppy. Is there a way to solve it?

Here is my code:

void ofApp::setup(){
	ofSetFrameRate(60);
	ofSetVerticalSync(true);
	player.setPlayer(ofPtr<ofGstVideoPlayer>(new ofGstVideoPlayer));
	player.setPixelFormat(OF_PIXELS_NATIVE);
	player.load("http://192.168.3.120:8090/test.mjpeg");
	player.play();
}
//--------------------------------------------------------------
void ofApp::update(){
	player.update();
}
//--------------------------------------------------------------
void ofApp::draw(){
	player.draw(0,0);
	ofDrawBitmapStringHighlight("FPS: " + ofToString(ofGetFrameRate()), 20, 20);
}

gongzai1219 avatar Nov 09 '18 09:11 gongzai1219