Skip to content

Commit 05d2f8a

Browse files
Eliot GOURDOUXEliot GOURDOUX
authored andcommitted
fix: sharpen filter with merge requiere for the PR (Resolves #101)
2 parents 52ca1b6 + 3a79425 commit 05d2f8a

File tree

11 files changed

+160
-44
lines changed

11 files changed

+160
-44
lines changed

.github/workflows/ci-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
run: echo "VCPKG_ROOT=$HOME/vcpkg" >> $GITHUB_ENV
2323

2424
- name: Install dependencies
25-
run: sudo apt-get update && sudo apt-get install -y build-essential cmake python3-dev ffmpeg libopencv-dev g++-13 gcc-13
25+
run: sudo apt-get update && sudo apt-get install -y build-essential cmake python3-dev ffmpeg libopencv-dev libcurl4-openssl-dev g++-13 gcc-13
2626

2727
- name: Set CXX environment variable
2828
run: |

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ __pycache__/
2424
*.pyc
2525

2626

27-
# direnv
27+
# Direnv
2828
.envrc
2929
.direnv/
3030

@@ -36,16 +36,16 @@ venv/
3636
build/
3737
vcpkg*
3838

39-
# dependencies
39+
# Dependencies
4040
include/argparse/
4141

42-
# executables
42+
# Executables
4343
video-code
4444

45-
# mac
45+
# Mac
4646
.DS_Store
4747

48-
# misc
48+
# Misc
4949
wherewasi
5050
todo
5151
pgn

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ endif()
5858

5959
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${CMAKE_SOURCE_DIR}/vcpkg_installed/${VCPKG_TARGET_TRIPLET}")
6060

61-
if(NOT DEFINED ENV{Qt6_DIR})
62-
set(Qt6_DIR "/usr/include/qt6/6.8.2/gcc_64/lib/cmake/Qt6")
63-
endif()
64-
6561
if(CI_BUILD)
6662
message(STATUS "CI_BUILD is defined")
6763
include(FetchContent)

Makefile

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,18 @@
99

1010
BINARY_NAME = video-code
1111
BUILD_DIR = build
12-
VCPKG_FLAGS = \
12+
DOCKER_IMG_NAME = ubuntu-lts-img
13+
VCPKG_VOLUME = video_code_vcpkg_cache
14+
15+
CMAKE_FLAGS = -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
16+
VCPKG_FLAGS = \
1317
-DCMAKE_TOOLCHAIN_FILE=$$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake \
1418
-DVCPKG_INSTALLED_DIR=$(PWD)/vcpkg_installed \
1519
-DWITH_FFMPEG=ON
1620

1721
DEBUG_FLAG = -DDEBUG=ON
1822

23+
1924
# >>> Rules <<<
2025

2126
.PHONY: all
@@ -24,16 +29,16 @@ all: cmake
2429

2530
.PHONY: cmake
2631
cmake:
27-
cmake -B $(BUILD_DIR) $(VCPKG_FLAGS) > /dev/null
28-
$(MAKE) -C $(BUILD_DIR)
32+
cmake -B $(BUILD_DIR) $(VCPKG_FLAGS) $(CMAKE_FLAGS)
33+
cmake --build $(BUILD_DIR)
2934
@ cp -f $(BUILD_DIR)/$(BINARY_NAME) .
3035
@ cp -f $(BUILD_DIR)/compile_commands.json .
3136

3237

3338
.PHONY: debug
3439
debug:
35-
cmake -B $(BUILD_DIR) $(DEBUG_FLAG) $(VCPKG_FLAGS) > /dev/null
36-
$(MAKE) -C $(BUILD_DIR)
40+
cmake -B $(BUILD_DIR) $(DEBUG_FLAG) $(VCPKG_FLAGS) $(CMAKE_FLAGS)
41+
cmake --build $(BUILD_DIR)
3742
cp $(BUILD_DIR)/$(BINARY_NAME) .
3843

3944

@@ -45,6 +50,7 @@ clean:
4550
.PHONY: fclean
4651
fclean: clean
4752
@ $(RM) -r $(BUILD_DIR)
53+
@ $(RM) -r vcpkg_installed
4854
@ $(RM) $(BINARY_NAME)
4955

5056

@@ -69,3 +75,13 @@ docvid:
6975
.PHONY: docdoc
7076
docdoc:
7177
./docs/readme/generate.sh
78+
79+
80+
# Doesn't work
81+
.PHONY: docker
82+
docker:
83+
$(MAKE) fclean
84+
docker build -t $(DOCKER_IMG_NAME) .
85+
docker run --rm -it \
86+
-v "$(PWD):/work" \
87+
$(DOCKER_IMG_NAME)

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,3 @@ To install the project, checkout the [documentation](docs/user/user.md#installat
161161
- `feature`: frames are not kept in memory anymore, they are generated on the fly. (01/01/2026)
162162

163163
</details>
164-

docs/beta_test_plan.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# BETA TEST PLAN
2+
3+
**FROM AN IDEA TO A PRODUCT**
4+
5+
**Project name:** Video-Code
6+
**Repository:** [https://github.com/anpawo/Video-Code](https://github.com/anpawo/Video-Code)
7+
8+
---
9+
10+
## 1. Project Context, Objectives & Functioning
11+
12+
Video-Code est une bibliothèque open-source permettant de **générer, éditer et monter des vidéos à partir de code Python**.
13+
Le projet vise à combiner la **puissance du scripting** avec la **précision du montage vidéo**, tout en restant accessible aux débutants et flexible pour les utilisateurs avancés.
14+
15+
La version beta se concentre sur :
16+
17+
* Une **API Python fonctionnelle**
18+
* Des **composants vidéo de base**
19+
* Des **transformations et effets simples**
20+
* Un **rendu vidéo fiable via FFmpeg**
21+
22+
Le fonctionnement repose sur :
23+
24+
1. L’écriture d’un script Python utilisant l’API Video-Code
25+
2. La création d’inputs (texte, image, vidéo, formes)
26+
3. L’application de transformations
27+
4. L’ajout des éléments à une timeline
28+
5. La génération finale d’une vidéo exportée
29+
30+
---
31+
32+
## 2. User Roles
33+
34+
| User Role ID | User Role Name | Description |
35+
| ------------ | ---------------- | ------------------------------------------------------------------------ |
36+
| UR-01 | Python Developer | Utilisateur à l’aise avec Python souhaitant créer des vidéos via du code |
37+
| UR-02 | Content Creator | Créateur de contenu cherchant à automatiser et personnaliser ses vidéos |
38+
| UR-03 | Technical User | Utilisateur avancé testant les performances et la modularité du moteur |
39+
40+
---
41+
42+
## 3. Feature Table (Organized by User Flow)
43+
44+
| Feature ID | User Role | Feature Name | Short Description |
45+
| ---------- | ------------ | --------------------- | ----------------------------------------------------- |
46+
| F-01 | UR-01, UR-03 | Write video script | Écrire un script Python utilisant l’API Video-Code |
47+
| F-02 | UR-01, UR-02 | Create media input | Concréer des inputs vidéo, image ou texte |
48+
| F-03 | UR-01, UR-02 | Add input to timeline | Ajouter un input à la timeline de la vidéo |
49+
| F-04 | UR-01, UR-02 | Apply transformation | Appliquer une transformation (move, scale, fade…) |
50+
| F-05 | UR-01 | Group inputs | Grouper plusieurs inputs pour les manipuler ensemble |
51+
| F-06 | UR-01, UR-03 | Preview rendering | Visualiser le rendu intermédiaire lors de l’exécution |
52+
| F-07 | UR-01, UR-02 | Generate video file | Générer une vidéo finale via FFmpeg |
53+
| F-08 | UR-03 | Serialize project | Sérialiser la scène vidéo pour réutilisation |
54+
55+
---
56+
57+
## 4. Success Criteria Table
58+
59+
| Feature ID | Key Success Criteria | Indicator / Metric | Result Achieved |
60+
| ---------- | ------------------------------------------------- | ------------------------------ | ------------------ |
61+
| F-01 | Le script Python s’exécute sans erreur | 10 exécutions, 0 crash | Achieved |
62+
| F-02 | Les inputs sont visibles dans la vidéo | 10 créations, 0 input manquant | Achieved |
63+
| F-03 | Les inputs apparaissent au bon moment | Décalage temporel < 1 frame | Achieved |
64+
| F-04 | Les transformations sont correctement appliquées | 10 transformations testées | Achieved |
65+
| F-05 | Les groupes se comportent comme une entité unique | 5 groupes testés | Partially achieved |
66+
| F-06 | Le rendu intermédiaire est exploitable | Affichage < 1s/frame | Partially achieved |
67+
| F-07 | La vidéo finale est générée correctement | 5 rendus complets, 0 échec | Achieved |
68+
| F-08 | La scène peut être sauvegardée et rechargée | 3 cycles save/load | Achieved |
69+
70+
---
71+
72+
## 5. Beta Scope Validation
73+
74+
Cette beta inclut uniquement les **fonctionnalités réellement implémentées et démontrables** lors de la soutenance :
75+
76+
* API Python fonctionnelle
77+
* Inputs médias et texte
78+
* Transformations de base
79+
* Timeline et rendu vidéo
80+
* Export FFmpeg
81+
82+
Les fonctionnalités suivantes **ne font pas partie de la beta** :
83+
84+
* Interface graphique complète
85+
* Extension VS Code
86+
* Interface no-code
87+
* Système de plugins communautaires
88+
89+
---
90+
91+
## 6. Expected Outcome
92+
93+
Ce Beta Test Plan permet de :
94+
95+
* Valider que Video-Code offre une **expérience utilisateur complète minimale**
96+
* Démontrer la **stabilité technique du moteur**
97+
* Fournir une base solide pour l’intégration des retours utilisateurs
98+
* Justifier la transition vers les prochaines phases du projet
99+
100+
Ce document servira de **référence officielle pour le jury Greenlight** afin d’évaluer la maturité et la crédibilité de la version beta.

docs/beta_test_plan.pdf

99.6 KB
Binary file not shown.

include/input/Metadata.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,15 @@ struct v2
1818
v2(T x, T y)
1919
: x(x)
2020
, y(y)
21-
, w(this->x)
22-
, h(this->y)
2321
{
2422
}
2523

2624
T x;
2725
T y;
2826

29-
T& w;
30-
T& h;
27+
T w() { return x; };
28+
29+
T h() { return y; };
3130

3231
friend std::ostream& operator<<(std::ostream& os, const v2& v)
3332
{
@@ -43,7 +42,7 @@ using v2f = v2<float>;
4342
namespace config
4443
{
4544
inline v2f screen{1920.0f, 1080.0f};
46-
inline v2f screenOffset{screen.w / 2.0f, screen.h / 2.0f};
45+
inline v2f screenOffset{screen.w() / 2.0f, screen.h() / 2.0f};
4746
};
4847

4948
struct Metadata

vcpkg.json

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
{
2-
"name": "video-code",
3-
"version-string": "1.0.0",
4-
"dependencies": [
5-
"opencv4",
6-
{
7-
"name": "qtbase",
8-
"default-features": false,
9-
"features": ["gui", "widgets", "opengl"]
10-
},
11-
"nlohmann-json",
12-
"argparse",
13-
"ffmpeg",
14-
"protobuf",
15-
"cpr"
16-
]
2+
"name": "video-code",
3+
"version-string": "1.0.0",
4+
"dependencies": [
5+
"opencv4",
6+
{
7+
"name": "qtbase",
8+
"default-features": false,
9+
"features": ["gui", "widgets", "opengl"]
10+
},
11+
{
12+
"name": "qtbase",
13+
"features": ["xcb"],
14+
"platform": "linux"
15+
},
16+
"nlohmann-json",
17+
"argparse",
18+
"ffmpeg",
19+
"protobuf",
20+
"curl"
21+
]
1722
}

video.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
from videocode.videocode import *
55

66
# Display the same image three times: left light sharpen, center original, right strong sharpen
7-
img_soft_sharpen = image("../test.png").position(x=-4, y=0).scale(0.5).apply(blur(300), duration=2)
7+
img_soft_sharpen = image("../test.png").position(x=-4, y=0).scale(0.5).apply(sharpen(0.3), duration=2)
88

99
img_center = image("../test.png").position(x=0, y=0).scale(0.5)
1010

11-
img_strong_sharpen = image("../test.png").position(x=4, y=0).scale(0.5).apply(brightness(-50.0), duration=2)
11+
img_strong_sharpen = image("../test.png").position(x=4, y=0).scale(0.5).apply(sharpen(1.0), duration=2)

0 commit comments

Comments
 (0)