The CodeBeats project is a video generator that combines images and audio to create relaxing videos for study and relaxation. It also includes a functionality to generate custom thumbnails for the generated videos. The project uses libraries such as fluent-ffmpeg
, sharp
, and canvas
for media manipulation.
.
├── src
│ ├── index.ts # Main application file
│ ├── thumbnail.ts # Script for thumbnail generation
│ ├── utils.ts # Utilities and decorators like 'benchmark'
│ └── video.ts # VideoUtils class with video manipulation functions
├── assets
│ ├── audios # Directory containing audio files
│ ├── images # Directory containing images
│ ├── output # Directory for generated video files
│ ├── fonts # Directory containing fonts for thumbnails
│ └── thumbs # Directory for generated thumbnails
├── dist # Output directory for built files
├── package.json
└── README.md # This file
- Video Generation: Combines an image with audio files to create videos.
- Video Concatenation: Joins multiple video files into a single file.
- Thumbnail Generation: Creates custom thumbnails for the generated videos.
- Image Optimization: Resizes and compresses thumbnails for optimization.
- Node.js
- Bun.sh (optional, but recommended for faster execution and build)
- FFmpeg (required for video manipulation)
-
Clone the repository:
git clone <REPOSITORY_URL> cd codebeats
-
Install dependencies:
npm install # or, if using bun bun install
-
To start the main application:
npm start # or, if using bun bun run src/index.ts
-
To generate thumbnails:
npm run thumb # or, if using bun bun run src/thumbnail.ts
-
To build the application:
npm run build # or, if using bun bun build src/index.ts --minify --outdir dist --target=node
-
To build the thumbnail generator:
npm run build:thumb # or, if using tsup tsup src/thumbnail.ts --minify
src/index.ts
: Entry point of the application that generates the videos.src/thumbnail.ts
: Script to generate thumbnails for the videos.src/utils.ts
: Utilities and helper functions.src/video.ts
:VideoUtils
class containing methods for video manipulation.assets/audios
: Contains the audio files to be used in the videos.assets/images
: Contains the images to be used in the videos.assets/output
: Directory where the generated videos will be saved.assets/fonts
: Contains the fonts used to generate the thumbnails.assets/thumbs
: Directory where the generated thumbnails will be saved.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request