Video Transcoder

Video Transcoder Used AI

7 devlogs
19h 3m

🔥 A serverless AWS Lambda solution for video transcoding
‎
NOTE: AI has been used to generate README.md

Timeline

Ship 2

1 payout of shell 15.0 shells

Varun Agnihotri

about 1 month ago

Varun Agnihotri • Covers 1 devlog and 1h 7m
  • Finalized project.
  • Enhance video processing: add checks for existing processing status and improve user alerts in the frontend
Update attachment

Ship 1

1 payout of shell 96.0 shells

Varun Agnihotri

about 2 months ago

Varun Agnihotri • Covers 6 devlogs and 17h 56m
  • Final minor fixes in UI.
Update attachment

Devlog: June 23, 2025

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:*

    • Configuration Table: All environment variables are now documented in a clear table, explaining their purpose and default values.
    • API Endpoints Table: The REST API is now fully documented, with a table listing all endpoints, their HTTP methods, and descriptions.
  • Granular Deployment Guide: The deployment instructions have been significantly expanded and refined:

    • IAM & CORS: Added explicit JSON examples for the required IAM policies and S3 CORS configuration.
    • Lambda Function URL: The guide now centers on using a Lambda Function URL for direct access, which simplifies the architecture by removing the need for API Gateway.
    • Dual S3 Triggers: The instructions now detail the setup for two separate S3 triggers—one for new uploads and another to handle asynchronous results from services like Amazon Transcribe, preventing processing loops.
  • 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.

Update attachment

Devlog: June 22, 2025

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:

    • Decoupled IDs: The application now uses a redirect system to map the original video filename to a unique, content-based processing ID (its MD5 hash). This makes the API more stable and decouples it from the original filename.
    • DELETE Endpoint: A new DELETE /api/video/ endpoint has been added, allowing for the complete removal of a video and all its associated processed files.
    • In-Progress Status: A new /api/transcoding_status endpoint provides a way to monitor jobs that are currently being processed.
    • Automated Cleanup: The application now automatically deletes temporary audio files from S3 after transcription is complete, helping to keep storage costs down.
  • 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.

Update attachment
  • Completed the Web UI functionality.
Update attachment

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.

Update attachment
  • Completed the initial version of the function.
  • Testing pending.
Update attachment