From c5e30e13c4dcd20f1d54de572fa0ce6869fa2899 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Mon, 29 Apr 2013 12:52:37 +0100 Subject: nearly working pipeline --- rotord/01.xml | 2 -- rotord/02.xml | 2 ++ rotord/libavaudioloader.cpp | 5 ++++- rotord/rotor.cpp | 15 +++++++++++---- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/rotord/01.xml b/rotord/01.xml index e4b9067..7a7315d 100755 --- a/rotord/01.xml +++ b/rotord/01.xml @@ -2,8 +2,6 @@ Sample template ©Rotor 2013 beats - segmenter - signal divide signal 1 to divide diff --git a/rotord/02.xml b/rotord/02.xml index 79c1b6c..dfc13df 100644 --- a/rotord/02.xml +++ b/rotord/02.xml @@ -2,6 +2,8 @@ Off and on template ©Rotor 2013 beats + segmenter + outputs 0 except when signal first passes a new integer: then 1 signal to analyse diff --git a/rotord/libavaudioloader.cpp b/rotord/libavaudioloader.cpp index c6c1355..0987928 100644 --- a/rotord/libavaudioloader.cpp +++ b/rotord/libavaudioloader.cpp @@ -180,7 +180,10 @@ uint16_t* libav::Audioloader::get_samples(int num){ //presumes 16bpc here for (int i=0;inb_samples;i++) { for (int j=0;jchannels)+j]= ((uint16_t*) frame->buf[j]->data)[i]; + //buffer[((sample_end+i)*frame->channels)+j]= ((uint16_t*) frame->buf[j]->data)[i]; + //temporarily disabled audio as its is SIGSEV with audio from delorentos + + //buffer[(j*frame->channels)+(sample_end+i)]= ((uint16_t*) frame->buf[j]->data)[i]; ??planar?? nope } } 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 "<getCurrentFrame()<update(); + sleep(.001); + } player->update(); - cerr<<"Video_input: retrieving frame "<<((int) (frame.time*frame.framerate))<RGBdata=player->getPixels(); //don't really know why this is needed every frame + //cerr<<"Video_input: retrieving frame "<<((int) (frame.time*frame.framerate))<