progress on ffmpeg fitlers

This commit is contained in:
itsmattkc
2018-08-16 20:32:16 +10:00
parent efa628e88f
commit 90b803b0b0
5 changed files with 30 additions and 4 deletions
+4
View File
@@ -150,6 +150,10 @@ void Effect::process_audio(uint8_t*, int) {}
EffectRow::EffectRow(Effect *parent, QGridLayout *uilayout, const QString &n, int row) : parent_effect(parent), ui(uilayout), name(n), ui_row(row) {
ui->addWidget(new QLabel(name), row, 0);
/*keyframe_enable = new CheckboxEx();
keyframe_enable->setToolTip("Enable Keyframes");
ui->addWidget(keyframe_enable, row, 5);*/
}
EffectField* EffectRow::add_field(int type, int colspan) {
+5
View File
@@ -13,6 +13,7 @@ struct Clip;
class QXmlStreamReader;
class QXmlStreamWriter;
class Effect;
class CheckboxEx;
#define EFFECT_TYPE_INVALID 0
#define EFFECT_TYPE_VIDEO 1
@@ -98,6 +99,8 @@ private:
QString name;
int ui_row;
QVector<EffectField*> fields;
CheckboxEx* keyframe_enable;
};
class Effect : public QObject {
@@ -128,6 +131,8 @@ public:
bool enable_pre_gl;
bool enable_post_gl;
const char* ffmpeg_filter;
virtual void process_gl(int* anchor_x, int* anchor_y);
virtual void post_gl();
virtual void process_audio(quint8* samples, int nb_bytes);
+2
View File
@@ -9,6 +9,8 @@
#include <QXmlStreamAttributes>
InvertEffect::InvertEffect(Clip* c) : Effect(c, EFFECT_TYPE_VIDEO, VIDEO_INVERT_EFFECT) {
enable_ffmpeg = true;
ffmpeg_filter = "negate";
EffectRow* amount_row = add_row("Amount:");
amount_val = amount_row->add_field(EFFECT_FIELD_DOUBLE);
+13 -3
View File
@@ -414,14 +414,24 @@ void open_clip_worker(Clip* clip) {
inputs->pad_idx = 0;
inputs->next = 0;
ret = avfilter_graph_parse_ptr(clip->filter_graph, "null", &inputs, &outputs, NULL);
/*ret = avfilter_graph_config(clip->filter_graph, NULL);
if (ret < 0) {
qDebug() << "[ERROR] Couldn't set NEGATE filter";
qDebug() << "[ERROR] AVFilter config failed";
}*/
ret = avfilter_graph_parse_ptr(clip->filter_graph, "gblur=sigma=20:steps=4", &inputs, &outputs, NULL);
if (ret < 0) {
qDebug() << "[ERROR] Couldn't parse filters." << ret;
} else {
ret = avfilter_graph_config(clip->filter_graph, NULL);
if (ret < 0) {
qDebug() << "[ERROR] AVFilter config failed";
qDebug() << "[ERROR] AVFilter config failed." << ret;
}
/*ret = avfilter_graph_send_command(clip->filter_graph, "gblur", "enable", "2", NULL, 0, 0);
if (ret < 0) {
qDebug() << "[ERROR] Failed to send graph command." << ret << AVERROR(ENOSYS);
}*/
}
}
}
+6 -1
View File
@@ -34,6 +34,10 @@ QUndoStack undo_stack;
#define TA_MODIFY_TRANSITION 11
#define TA_DELETE_TRANSITION 12
extern "C" {
#include "libavfilter/avfilter.h"
}
TimelineAction::TimelineAction() :
done(false),
change_seq(false),
@@ -423,7 +427,8 @@ void TimelineAction::redo() {
{
Clip* c = sequences.at(i)->get_clip(clips.at(i));
old_values[i] = c->effects.size();
c->effects.append(create_effect(new_values.at(i), c));
Effect* e = create_effect(new_values.at(i), c);
c->effects.append(e);
}
break;
case TA_ADD_TRANSITION: