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.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/rotord/src/graph.cpp b/rotord/src/graph.cpp
index 521a18e..b1406b5 100644
--- a/rotord/src/graph.cpp
+++ b/rotord/src/graph.cpp
@@ -96,6 +96,9 @@ bool Graph::preview(xmlIO &XML,string &node,string &_format,int frame,int w,int
}
bool Graph::video_render(const string &output_filename,const double framerate,int start, int stop) {
+ Logger& logger = Logger::get(Log_name);
+
+
if (output_filename.size()==0) return false;
//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
@@ -122,16 +125,38 @@ bool Graph::video_render(const string &output_filename,const double framerate,in
//setup defaults
std::string container;
+ std::string filestub;
Poco::StringTokenizer t(output_filename,".");
if (t.count()>1){
+ filestub=t[t.count()-2];
container="."+t[t.count()-1];
}
- else container=".mp4";
+ else {
+ filestub=output_filename;
+ container=".mp4";
+ }
+
+ if (container==".mpd") use_dash=true;
libav::exporter exporter;
Image* i;
+
+
+ //dash implementation - write into a subfolder
+
+ if (use_dash){
+ struct stat st = {0};
+ if (stat(filestub.c_str(), &st) == -1) {
+ if (mkdir(filestub.c_str(), 0700)!=0){
+ logger.error("MPEG-DASH output: error creating directory "+filestub);
+ return false;
+ }
+ }
+ //directory exists
+ }
+
if (exporter.setup(outW,outH,bitRate,framerate,container,use_fragmentation)) { //codecId,
if (exporter.record(output_filename)) {
@@ -139,7 +164,7 @@ bool Graph::video_render(const string &output_filename,const double framerate,in
bool usingaudio=audioloader.open(audio_filename);
- Logger& logger = Logger::get(Log_name);
+
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