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

- 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
- Go 1.23.3 or later[1]
- AWS Account with Lambda access
- Docker (for containerized deployment)
- AWS CLI configured
-
Clone the repository
git clone https://github.com/MdSadiqMd/Snipzy-Worker.git cd Snipzy-Worker -
Install Go dependencies
go mod download
-
Build the application
go build -o bootstrap ./cmd/main.go
-
Build the Docker image
docker build -t snipzy-worker . -
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.
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"
}The service streams the processed video directly as MP4 format with appropriate headers for download or playback.
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
The service includes built-in optimization presets for popular platforms:
- YouTube
- TikTok
- Default (general purpose)
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request