diff options
Diffstat (limited to 'rotord/rotor.cpp')
| -rwxr-xr-x | rotord/rotor.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/rotord/rotor.cpp b/rotord/rotor.cpp index 84578db..6d99f1c 100755 --- a/rotord/rotor.cpp +++ b/rotord/rotor.cpp @@ -161,7 +161,7 @@ bool Video_output::render(const float duration, const float framerate,const stri // //setup defaults int outW=640; - int outH=480; + int outH=360; int bitRate=4000000; int frameRate=25; AVCodecID codecId=AV_CODEC_ID_MPEG4; @@ -223,14 +223,21 @@ Image* Video_input::get_output(const Frame_spec &frame){ //can image node point to buffer in gst rather than copying the pixels? //to test using fp time to seek: need a short movie with synced audio - + //fix actual duration and audio file //trace frame that is being read if (player->isLoaded()){ //player->setPosition(frame.time); - player->setFrame((int) (frame.time*frame.framerate)); + int wanted=((int) (frame.time*frame.framerate))%player->getTotalNumFrames(); + player->setFrame(wanted); + while (player->getCurrentFrame()!=wanted){ + cerr << "seeking to "<<wanted<<" :"<<player->getCurrentFrame()<<endl; + player->update(); + sleep(.001); + } player->update(); - cerr<<"Video_input: retrieving frame "<<((int) (frame.time*frame.framerate))<<endl; + image->RGBdata=player->getPixels(); //don't really know why this is needed every frame + //cerr<<"Video_input: retrieving frame "<<((int) (frame.time*frame.framerate))<<endl; return image; } return nullptr; |
