Giter Site home page Giter Site logo

droncogene / chrome-ext-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 165 KB

An api for storing, merging, fetching and transcribing (using OpenAI whisper API) video recorded in chunks by a chrome extension

Home Page: http://chrome-ext-api.droncogene.com/docs

Python 77.14% Shell 10.38% HTML 1.64% JavaScript 10.85%
chrome chrome-extension docker fastapi ffmpeg mediarecorder-api mongodb openai python3 rabbitm

chrome-ext-api's Introduction

HNGX Stage 5 task

Description

A backend api for a chrome extension that functions as a screen recorder. The api processes and stored the video files.

Technologies

  • Python 3.11
  • FastAPI
  • Pymongo
  • mongodb on docker
  • poetry or pip for dependency management

Installation

  • Clone the repo
  • Install poetry
  • Run poetry install to install dependencies
  • Run poetry shell to activate the virtual environment
  • Or use pip to install dependencies from requirements.txt: pip install -r requirements.txt
  • Set environment variables: see .env.example
  • Spin up a mongodb instance on docker: docker run -d -p 27017:27017 --name mongodb mongo:latest
  • Spin up rabbitmq instance on docker: docker run -d -p 5672:5672 -p 15672:15672 -p 15692:15692 --name rabbitmq rabbitmq:latest
  • Both rabbitmq and mongodb can also be installed manually without docker
  • Install ffmpeg: sudo apt install ffmpeg, version 4.4.2 was used for this project
  • Check here for instructions on installing ffmpeg on windows
  • Run python3 main.py to start the server
  • In separate terminals, run:
    • Run python3 merger.py to start the video merger service
    • Run python3 transribe.py to start the video transcription service
  • You can run multiple instances (workers) of the merger and transcription services to speed up the video processing

Endpoints

  • POST /upload/new: Start recording a new video

    • Request body:
    {
      file_type: str
    }
    
    • Response:
    {
      status_code: int,
      message: str,
      data: {
        file_id: str
      }
    }
    
  • POST /upload/chunks: Upload a chunk of the video

    • Request body: formData with fields:
    {
      file_id: str,
      chunk: Blob,
      is_final: boolean
      chunk_num: int
    }
    
    • Response:
    {
      status_code: int,
      message: str,
      data: null
    }
    
  • GET /videos/{file_id}: Get a video

    • Response: Video file

Enjoy!

chrome-ext-api's People

Contributors

droncogene avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.