summaryrefslogtreecommitdiff
path: root/rotord
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2014-02-03 13:47:05 +0000
committerTim Redfern <tim@eclectronics.org>2014-02-03 13:47:05 +0000
commit943bfa53cf5df0ecc9b04967a61be17c64e33e77 (patch)
tree4336d8ee0779fc91377574f27f6fbc869fc16321 /rotord
parent086ac9c59ff0554ca34db17e51f3f9302a656b40 (diff)
bug chasing
Diffstat (limited to 'rotord')
-rw-r--r--rotord/src/cvimage.h4
-rw-r--r--rotord/src/graph.cpp21
2 files changed, 22 insertions, 3 deletions
diff --git a/rotord/src/cvimage.h b/rotord/src/cvimage.h
index 25cf3e8..1210744 100644
--- a/rotord/src/cvimage.h
+++ b/rotord/src/cvimage.h
@@ -130,6 +130,10 @@ namespace Rotor {
return true;
};
bool setup(int _w,int _h){ //set up with internal data
+ if (_w==0||_h==0) {
+ std::cerr<<"Error! cvimage: request to set up image at "<<_w<<"x"<<_h<<std::endl;
+ return false;
+ }
if ((w!=_w)|(h!=_h)){
free();
rgb.create(_h,_w,CV_8UC3);
diff --git a/rotord/src/graph.cpp b/rotord/src/graph.cpp
index 5dd6e0b..c356916 100644
--- a/rotord/src/graph.cpp
+++ b/rotord/src/graph.cpp
@@ -389,16 +389,31 @@ bool Graph::video_render2(const string &output_filename,const double framerate,i
Audio_frame *a;
int64_t sample_start=(start*audioloader.get_sample_rate())/framerate;
- double end=duration;
- if (use_dash) end=vf+mpd_chunk_length;
+ //either open one file and write to it until the end of the movie OR periodically close and reopen files
+
+ double segment_end=duration;
+ int segment_num=0;
+ if (use_dash) {
+ segment_end=vf+mpd_chunk_length;
+ exporter.record(path+namestub+toString(segment_num)+suffix);
+ }
+ else exporter.record(path+namestub+suffix);
while (vf<min(duration,stop*vstep)&&!cancelled){
vf+=vstep;
progress=vf/duration;
- //end+=
+ if (vf>segment_end&&use_dash){
+ exporter.finishRecord();
+ if (vf<duration) {
+ segment_num++;
+ exporter.record(path+namestub+toString(segment_num)+suffix);
+ }
+ }
}
+ if (!use_dash) exporter.finishRecord();
+
}
bool Graph::set_resolution(int w,int h){