Skip to content

Commit 6a5c02e

Browse files
authored
chore: removed ffmpeg statics deps
1 parent e0133ff commit 6a5c02e

21 files changed

+2642
-2413
lines changed

.github/workflows/.ci.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,20 @@ jobs:
1111
- name: Checkout Repository
1212
uses: actions/checkout@v3
1313

14+
- name: Install FFmpeg
15+
run: |
16+
sudo apt-get update
17+
sudo apt-get install -y ffmpeg
18+
ffmpeg -version
19+
ffprobe -version
20+
1421
- uses: pnpm/action-setup@v2
1522
with:
1623
version: 9
1724

1825
- uses: actions/setup-node@v3
1926
with:
20-
node-version: 18
27+
node-version: 22
2128
cache: 'pnpm'
2229

2330
- name: Install Dependencies
@@ -39,6 +46,12 @@ jobs:
3946
# - name: Checkout Repository
4047
# uses: actions/checkout@v3
4148

49+
# - name: Install FFmpeg
50+
# run: |
51+
# sudo apt-get update
52+
# sudo apt-get install -y ffmpeg
53+
# ffmpeg -version
54+
4255
# - uses: pnpm/action-setup@v2
4356
# with:
4457
# version: 9

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
41
pnpm lint-staged

.lintstagedrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"*.{ts,json,md,yml}": ["prettier --write"],
3-
"*.{ts}": ["pnpm lint", "pnpm test"]
3+
"**/*.ts": [
4+
"pnpm lint --fix",
5+
"pnpm run test:precommit --"
6+
]
47
}

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use-node-version=22.14.0

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Alexandre Mogère
3+
Copyright (c) 2025 Alexandre Mogère
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 101 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# FFmpeg Video Composer
22

