Skip to content

Latest commit

ย 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“น Screen Recorder

A simple lite web screen recording application with real-time preview, time limits, and microphone control. Built with React (frontend) and FastAPI (backend).

โœจ Features

  • ๐ŸŽฅ Screen Recording - Capture your entire screen, specific window, or browser tab
  • ๐Ÿ“ฑ Real-time Preview - Floating preview window (like smartphone camera apps) showing exactly what you're recording
  • โฑ๏ธ Time Limits - Preset durations: 10s, 30s, 1min, 2min, 5min, or Unlimited
  • ๐ŸŽค Microphone Control - Toggle microphone on/off before recording
  • ๐Ÿ’พ Save & Download - Save recordings as WebM files or download locally
  • ๐ŸŽจ Modern UI - Beautiful gradient design with smooth animations
  • ๐Ÿ“Š Progress Tracking - Visual timer and progress bar during recording
  • ๐Ÿ”„ Auto-stop - Recording stops automatically when time limit is reached

๐Ÿ“‹ Prerequisites

  • Node.js (v14 or higher)
  • npm (v6 or higher)
  • Python (v3.8 or higher)
  • pip (Python package manager)

๐Ÿ› ๏ธ Installation

Clone the repository

git clone https://github.com/yourusername/screen-recorder.git
cd screen-recorder

Backend Setup (Python/FastAPI)

# Navigate to backend directory
cd backend

# Create virtual environment
python -m venv venv

# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On Mac/Linux:
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run the server
python main.py

The backend will run on http://localhost:8000

Frontend Setup (React)

# Open a new terminal and navigate to frontend directory
cd frontend

# Install dependencies
npm install

# Start the development server
npm start

The frontend will run on http://localhost:3000

๐Ÿ“ Project Structure

screen-recorder/
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ main.py              # FastAPI server
โ”‚   โ”œโ”€โ”€ requirements.txt     # Python dependencies
โ”‚   โ””โ”€โ”€ recordings/          # Saved recordings folder (auto-created)
โ”‚
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ public/
โ”‚   โ”‚   โ””โ”€โ”€ index.html       # HTML template
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ App.js           # Main React component
โ”‚   โ”‚   โ”œโ”€โ”€ App.css          # Styling
โ”‚   โ”‚   โ”œโ”€โ”€ index.js         # React entry point
โ”‚   โ”‚   โ””โ”€โ”€ index.css        # Global styles
โ”‚   โ””โ”€โ”€ package.json         # Node dependencies
โ”‚
โ””โ”€โ”€ README.md

๐ŸŽฏ How It Works

Recording Process

  1. Permission Request: When you click "Start Recording", the browser asks for permission to capture your screen/audio
  2. Screen Capture: The app uses navigator.mediaDevices.getDisplayMedia() to capture screen content
  3. Audio Capture: Optional microphone capture using getUserMedia()
  4. Stream Combination: Screen video and microphone audio are combined into a single MediaStream
  5. Recording: The MediaRecorder API records the stream in WebM format
  6. Real-time Preview: The same stream is displayed in a floating preview window
  7. Time Management: If a time limit is set, a timer tracks duration and auto-stops recording
  8. Save: Recorded chunks are combined into a Blob and sent to the backend or downloaded locally

Key Components

Frontend (React)

  • State Management: Uses React hooks (useState, useRef, useEffect)
  • MediaRecorder API: Handles recording functionality
  • Stream Management: Manages screen and audio streams
  • Floating Preview: Minimizable picture-in-picture style preview

Backend (FastAPI)

  • POST /save-recording: Receives video blobs and saves to disk
  • GET /download/{filename}: Serves recorded files
  • GET /recordings: Lists all saved recordings
  • CORS Enabled: Allows frontend to communicate with backend

๐ŸŽฎ Usage Guide

1. Select Recording Duration

Click on any time limit button:

  • 10s - 10 seconds
  • 30s - 30 seconds
  • 1 min - 60 seconds
  • 2 min - 120 seconds
  • 5 min - 300 seconds
  • Ilimitado - Unlimited (manual stop)

2. Configure Microphone

  • Toggle the microphone button to enable/disable audio recording
  • Green = Microphone ON
  • Red = Microphone OFF

3. Start Recording

  • Click "Iniciar Grabaciรณn" (Start Recording)
  • Select the screen/window/tab you want to record
  • Click "Share" or "Allow"

4. During Recording

  • Floating Preview Window: Shows exactly what's being recorded
  • Timer Display: Shows remaining time (if limit set)
  • Progress Bar: Visual indicator of recording progress
  • Recording Indicator: Red blinking dot shows recording is active
  • Minimize Preview: Click "โˆ’" to minimize preview to a small circle

5. Stop Recording

  • Auto-stop: Recording stops automatically when time limit is reached
  • Manual stop: Click "Detener Grabaciรณn" (Stop Recording)
  • Or close the screen sharing popup

6. Save Recording

  • After stopping, a preview of your recording appears
  • Click "Guardar Grabaciรณn" (Save Recording) to save to backend
  • Or click "Descargar WebM" to download locally

๐Ÿ”ง API Endpoints

Method Endpoint Description
POST /save-recording Save video recording
GET /download/{filename} Download specific recording
GET /recordings List all recordings

๐Ÿšข Deployment

Deploy to GitHub Pages (Frontend only)

cd frontend
npm install gh-pages --save-dev

Add to package.json:

{
  "homepage": "https://yourusername.github.io/screen-recorder",
  "scripts": {
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build"
  }
}

Deploy:

npm run deploy

Deploy Backend to Railway (Free)

  1. Push backend to GitHub repository
  2. Sign up at railway.app
  3. Click "New Project" โ†’ "Deploy from GitHub repo"
  4. Select your backend repository
  5. Railway auto-detects FastAPI and deploys

๐Ÿ› ๏ธ Troubleshooting

"Error: No se pudo acceder a la pantalla"

  • Ensure you're using HTTPS or localhost
  • Check browser permissions for screen capture
  • Try using Chrome, Edge, or Firefox (Safari has limitations)

Preview not showing

  • Check browser console for errors
  • Ensure camera/microphone permissions are granted
  • Try refreshing the page

Recording not saving

  • Verify backend server is running on port 8000
  • Check network tab for CORS errors
  • Ensure recordings folder has write permissions

Microphone not working

  • Check if microphone permission is granted
  • Try toggling the microphone button off and on
  • Check system audio settings

๐ŸŽจ Technologies Used

Frontend

  • React 18 - UI Framework
  • MediaRecorder API - Recording functionality
  • getDisplayMedia - Screen capture
  • CSS3 - Animations and styling

Backend

  • FastAPI - Web framework
  • Uvicorn - ASGI server
  • aiofiles - Async file operations

๐Ÿ“ Browser Support

Browser Screen Capture Audio Recording Preview
Chrome โœ… โœ… โœ…
Edge โœ… โœ… โœ…
Firefox โœ… โœ… โœ…
Safari โš ๏ธ Limited โœ… โš ๏ธ Limited

๐Ÿค Contributing

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

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details

๐Ÿ™ Acknowledgments

  • MediaRecorder API documentation
  • FastAPI framework
  • React community

๐ŸŽฏ Quick Start Commands

# Start Backend
cd backend
python -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows
pip install -r requirements.txt
python main.py

# Start Frontend (in another terminal)
cd frontend
npm install
npm start

# Open browser at http://localhost:3000

๐ŸŽฅ Demo Video

grabacion.1.webm

Made with โค๏ธ using React and FastAPI

About

A simple lite web screen recording application with real-time preview, time limits, and microphone control. Built with React (frontend) and FastAPI (backend).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages