Skip to content

A serverless video processing service built with Go and deployed on AWS Lambda. Snipzy-Worker enables real-time video clipping and streaming from various video platforms using yt-dlp for video extraction and FFmpeg for processing

License

Notifications You must be signed in to change notification settings

MdSadiqMd/Snipzy-Worker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snipzy-Worker

A high-performance serverless video processing service built with Go and deployed on AWS Lambda. Snipzy-Worker enables real-time video clipping and streaming from various video platforms using yt-dlp for video extraction and FFmpeg for processing image

🚀 Features

  • Real-time Video Processing: Extract and process video clips on demand with streaming response
  • Multi-Platform Support: Download videos from YouTube and other platforms supported by yt-dlp[1]
  • Quality Control: Configurable video quality and format options
  • Streaming Response: Utilizes AWS Lambda response streaming for efficient video delivery[2][3]
  • Serverless Architecture: Fully serverless deployment with automatic scaling
  • Docker Containerization: Easy deployment with pre-configured FFmpeg and yt-dlp layers[1]
  • Platform Optimization: Built-in presets for different social media platforms

📋 Prerequisites

  • Go 1.23.3 or later[1]
  • AWS Account with Lambda access
  • Docker (for containerized deployment)
  • AWS CLI configured

🛠️ Installation & Deployment

Local Development

  1. Clone the repository

    git clone https://github.com/MdSadiqMd/Snipzy-Worker.git
    cd Snipzy-Worker
  2. Install Go dependencies

    go mod download
  3. Build the application

    go build -o bootstrap ./cmd/main.go

Docker Deployment

  1. Build the Docker image

    docker build -t snipzy-worker .
  2. Deploy using the provided script

    chmod +x deploy.sh
    ./deploy.sh

The Dockerfile includes optimized layers for FFmpeg and yt-dlp binaries, ensuring fast cold starts and efficient processing.

📡 API Usage

Request Format

Send a POST request to the Lambda function URL with the following JSON payload:

{
  "url": "https://www.youtube.com/watch?v=example",
  "start": 00:00:00,
  "end": 00:10:00,
  "platform": "youtube",
  "quality": "720p"
}

Response

The service streams the processed video directly as MP4 format with appropriate headers for download or playback.

🔧 Configuration

Environment Variables

Configure these environment variables for your Lambda function:

  • YTDLP_PATH: Path to yt-dlp binary (default: /opt/bin/yt-dlp)
  • FFMPEG_PATH: Path to FFmpeg binary (default: /opt/bin/ffmpeg)
  • TMP_DIR: Temporary directory for processing (default: /tmp)
  • MAX_DURATION: Maximum clip duration in seconds

Platform Presets

The service includes built-in optimization presets for popular platforms:

  • YouTube
  • TikTok
  • Instagram
  • Twitter
  • Default (general purpose)

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

About

A serverless video processing service built with Go and deployed on AWS Lambda. Snipzy-Worker enables real-time video clipping and streaming from various video platforms using yt-dlp for video extraction and FFmpeg for processing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published