- if (filtername=="videostab"){
- QStringList ls;
- ls << "shutterangle,type,int,value,0,min,0,max,100,tooltip,Angle that Images could be maximum rotated";
- fillParameters(ls);
- }else if (filtername=="videostab2"){
- QStringList ls;
- ls << "accuracy,type,int,value,4,min,1,max,10,tooltip,Accuracy of Shakiness detection";
- ls << "shakiness,type,int,value,4,min,1,max,10,tooltip,How shaky is the Video";
- ls << "stepsize,type,int,value,6,min,0,max,100,tooltip,Stepsize of Detection process minimum around";
- ls << "algo,type,bool,value,1,min,0,max,1,tooltip,0 = Bruteforce 1 = small measurement fields";
- ls << "mincontrast,type,double,value,0.3,min,0,max,1,factor,1,decimals,2,tooltip,Below this Contrast Field is discarded";
- ls << "show,type,int,value,0,min,0,max,2,tooltip,0 = draw nothing. 1 or 2 show fields and transforms";
- ls << "smoothing,type,int,value,10,min,0,max,100,tooltip,number of frames for lowpass filtering";
- ls << "maxshift,type,int,value,-1,min,-1,max,1000,tooltip,max number of pixels to shift";
- ls << "maxangle,type,int,value,-1,min,-1,max,1000,tooltip,max anglen to rotate (in rad)";
- ls << "crop,type,bool,value,0,min,0,max,1,tooltip,0 = keep border 1 = black background";
- ls << "invert,type,bool,value,0,min,0,max,1,tooltip,invert transform";
- ls << "realtive,type,bool,value,1,min,0,max,1,tooltip,0 = absolute transform 1= relative";
- ls << "zoom,type,int,value,0,min,-500,max,500,tooltip,additional zoom during transform";
- ls << "optzoom,type,bool,value,1,min,0,max,1,tooltip,use optimal zoom (calulated from transforms)";
- ls << "sharpen,type,double,value,0.8,min,0,max,1,decimals,1,tooltip,sharpen transformed image";
- fillParameters(ls);
-
- }
+ if (filtername=="videostab"){
+ QStringList ls;
+ ls << "shutterangle,type,int,value,0,min,0,max,100,tooltip,Angle that Images could be maximum rotated";
+ fillParameters(ls);
+ }else if (filtername=="videostab2"){
+ QStringList ls;
+ ls << "accuracy,type,int,value,4,min,1,max,10,tooltip,Accuracy of Shakiness detection";
+ ls << "shakiness,type,int,value,4,min,1,max,10,tooltip,How shaky is the Video";
+ ls << "stepsize,type,int,value,6,min,0,max,100,tooltip,Stepsize of Detection process minimum around";
+ ls << "algo,type,bool,value,1,min,0,max,1,tooltip,0 = Bruteforce 1 = small measurement fields";
+ ls << "mincontrast,type,double,value,0.3,min,0,max,1,factor,1,decimals,2,tooltip,Below this Contrast Field is discarded";
+ ls << "show,type,int,value,0,min,0,max,2,tooltip,0 = draw nothing. 1 or 2 show fields and transforms";
+ ls << "smoothing,type,int,value,10,min,0,max,100,tooltip,number of frames for lowpass filtering";
+ ls << "maxshift,type,int,value,-1,min,-1,max,1000,tooltip,max number of pixels to shift";
+ ls << "maxangle,type,int,value,-1,min,-1,max,1000,tooltip,max anglen to rotate (in rad)";
+ ls << "crop,type,bool,value,0,min,0,max,1,tooltip,0 = keep border 1 = black background";
+ ls << "invert,type,bool,value,0,min,0,max,1,tooltip,invert transform";
+ ls << "realtive,type,bool,value,1,min,0,max,1,tooltip,0 = absolute transform 1= relative";
+ ls << "zoom,type,int,value,0,min,-500,max,500,tooltip,additional zoom during transform";
+ ls << "optzoom,type,bool,value,1,min,0,max,1,tooltip,use optimal zoom (calulated from transforms)";
+ ls << "sharpen,type,double,value,0.8,min,0,max,1,decimals,1,tooltip,sharpen transformed image";
+ fillParameters(ls);
+
+ }
- connect(buttonBox,SIGNAL(rejected()), this, SLOT(slotAbortStabilize()));
-
- m_timer=new QTimer(this);
- connect(m_timer, SIGNAL(timeout()), this, SLOT(slotShowStabilizeInfo()));
-
- vbox=new QVBoxLayout(optionsbox);
- QHashIterator<QString,QHash<QString,QString> > hi(m_ui_params);
- while(hi.hasNext()){
- hi.next();
- QHash<QString,QString> val=hi.value();
- if (val["type"]=="int" || val["type"]=="double"){
- DoubleParameterWidget *dbl=new DoubleParameterWidget(hi.key(), val["value"].toDouble(),
- val["min"].toDouble(),val["max"].toDouble(),val["value"].toDouble(),
- "",0/*id*/,""/*suffix*/,val["decimals"]!=""?val["decimals"].toInt():0,this);
- dbl->setObjectName(hi.key());
- dbl->setToolTip(val["tooltip"]);
- connect(dbl,SIGNAL(valueChanged(double)),this,SLOT(slotUpdateParams()));
- vbox->addWidget(dbl);
- }else if (val["type"]=="bool"){
- QCheckBox *ch=new QCheckBox(hi.key(),this);
- ch->setCheckState(val["value"] == "0" ? Qt::Unchecked : Qt::Checked);
- ch->setObjectName(hi.key());
- connect(ch, SIGNAL(stateChanged(int)) , this,SLOT(slotUpdateParams()));
- ch->setToolTip(val["tooltip"]);
- vbox->addWidget(ch);
-
- }
- }
+ connect(buttonBox,SIGNAL(rejected()), this, SLOT(slotAbortStabilize()));
+
+ m_timer=new QTimer(this);
+ connect(m_timer, SIGNAL(timeout()), this, SLOT(slotShowStabilizeInfo()));
+
+ vbox=new QVBoxLayout(optionsbox);
+ QHashIterator<QString,QHash<QString,QString> > hi(m_ui_params);
+ while(hi.hasNext()){
+ hi.next();
+ QHash<QString,QString> val=hi.value();
+ if (val["type"]=="int" || val["type"]=="double"){
+ DoubleParameterWidget *dbl=new DoubleParameterWidget(hi.key(), val["value"].toDouble(),
+ val["min"].toDouble(),val["max"].toDouble(),val["value"].toDouble(),
+ "",0/*id*/,""/*suffix*/,val["decimals"]!=""?val["decimals"].toInt():0,this);
+ dbl->setObjectName(hi.key());
+ dbl->setToolTip(val["tooltip"]);
+ connect(dbl,SIGNAL(valueChanged(double)),this,SLOT(slotUpdateParams()));
+ vbox->addWidget(dbl);
+ }else if (val["type"]=="bool"){
+ QCheckBox *ch=new QCheckBox(hi.key(),this);
+ ch->setCheckState(val["value"] == "0" ? Qt::Unchecked : Qt::Checked);
+ ch->setObjectName(hi.key());
+ connect(ch, SIGNAL(stateChanged(int)) , this,SLOT(slotUpdateParams()));
+ ch->setToolTip(val["tooltip"]);
+ vbox->addWidget(ch);
+
+ }
+ }
- if (m_profile){
- m_playlist= new Mlt::Playlist;
- Mlt::Filter filter(*m_profile,filtername.toUtf8().data());
- QHashIterator <QString,QHash<QString,QString> > it(m_ui_params);
- while (it.hasNext()){
- it.next();
- filter.set(
- it.key().toAscii().data(),
- QString::number(it.value()["value"].toDouble()).toAscii().data());
- }
- Mlt::Producer p(*m_profile,s_url.toUtf8().data());
- if (p.is_valid()) {
- m_playlist->append(p);
- m_playlist->attach(filter);
- m_consumer= new Mlt::Consumer(*m_profile,"xml",destination.toUtf8().data());
- m_consumer->set("all",1);
- m_consumer->set("real_time",-2);
- m_consumer->connect(*m_playlist);
- m_stabilizeRun = QtConcurrent::run(this, &ClipStabilize::slotRunStabilize);
- m_timer->start(500);
- button_start->setEnabled(false);
- }
- }
+ if (m_profile){
+ m_playlist= new Mlt::Playlist;
+ Mlt::Filter filter(*m_profile,filtername.toUtf8().data());
+ QHashIterator <QString,QHash<QString,QString> > it(m_ui_params);
+ while (it.hasNext()){
+ it.next();
+ filter.set(
+ it.key().toAscii().data(),
+ QString::number(it.value()["value"].toDouble()).toAscii().data());
+ }
+ Mlt::Producer p(*m_profile,s_url.toUtf8().data());
+ if (p.is_valid()) {
+ m_playlist->append(p);
+ m_playlist->attach(filter);
+ m_consumer= new Mlt::Consumer(*m_profile,"xml",destination.toUtf8().data());
+ m_consumer->set("all",1);
+ m_consumer->set("real_time",-2);
+ m_consumer->connect(*m_playlist);
+ m_stabilizeRun = QtConcurrent::run(this, &ClipStabilize::slotRunStabilize);
+ m_timer->start(500);
+ button_start->setEnabled(false);
+ }
+ }