Skip to content

Commit ece6889

Browse files
committed
Add movit.overlay_blend video filter
1 parent 4f61269 commit ece6889

4 files changed

Lines changed: 78 additions & 2 deletions

File tree

src/modules/movit/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ add_library(mltmovit MODULE
1111
filter_movit_lift_gamma_gain.cpp
1212
filter_movit_mirror.cpp
1313
filter_movit_opacity.cpp
14+
filter_movit_overlay_mode.cpp
1415
filter_movit_rect.cpp
1516
filter_movit_resample.cpp
1617
filter_movit_resize.cpp
@@ -64,6 +65,7 @@ install(FILES
6465
filter_movit_lift_gamma_gain.yml
6566
filter_movit_mirror.yml
6667
filter_movit_opacity.yml
68+
filter_movit_overlay_mode.yml
6769
filter_movit_rect.yml
6870
filter_movit_resample.yml
6971
filter_movit_resize.yml

src/modules/movit/factory.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2013-2022 Dan Dennedy <dan@dennedy.org>
2+
* Copyright (C) 2013-2026 Meltytech, LLC
33
* factory.c -- the factory method interfaces
44
*
55
* This program is free software; you can redistribute it and/or modify
@@ -19,8 +19,8 @@
1919

2020
#include "mltmovit_export.h"
2121
#include <framework/mlt.h>
22-
#include <limits.h>
2322
#include <string.h>
23+
2424
extern mlt_consumer consumer_xgl_init(mlt_profile profile,
2525
mlt_service_type type,
2626
const char *id,
@@ -69,6 +69,10 @@ extern mlt_filter filter_movit_opacity_init(mlt_profile profile,
6969
mlt_service_type type,
7070
const char *id,
7171
char *arg);
72+
extern mlt_filter filter_movit_overlay_mode_init(mlt_profile profile,
73+
mlt_service_type type,
74+
const char *id,
75+
char *arg);
7276
extern mlt_filter filter_movit_rect_init(mlt_profile profile,
7377
mlt_service_type type,
7478
const char *id,
@@ -129,6 +133,7 @@ MLTMOVIT_EXPORT MLT_REPOSITORY
129133
MLT_REGISTER(mlt_service_filter_type, "movit.lift_gamma_gain", filter_lift_gamma_gain_init);
130134
MLT_REGISTER(mlt_service_filter_type, "movit.mirror", filter_movit_mirror_init);
131135
MLT_REGISTER(mlt_service_filter_type, "movit.opacity", filter_movit_opacity_init);
136+
MLT_REGISTER(mlt_service_filter_type, "movit.overlay_mode", filter_movit_overlay_mode_init);
132137
MLT_REGISTER(mlt_service_filter_type, "movit.rect", filter_movit_rect_init);
133138
MLT_REGISTER(mlt_service_filter_type, "movit.resample", filter_movit_resample_init);
134139
MLT_REGISTER(mlt_service_filter_type, "movit.resize", filter_movit_resize_init);
@@ -172,6 +177,10 @@ MLTMOVIT_EXPORT MLT_REPOSITORY
172177
"movit.opacity",
173178
metadata,
174179
"filter_movit_opacity.yml");
180+
MLT_REGISTER_METADATA(mlt_service_filter_type,
181+
"movit.overlay_mode",
182+
metadata,
183+
"filter_movit_overlay_mode.yml");
175184
MLT_REGISTER_METADATA(mlt_service_filter_type, "movit.rect", metadata, "filter_movit_rect.yml");
176185
MLT_REGISTER_METADATA(mlt_service_filter_type,
177186
"movit.resample",
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* filter_movit_overlay_mode.cpp
3+
* Copyright (C) 2026 Meltytech, LLC
4+
*
5+
* This program is free software; you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation; either version 2 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18+
*/
19+
20+
#include <framework/mlt.h>
21+
#include <stdlib.h>
22+
23+
static mlt_frame process(mlt_filter filter, mlt_frame frame)
24+
{
25+
mlt_properties_set(MLT_FRAME_PROPERTIES(frame),
26+
"movit.overlay.compositing",
27+
mlt_properties_get(MLT_FILTER_PROPERTIES(filter), "mode"));
28+
return frame;
29+
}
30+
31+
extern "C" mlt_filter filter_movit_overlay_mode_init(mlt_profile profile,
32+
mlt_service_type type,
33+
const char *id,
34+
char *arg)
35+
{
36+
mlt_filter filter = mlt_filter_new();
37+
if (filter) {
38+
filter->process = process;
39+
mlt_properties_set(MLT_FILTER_PROPERTIES(filter), "mode", arg ? arg : "0");
40+
}
41+
return filter;
42+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
schema_version: 7.0
2+
type: filter
3+
identifier: movit.overlay_mode
4+
title: Movit Overlay Mode
5+
version: 1
6+
copyright: Meltytech, LLC
7+
creator: Dan Dennedy
8+
license: GPLv2
9+
language: en
10+
tags:
11+
- Video
12+
description: Change the blend mode used by the movit.overlay transition.
13+
14+
parameters:
15+
- identifier: mode
16+
argument: yes
17+
title: Blend mode
18+
type: integer
19+
description: >
20+
This filter can be used to change the blend mode for a single clip
21+
when using the movit.overlay transition to composite tracks.
22+
default: 0
23+
widget: combo

0 commit comments

Comments
 (0)