feat: Background as video support

This commit is contained in:
2026-05-24 11:35:49 +05:30
parent be9093655d
commit b9ed8ffb4e
4 changed files with 349 additions and 49 deletions

View File

@@ -5,7 +5,7 @@ A fullscreen splash-screen wrapper for launching a game or app. It displays an i
## Features
1. Fullscreen, borderless splash screen with hidden cursor (SDL2)
2. Displays a supplied image via SDL2_image (fallback to black if load fails)
2. Displays a supplied image via SDL2_image or video via ffmpeg (fallback to black if load fails)
3. Launches the target executable and exits when it finishes
4. Hides on focus loss after the game starts or closes on **Esc**
@@ -16,6 +16,7 @@ A fullscreen splash-screen wrapper for launching a game or app. It displays an i
- pkg-config
- SDL2
- SDL2_image
- ffmpeg (libavformat, libavcodec, libswscale, libavutil)
## Install
@@ -28,7 +29,7 @@ makepkg -si
For other distributions, build and install manually:
```bash
# Build the binary in the project root
# Build the binary into build/
make
# Install system-wide (defaults to /usr/local)
@@ -49,16 +50,19 @@ make check
## Usage
```bash
gsplash <image_path> <game_executable> [game_arguments...]
gsplash <image_or_video_path> <game_executable> [game_arguments...]
```
Example:
```bash
gsplash assets/splash.jpg /path/to/game --fullscreen --profile=default
# Video splash (supported formats depend on ffmpeg build)
gsplash assets/splash.mp4 /path/to/game --fullscreen --profile=default
```
Gsplash allows you to configure how the image is displayed with 3 modes:
Gsplash allows you to configure how the image or video is displayed with 3 modes:
- `center` (default): letterbox
- `crop`: fill screen by cropping
@@ -67,7 +71,7 @@ Gsplash allows you to configure how the image is displayed with 3 modes:
You can set these by using the `-m` or `--mode` flag:
```bash
gsplash [--mode=stretch|center|crop] <image> <executable> [args...]
build/gsplash [--mode=stretch|center|crop] <background> <executable> [args...]
gsplash -m stretch|center|crop <image> <executable> [args...]
build/gsplash -m stretch|center|crop <background> <executable> [args...]
```