🔥 A serverless AWS Lambda solution for video transcoding
‎
NOTE: AI has been used to generate README.md
dave9123
Check their projects out: Recall Me, Lenie, InstaQuote
Once you ship this you can't edit the description of the project, but you'll be able to add more devlogs and re-ship it as you add new features!
Comprehensive Documentation and Architectural Refinements
Today's focus has been on a complete overhaul of the project's documentation and a formalization of its architecture. The goal was to create a comprehensive guide that not only explains how to deploy the application but also details its internal workings, configuration, and API.
Key updates include:
Detailed How It Works Section: I've added a new section to the README.md
that provides a step-by-step walkthrough of the entire video processing pipeline—from the initial browser upload to the final, streamable asset. This clarifies the role of each component, including the dual S3 triggers and the content-addressable storage strategy.
*Configuration and API Documentation:*
Granular Deployment Guide: The deployment instructions have been significantly expanded and refined:
Enhanced Testing Information: The testing section has been updated to clarify the use of moto for mocking AWS services, making it easier for others to run the unit tests locally.
This comprehensive documentation effort makes the project significantly more accessible, maintainable, and easier for others to understand, use, and contribute to.
Refactoring for Scalability, Configurability, and New Features
Today's updates focus on making the transcoder more robust, configurable, and feature-rich. I've refactored key parts of the application to improve performance and maintainability, and I've added several new API endpoints to enhance its capabilities.
Here’s a summary of the key changes:
Configuration via Environment Variables:
I've externalized several settings into environment variables (GENERATE_DASH
, GENERATE_SUBTITLES
, THUMBNAIL_WIDTH
, LAMBDA_FUNCTION_URL
). This allows for greater flexibility in deploying and managing the application without requiring code changes.
Efficient Streaming with S3 Pre-signed URLs:
The /stream/
endpoint has been completely overhauled. Instead of proxying video data through the Lambda function, it now generates and redirects to a secure, time-limited S3 pre-signed URL. This offloads the bandwidth-intensive work to S3, resulting in a significant performance boost and cost savings.
Enhanced API and Asset Management:
DELETE /api/video/
endpoint has been added, allowing for the complete removal of a video and all its associated processed files./api/transcoding_status
endpoint provides a way to monitor jobs that are currently being processed.Improved Thumbnails:
In addition to the VTT sprites for timeline previews, the application now generates a high-quality primary thumbnail from the middle of the video, providing a better visual representation in the video gallery.
Devlog: June 21, 2025
Feature: Interactive Web Frontend and Direct S3 Uploads
This has been a significant update, transforming the Lambda Video Transcoder from a backend-only process into a full-fledged, interactive web application. I've introduced a Flask-based frontend, enabling users to upload videos directly through their browser and monitor the transcoding status in real-time.
Here’s a breakdown of the key enhancements:
Flask Web Interface: I've integrated a Flask application directly into the Lambda function. This is served via API Gateway, allowing for a user-facing web UI. A new index.html template provides a clean, modern interface for video uploads.
Robust Multipart Uploads: To handle large video files efficiently, the frontend now uses a multipart upload strategy. It communicates with the backend to obtain pre-signed URLs, allowing the browser to upload files directly and securely to S3 in chunks. This makes the upload process more resilient and performant.
Real-time Status Page: Users can now track the progress of their video processing via a dedicated status page. This page provides real-time updates on the transcoding and transcription jobs, showing the current status and, upon completion, providing access to the processed files.
API Gateway Integration: The lambda_handler has been updated to intelligently route requests. It can now differentiate between S3 trigger events (for backend processing) and HTTP requests from API Gateway (for the frontend), using serverless-wsgi to serve the Flask application.
Dockerfile and Documentation: The Dockerfile has been updated to include the new dependencies (Flask, serverless-wsgi) and the web templates. The README.md has also been extensively updated to reflect these new features and provide clear instructions for deployment.