Browse Source

check if frame is equal to seek!

tsns-map
cailean 5 months ago
parent
commit
abbc55cded
  1. 10
      src/Player.cpp
  2. 3
      src/ofApp.cpp

10
src/Player.cpp

@ -33,6 +33,7 @@ void Player::Update(ofImage &img, bool show_frame){
if(videoPlayer.isLoaded() && !show_frame){
hasVideo = true;
playerCurrentFrame = videoPlayer.getCurrentFrame();
std::cout << playerCurrentFrame << std::endl;
videoPlayer.update();
aspect_ratio = videoPlayer.getWidth() / videoPlayer.getHeight();
}
@ -92,7 +93,7 @@ void Player::SetVideoOnAwake(std::string path, ofFbo &fbo){
void Player::SetVideo(std::string path, std::string frame, bool is_active){
if(path.empty()){
path = "videos/demo.mp4";
path = "videos/output.mp4";
}
/* convert str frame -> int (remove _x)*/
@ -113,8 +114,11 @@ void Player::SetVideo(std::string path, std::string frame, bool is_active){
}
if(set_frame){
videoPlayer.setFrame(800);
set_frame = false;
if(videoPlayer.isPlaying() && playerCurrentFrame != f_number){
videoPlayer.setFrame(f_number);
if(playerCurrentFrame == f_number)
set_frame = false;
}
}
}
}

3
src/ofApp.cpp

@ -19,7 +19,7 @@ void ofApp::setup(){
/* setup video */
player.Setup();
player.SetVideoOnAwake("videos/demo.mp4", model_output_fbo_1);
player.SetVideoOnAwake("dataset/20230601_webexclusi-irelandsey_cl11536538/20230601_webexclusi-irelandsey_cl11536538.mp4", model_output_fbo_1);
player.SetFrame("demo.jpg");
/* setup models (modelPath, log, useCuda) */
@ -205,6 +205,7 @@ void ofApp::renderDepthMap(){
depthToColourShader.setUniform1f("texH", rampedFbo.getHeight());
screen_fbo.draw(0, 0);
depthToColourShader.end();
img.draw(0, 0);
rampedFbo.end();

Loading…
Cancel
Save