https://github.com/protik111/video-upload-service
A video upload service optimized the video file by ffmpeg tool.
https://github.com/protik111/video-upload-service
cloudinary docker-compose express-js ffmpeg nodejs posgresql prisma reactjs redis typescript videojs
Last synced: 4 months ago
JSON representation
A video upload service optimized the video file by ffmpeg tool.
- Host: GitHub
- URL: https://github.com/protik111/video-upload-service
- Owner: Protik111
- Created: 2024-07-12T11:05:17.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-30T06:48:02.000Z (over 1 year ago)
- Last Synced: 2025-01-23T10:29:08.861Z (over 1 year ago)
- Topics: cloudinary, docker-compose, express-js, ffmpeg, nodejs, posgresql, prisma, reactjs, redis, typescript, videojs
- Language: TypeScript
- Homepage:
- Size: 85.5 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Video Upload Service
This service allows users to upload videos, convert them into HLS format, and add a watermark before storing them in a cloud storage solution like Cloudinary. The service also provides an API to fetch and play these videos.
## HLD

# HLD Video
[Watch the demo video](./videos/demo.mp4)
## Features
- **Video Upload**: Uploads videos and converts them into HLS format with segment files (`.ts`) and a playlist file (`.m3u8`).
- **Watermarking**: Adds a dynamic, animated watermark (e.g., an email) to the video.
- **Cloud Storage**: Uploads the HLS files to Cloudinary for easy access and streaming.
- **Video Playback**: Provides an API to retrieve the video for playback in a React application.
## Installation
1. Clone the repository:
```bash
git clone https://github.com/Protik111/video-upload-service.git
```
2. Install Dependencies for API server:
```bash
yarn install
```
3. Install Dependencies for client (After changing directory to client):
```bash
yarn install
```
4. Create a `.env` file in the root directory with the following variables:
```env
NODE_ENV=development
PORT=5000
DATABASE_URL=""
JWT_SECRET=''
JWT_REFRESH_SECRET=''
JWT_EXPIRES_IN=1d
JWT_REFRESH_EXPIRES_IN=365d
VIDEO_COMPRESSED_DIR='http://localhost:5000/uploads/compressed'
CLOUDINARY_CLOUD_NAME=''
CLOUDINARY_API_KEY=''
CLOUDINARY_API_SECRET=''
REDIS_URL='redis://localhost:6379'
REDIS_EXPIRATION_TIME=846000
```
## Usage Example
- **React Frontend**: Use the provided HLS URL to play the video in a React application using the hls.js library.
## Dependencies
- **TypeScript**
- **Node.js**
- **Express.js**
- **Prisma**
- **Cloudinary**
- **Multer**
- **FFMPEG**
- **REDIS**
- **Video.js**