3-
[![Node.js Version](https://img.shields.io/badge/node-%3E%3D18.x-brightgreen.svg)](https://nodejs.org/en/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
3+
[![Node.js Version](https://img.shields.io/badge/node-%3E%3D22.x-brightgreen.svg)](https://nodejs.org/en/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
44

55
`ffmpeg-video-composer` is a tool designed to streamline the process of video compilation and audio mixing using FFmpeg. It enables dynamic template generation, video rendering, and audio composition, making it a comprehensive solution for creating personalized multimedia content programmatically.
66

@@ -14,24 +14,67 @@ https://github.com/heristop/assets/6bcd0578-7dee-4630-aa6b-c730cf5cec17
1414

1515
## 🚀 Features
1616

17-
* Dynamic video and audio template generation
18-
* Easy video compilation and audio mixing using FFmpeg
19-
* Flexible JSON-based template descriptor system
20-
* CLI for quick video creation
21-
* JSON configuration for complex project setups
22-
* Custom project configurations support
23-
* Audio overlay and mixing capabilities
24-
* Automated video editing and composition
17+
- Dynamic video and audio template generation
18+
- Easy video compilation and audio mixing using FFmpeg
19+
- Flexible JSON-based template descriptor system
20+
- CLI for quick video creation
21+
- JSON configuration for complex project setups
22+
- Custom project configurations support
23+
- Audio overlay and mixing capabilities
24+
- Automated video editing and composition
2525

26-
## 🛠 Installation
26+
## ⚠️ Prerequisites
27+
28+
This tool requires **FFmpeg** to be installed on your system and available in your PATH. FFmpeg is used directly for all video and audio processing operations.
29+
30+
### FFmpeg Installation Guide
31+
32+
#### macOS
33+
34+
Using [Homebrew](https://brew.sh/):
35+
36+
```bash
37+
brew install ffmpeg
38+
```
39+
40+
#### Linux
41+
42+
For Debian/Ubuntu:
43+
44+
```bash
45+
sudo apt update && sudo apt install ffmpeg
46+
```
47+
48+
For Fedora:
49+
50+
```bash
51+
sudo dnf install ffmpeg
52+
```
53+
54+
For Arch Linux:
55+
56+
```bash
57+
sudo pacman -S ffmpeg
58+
```
59+
60+
#### Verify Installation
61+
62+
After installation, verify that FFmpeg is properly installed:
63+
64+
```bash
65+
ffmpeg -version
66+
ffprobe -version
67+
```
68+
69+
## 📦 Installation
2770

2871
### Using npm (or yarn/pnpm)
2972

3073
```bash
3174
pnpm add ffmpeg-video-composer
3275
```
3376

34-
### Cloning the Repository
77+
### Development Setup
3578

3679
```bash
3780
git clone https://github.com/heristop/ffmpeg-video-composer.git
@@ -101,7 +144,7 @@ pnpm test
101144
}
102145
}}%%
103146
104-
graph TB
147+
graph TD
105148
%% Style Definitions
106149
classDef core fill:#EDF7FF,stroke:#4B83B8,stroke-width:2px
107150
classDef abstract fill:#F9F3FF,stroke:#9D7AB8,stroke-width:2px,stroke-dasharray: 5 5
@@ -110,79 +153,67 @@ graph TB
110153
classDef builder fill:#FFE8E8,stroke:#E88B8B,stroke-width:2px
111154
classDef title fill:none,stroke:none
112155
113-
%% Entry Points and Director Pattern
114-
subgraph Flow ["🚀 Application Flow"]
115-
direction LR
116-
main[("main.ts")]:::entry -->
117-
index["index.ts"]:::entry
118-
119-
subgraph DirectorPattern ["👷 Builder Pattern Implementation"]
120-
direction TB
121-
director["TemplateDirector.ts"]:::builder
122-
template_builder["TemplateConcreteBuilder.ts"]:::builder
123-
director --> template_builder
124-
end
125-
126-
index --> director
156+
%% Entry Points
157+
subgraph Flow ["🚀 Application Entry"]
158+
direction TB
159+
main[("main.ts")]:::entry --> index["index.ts"]:::entry
127160
end
128161
129162
%% Core Domain
130-
subgraph Core ["💎 Core Domain"]
163+
subgraph Core ["💎 Domain Layer"]
131164
direction TB
132-
subgraph Models ["Domain Models"]
133-
direction TB
134-
models_title["Core Business Objects"]:::title
165+
subgraph CoreModels ["Domain Models"]
135166
core_project["Project.ts"]:::core
136167
core_segment["Segment.ts"]:::core
137168
core_template["Template.ts"]:::core
138169
end
139170
140-
subgraph Utils ["Core Utilities"]
141-
direction TB
142-
utils_title["Support Types & Config"]:::title
171+
subgraph CoreUtils ["Core Utilities"]
143172
core_types["types.ts"]:::core
144173
core_config["default.config.ts"]:::core
145-
core_format["FormatHelper.ts"]:::core
146174
end
147175
end
148176
177+
%% Director Pattern
178+
subgraph Builder ["👷 Builder Pattern"]
179+
direction TB
180+
director["TemplateDirector.ts"]:::builder
181+
template_builder["TemplateConcreteBuilder.ts"]:::builder
182+
end
183+
149184
%% Platform Layer
150185
subgraph Platform ["⚡ Platform Layer"]
151186
direction TB
152-
subgraph Abstractions ["Interface Definitions"]
153-
direction TB
154-
abstractions_title["Abstract Interfaces"]:::title
187+
subgraph PlatformCore ["Core Platform"]
188+
platform_bridge["PlatformBridge.ts"]:::implementation
189+
event_manager["EventManager.ts"]:::implementation
190+
end
191+
192+
subgraph Abstractions ["Interfaces"]
155193
abstract_ffmpeg["AbstractFFmpeg.ts"]:::abstract
156194
abstract_music["AbstractMusic.ts"]:::abstract
157195
abstract_fs["AbstractFilesystem.ts"]:::abstract
158196
abstract_logger["AbstractLogger.ts"]:::abstract
159197
end
160198
161-
subgraph Adapters ["Concrete Implementations"]
162-
direction TB
163-
adapters_title["Platform Adapters"]:::title
199+
subgraph Adapters ["Platform Adapters"]
164200
ffmpeg_node["FFmpegNodeAdapter.ts"]:::implementation
165201
music_node["MusicNodeAdapter.ts"]:::implementation
166202
fs_node["FilesystemNodeAdapter.ts"]:::implementation
167203
pino_adapter["PinoLogAdapter.ts"]:::implementation
168204
end
169-
170-
platform_bridge["PlatformBridge.ts"]:::implementation
171-
event_manager["EventManager.ts"]:::implementation
172205
end
173206
174207
%% Editor Components
175208
subgraph Editor ["🎥 Video Processing"]
176209
direction TB
177-
subgraph EditorCore ["Core Editor Components"]
178-
editor_title["Main Processing Units"]:::title
210+
subgraph EditorCore ["Core Processing"]
179211
video_editor["VideoEditor.ts"]:::implementation
180212
music_composer["MusicComposer.ts"]:::implementation
181213
segment_builder["SegmentBuilder.ts"]:::implementation
182214
end
183215
184-
subgraph VideoSegments ["Video Segment Types"]
185-
segments_title["Segment Implementations"]:::title
216+
subgraph Segments ["Video Segments"]
186217
segment_factory["SegmentFactory.ts"]:::implementation
187218
video_segment["VideoSegment.ts"]:::implementation
188219
color_bg_segment["ColorBackgroundSegment.ts"]:::implementation
@@ -194,39 +225,42 @@ graph TB
194225
%% Resource Management
195226
subgraph Resources ["📊 Resource Management"]
196227
direction TB
197-
resources_title["Resource Managers"]:::title
198228
asset_manager["AssetManager.ts"]:::implementation
199229
filter_manager["FilterManager.ts"]:::implementation
200230
formatter_manager["FormatterManager.ts"]:::implementation
201231
map_manager["MapManager.ts"]:::implementation
202232
var_manager["VariableManager.ts"]:::implementation
203233
end
204234
205-
%% Key Relationships
206-
director --> |"orchestrates"| event_manager
207-
director --> |"uses"| video_editor
208-
template_builder --> |"creates"| segment_builder
209-
template_builder --> |"uses"| segment_factory
235+
%% Main Flow
236+
index --> director
237+
director --> template_builder
238+
director --> video_editor
239+
director --> event_manager
210240
211-
segment_factory --> |"creates"| video_segment & color_bg_segment & image_bg_segment & project_video_segment
212-
video_segment & color_bg_segment & image_bg_segment & project_video_segment --> |"builds via"| segment_builder
241+
%% Builder Pattern Flow
242+
template_builder --> segment_builder
243+
template_builder --> segment_factory
213244
214-
video_editor --> |"uses"| music_composer
245+
%% Segment Creation Flow
246+
segment_factory --> video_segment & color_bg_segment & image_bg_segment & project_video_segment
247+
video_segment & color_bg_segment & image_bg_segment & project_video_segment --> segment_builder
215248
216-
%% Platform Implementation Relations
217-
platform_bridge --> |"implements"| ffmpeg_node & music_node & fs_node & pino_adapter
249+
%% Platform Relations
250+
platform_bridge --> ffmpeg_node & music_node & fs_node & pino_adapter
251+
ffmpeg_node --> abstract_ffmpeg
252+
music_node --> abstract_music
253+
fs_node --> abstract_fs
254+
pino_adapter --> abstract_logger
218255
219-
ffmpeg_node --> |"implements"| abstract_ffmpeg
220-
music_node --> |"implements"| abstract_music
221-
fs_node --> |"implements"| abstract_fs
222-
pino_adapter --> |"implements"| abstract_logger
256+
%% Resource Management
257+
segment_builder --> asset_manager & filter_manager & formatter_manager & map_manager & var_manager
223258
224-
%% Resource Management Relations
225-
segment_builder --> |"manages"| asset_manager & filter_manager & formatter_manager & map_manager & var_manager
259+
%% Core Dependencies
260+
core_project --> core_config & core_types
226261
227-
%% Core Relations
228-
core_project --> |"uses"| core_config
229-
core_project --> |"uses"| core_types
262+
%% Editor Flow
263+
video_editor --> music_composer
230264
231265
%% Link Styling
232266
linkStyle default stroke:#7C8D9D,stroke-width:1px

eslint.config.js

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,40 @@ import globals from 'globals';
88
export default [
99
js.configs.recommended,
1010
{
11-
files: ['**/*.ts', '**/*.tsx'],
11+
files: ['src/**/*.ts', 'tests/**/*.ts'],
1212
languageOptions: {
1313
parser: tsParser,
1414
parserOptions: {
1515
project: './tsconfig.json',
16+
ecmaVersion: 2020,
17+
sourceType: 'module'
1618
},
19+
globals: {
20+
...globals.node
21+
}
1722
},
1823
plugins: {
1924
'@typescript-eslint': tsPlugin,
20-
'prettier': prettierPlugin,
25+
prettier: prettierPlugin
2126
},
2227
rules: {
23-
...tsPlugin.configs.recommended.rules,
28+
...tsPlugin.configs['recommended'].rules,
2429
...prettierConfig.rules,
2530
'@typescript-eslint/dot-notation': 'error',
2631
'eol-last': 'error',
27-
'prettier/prettier': 'error',
28-
},
32+
'prettier/prettier': 'error'
33+
}
2934
},
3035
{
3136
files: ['**/*.test.ts', '**/*.spec.ts'],
3237
languageOptions: {
3338
globals: {
3439
...globals.jest,
35-
...globals.node,
36-
},
37-
},
40+
...globals.node
41+
}
42+
}
3843
},
3944
{
40-
ignores: ['eslint.config.js'],
41-
},
42-
];
45+
ignores: ['eslint.config.js', 'dist/**']
46+
}
47+
];

0 commit comments

Comments
 (0)