diff options
| author | Tim Redfern <tim@herge.(none)> | 2013-04-29 12:52:37 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@herge.(none)> | 2013-04-29 12:52:37 +0100 |
| commit | c5e30e13c4dcd20f1d54de572fa0ce6869fa2899 (patch) | |
| tree | 837c81bcc120371ca44e45b1de40a61fe12c65f5 /rotord/rotor.cpp | |
| parent | f0c3b9c7bbf41d579a543ad8f6d9ee361dde440e (diff) | |
nearly working pipeline
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; |
