How voylinsgamedevjourney/gozen works
Project Type and Purpose
• GoZen is a desktop video editing application built on the Godot game engine.
• It integrates a custom GDExtension (C++) module to wrap FFmpeg for video/audio decoding, encoding, and rendering.
• Its goal is to provide a minimalist, performant NLE (non-linear editor) with a clean UI and cross-platform support (Linux, Windows, AppImage).
File Structure
• Top-level:
• build.py & libs/ – Python scripts and SCons files to fetch dependencies and build FFmpeg + GDExtension plugin.
• src/ – Godot project folder, containing scenes/, scripts/, shaders/, theming/, translations/, assets/.
• .github/ – CI workflows for building packages on Linux, Windows, RPM, DEB, AppImage.
• src/components:
• scenes/ – UI scenes (editor, timeline, menus, popups, render screen, audio meter).
• scripts/ – GDScript classes: UI widgets, data models (project_data, clip_data, settings_data), managers (file_manager, render_manager, input_manager, threader, thumbnailer).
• gozen.gdextension – metadata linking Godot to the compiled C++ extension.
• assets/, shaders/, theming/, translations/ – static resources loaded at runtime.
README Insights
• Build process: run build.py in libs/ to compile FFmpeg and GDExtension, then open the Godot project.
• Dependencies: Python, git-svn, SCons for Linux builds; C++ toolchain for GDExtension.
• Architecture hint: Godot+GDExtension boundary for performance-critical FFmpeg tasks.
Main Components
a. UI Layer (Godot Scenes & GDScripts)
• Media Pool, Timeline, Render Screen, Settings Menu, Audio Meter, Effects Panel, etc.
• GDScript “classes” and “globals” that drive UI behavior and state (e.g., project_manager, input_manager, popup_manager).
b. Core Engine (Godot)
• The host runtime that loads scenes, scripts, assets, and the GDExtension.
c. GDExtension Module (C++ / libs/gde_gozen)
• C++ code wrapping FFmpeg APIs (gozen_encoder, gozen_audio, gozen_video).
• Exposed to Godot via gdextension symbols (register_types.cpp).
d. External Libraries
• FFmpeg (libavcodec, libavformat, libavfilter, etc.) compiled via the build scripts.
e. Data Layer & Managers
• FileManager (I/O), ProjectManager (session), RenderManager (invoke encoding), Threader (multithreading), Thumbnailer.
f. File System & OS
• Local disk I/O for loading media files, writing export outputs.
• Python build scripts, SCons, GitHub Actions workflows.
Relationships & Data Flows
• User → Godot UI (scene) interactions trigger GDScripts → invoke Managers (e.g., file_manager.load(), render_manager.start_render()).
• Managers call GDExtension API functions → FFmpeg decodes/encodes frames → data buffers flow back to Godot for display or to disk for export.
• Threader manages background jobs for decoding, rendering, thumbnail generation.
• Localization, theming, and assets are loaded by Godot at startup.
Architectural Patterns & Principles
• MVC-like separation: Scenes (Views) + GDScript classes/data models (Models) + Managers (Controllers).
• Plugin architecture: core in Godot, performance layer in C++ GDExtension.
• Multithreaded processing for keep-UI responsive.
• Resource-driven: external .tres, .cfg, .gdshader files for profiles, themes, shaders.
Technologies & Frameworks
• Godot Engine (v4.x)
• GDExtension (native C++)
• FFmpeg libraries (LGPL/GPL)
• Python + SCons for build automation
• GitHub Actions for CI and packaging
• XCF, TRES, GDScript, GDSHADER, localization .po files