summaryrefslogtreecommitdiff
path: root/rotord/src/graph.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/src/graph.cpp')
-rw-r--r--rotord/src/graph.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/rotord/src/graph.cpp b/rotord/src/graph.cpp
index 771a807..059f21b 100644
--- a/rotord/src/graph.cpp
+++ b/rotord/src/graph.cpp
@@ -81,6 +81,9 @@ bool Graph::preview(xmlIO &XML,string &node,string &_format,int frame,int w,int
bool Graph::video_render(const string &output_filename,const float framerate,int start, int stop) {
if (output_filename.size()==0) return false;
+
+ Logger& logger = Logger::get("Rotor");
+
//https://www.adobe.com/devnet/video/articles/mp4_movie_atom.html
//https://www.google.ie/search?q=ffmbc&aq=f&oq=ffmbc&aqs=chrome.0.57j0l2j60j0j60.4360j0&sourceid=chrome&ie=UTF-8#q=ffmbc+git
@@ -97,12 +100,16 @@ bool Graph::video_render(const string &output_filename,const float framerate,int
if (audio_filename!=""){ //BETTER WAY TO KNOW IF WE ARE USING AUDIO?
video_output->create_envelope(audio_thumb->audiodata);
}
+ logger.information("Video_output 1");
+
for (auto f: find_nodes("video_feedback")){
(dynamic_cast<Video_feedback*>(f))->set_feedback(&(video_output->image));
}
//
//setup defaults
+
+ logger.information("Video_output 2");
AVCodecID codecId=AV_CODEC_ID_H264; //MPEG4;
std::string container;
@@ -112,20 +119,33 @@ bool Graph::video_render(const string &output_filename,const float framerate,int
}
else container=".mp4";
+ logger.information("Video_output 3");
+
//at the moment it crashes if you render before audio is loaded and also on 2nd render
libav::exporter exporter;
+ logger.information("Video_output 4");
+
float spct=100.0f/duration;
+ logger.information("Video_output 5");
+
if (exporter.setup(outW,outH,bitRate,framerate,container,use_fragmentation)) { //codecId,
+ logger.information("Video_output 6");
if (exporter.record(output_filename)) {
+ logger.information("Video_output 7");
+
libav::audio_decoder audioloader;
+ logger.information("Video_output 8");
+
bool usingaudio=audioloader.open(audio_filename);
float *avframe=nullptr;
- Logger& logger = Logger::get("Rotor");
+ logger.information("Video_output 9");
+
+
logger.information("Video_output rendering "+output_filename+": "+toString(duration)+" seconds at "+toString(framerate)+" fps, audio frame size: "+toString(exporter.get_audio_framesize()));
//25fps video and 43.06640625fps audio? hmm
//how to get the timecodes correct for the interleaved files
@@ -146,6 +166,8 @@ bool Graph::video_render(const string &output_filename,const float framerate,int
audio=new uint16_t[samples_in_frame*audioloader.get_number_channels()];
}
+ logger.information("Video_output 10");
+
float vstep=1.0f/framerate;
float v=0.0f;
float vf=start*vstep;