summaryrefslogtreecommitdiff
path: root/rotord/rotor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/rotor.cpp')
-rwxr-xr-xrotord/rotor.cpp66
1 files changed, 3 insertions, 63 deletions
diff --git a/rotord/rotor.cpp b/rotord/rotor.cpp
index dd98ac3..36ce750 100755
--- a/rotord/rotor.cpp
+++ b/rotord/rotor.cpp
@@ -29,6 +29,7 @@ Node_factory::Node_factory(){
add_type("blend",new Blend());
add_type("mirror",new Mirror());
add_type("monochrome",new Monochrome());
+ add_type("transform",new Transform());
}
bool Signal_input::connect(Signal_node* source) {
@@ -183,68 +184,6 @@ void Audio_analysis::print_features(){
}
cerr<<endl;
}
-/*
-
-bool Video_output::render(const float duration, const float framerate,const string &output_filename,const string &audio_filename,float& progress){
-
- //
- //setup defaults
- int outW=640;
- int outH=360;
- int bitRate=4000000;
- int frameRate=25;
- AVCodecID codecId=AV_CODEC_ID_MPEG4;
- std::string container ="mov";
-
- bool usingaudio=audioloader.setup(audio_filename);
- //at the moment it crashes if you render before audio is loaded
-
- float spct=100.0f/duration;
-
- //if (exporter->setup(outW,outH,bitRate,frameRate,container)) { //codecId,
- // if (exporter->record(output_filename)) {
- libav::encoder encoder=libav::encoder(output_filename.c_str(),outW,outH,framerate);
-
- //cerr << "Rotor: Video_output rendering " << duration << " seconds at " << framerate << " fps, audio frame size: " << exporter->get_audio_framesize()<<endl;
- //25fps video and 43.06640625fps audio? hmm
- //how to get the timecodes correct for the interleaved files
-
- float vstep=1.0f/framerate;
- float v=0.0f;
- float vf=0.0f;
- float af=0.0f;
- while (vf<duration-vstep) {
- if (usingaudio) {
- while (!fless(af,vf)) {
- //insert audio frames until we are ahead of the video
- //exporter->encodeFrame(audioloader.get_samples(exporter->get_audio_framesize()));
- //af+=exporter->get_audio_step();
- int fs=encoder.get_audio_framesize();
- uint16_t *s=audioloader.get_samples(fs);
- encoder.write_frame(af,s); //crashes - s seems to be 0x00
- af+=encoder.get_audio_step();
- }
- }
- Image* i=get_output(Frame_spec(vf,framerate,duration,outW,outH));
- if (i) {
- //exporter->encodeFrame(i->RGBdata);
-
- //encoder->picture_rgb.pts=;
- encoder.write_frame(vf,i->RGBdata);
- }
- vf+=vstep;
- progress=vf/duration;
- }
-
- //exporter->finishRecord();
- cerr << "Rotor: Video_output finished "<< endl;
- return true;
- // }
- //}
-
- //return false;
-}
-*/
bool Video_output::render(const float duration, const float framerate,const string &output_filename,const string &audio_filename,float& progress,int outW,int outH){
@@ -397,7 +336,8 @@ Image* Video_loader::output(const Frame_spec &frame){
if (image.w>0) return &image; //just return the previous frame if possible
else return nullptr;
};
- image.setup_fromRGB(frame.w,frame.h,player.pFrameRGB->data[0]);
+ cerr<<"setting up frame: lineoffset="<<(player.pFrameRGB->linesize[0]-(frame.w*3))<<endl;
+ image.setup_fromRGB(frame.w,frame.h,player.pFrameRGB->data[0],player.pFrameRGB->linesize[0]-(frame.w*3));
return &image;
}