Skip to content

Dzhud/Smoot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smoot: Automated Video Silence Removal

Smoot is a full-stack web application that automatically detects and removes silent segments from videos. Built for content creators who want to save time on video editing without sacrificing quality.

Overview

Smoot solves the content creator's editing problem by automating the tedious process of trimming silence from videos. Upload your video, configure silence detection parameters, and receive a trimmed video ready for publishing.

Features

  • Automatic silence detection based on configurable noise levels and duration thresholds
  • Asynchronous video processing with real-time progress updates
  • Support for concurrent video processing through job queue management
  • User authentication and authorization
  • Video management (upload, view, delete processed videos)
  • Real-time notifications via WebSocket connections
  • Scalable architecture built for growth

Technology Stack

Frontend

  • React.js for user interface
  • Tailwind CSS for styling
  • Socket.IO for real-time updates
  • Axios for API communication

Backend

  • Node.js runtime environment
  • Express.js for API framework
  • FFmpeg for video and audio processing
  • Redis and BullMQ for job queue management
  • MongoDB for persistent storage
  • Socket.IO for real-time server-to-client communication

Prerequisites

Before setting up Smoot, ensure you have the following installed:

  • Node.js (v14 or higher)
  • npm or yarn
  • MongoDB (local or MongoDB Atlas account)
  • Redis server (local or Redis Cloud account)
  • FFmpeg installed on your system

To install FFmpeg:

  • macOS: brew install ffmpeg
  • Ubuntu/Debian: sudo apt-get install ffmpeg
  • Windows: Download from ffmpeg.org or use choco install ffmpeg

Installation and Setup

Step 1: Clone the Repository

git clone https://github.com/Dzhud/smoot.git
cd smoot

Step 2: Backend Setup

Navigate to the backend directory and install dependencies:

cd backend
npm install

Create a .env file in the backend directory with the following variables:

MONGO_URI=your_mongo_uri
JWT_SECRET=your_jwt_secret_key_here
JWT_SECRET1=your_alternative_jwt_secret_here
NODE_ENV=development
PORT=5000
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=your_redis_password

Environment Variable Descriptions:

  • MONGO_URI: Connection string for MongoDB. Replace with your MongoDB Atlas connection string or local MongoDB URI
  • JWT_SECRET: Secret key for signing JWT tokens. Generate a strong random string
  • JWT_SECRET1: Alternative secret key for token operations
  • NODE_ENV: Set to 'development' for local development or 'production' for production environment
  • PORT: The port your backend server will run on (default is 5000)
  • REDIS_HOST: Hostname or IP address of your Redis server (127.0.0.1 for local)
  • REDIS_PORT: Port number for Redis server (default is 6379)
  • REDIS_PASSWORD: Password for Redis authentication if required (leave empty if no password)

Start the backend server:

npm start

You should see output like:

Server running on port 5000
Connected to MongoDB
Redis connection established

Step 3: Frontend Setup

In a new terminal, navigate to the frontend directory and install dependencies:

cd smoot
npm install

Create a .env file in the frontend directory (if needed):

REACT_APP_API_URL=http://localhost:5000
REACT_APP_SOCKET_URL=http://localhost:5000

Start the development server:

npm start

The application will open in your browser at http://localhost:3000

Running the Application

Once both backend and frontend servers are running:

  1. Open your browser and navigate to http://localhost:3000
  2. Sign up or log in with your credentials
  3. Upload a video file
  4. Configure silence detection parameters:
    • Noise Level (in decibels, range -90 to 0)
    • Silence Duration (in seconds, range 1 to 5)
  5. Click "Remove Silence" to start processing
  6. Monitor progress in real-time
  7. Download or view your processed video

Project Structure

smoot/
├── backend/
│   ├── config/
│   │   ├── db.js (MongoDB configuration)
│   │   └── socket.js (Socket.IO configuration)
│   ├── controllers/
│   │   ├── userController.js
│   │   └── videoController.js
│   ├── middleware/
│   │   └── authMiddleware.js
│   ├── models/
│   │   ├── User.js
│   │   └── Vid.js
│   ├── routes/
│   │   ├── userRoutes.js
│   │   └── vidRoutes.js
│   ├── workers/
│   │   └── videoWorkers.js
│   ├── queues/
│   │   └── videoQueue.js
│   ├── uploads/ (video storage)
│   └── server.js
├── smoot/ (frontend)
│   ├── public/
│   ├── src/
│   │   ├── components/
│   │   │   ├── process.jsx
│   │   │   ├── videoList.jsx
│   │   │   ├── middle.jsx
│   │   │   ├── dashboard.jsx
│   │   │   └── ...other components
│   │   ├── App.jsx
│   │   └── index.js
│   └── package.json
└── package.json (root)

API Endpoints

Authentication

  • POST /api/users/signup - Register new user
  • POST /api/users/login - User login
  • GET /api/users/me - Get current user profile

Video Management

  • POST /api/videos/upload - Upload and queue video for processing
  • GET /api/videos/:requestId - Get video details by request ID
  • GET /api/videos - Get all videos for authenticated user
  • PATCH /api/videos/:requestId - Update video metadata
  • DELETE /api/videos/:requestId - Delete a video

Environment Configuration

Local Development with Docker (Optional)

If you prefer to use Docker for Redis and MongoDB:

docker run --name smoot-redis -p 6379:6379 -d redis
docker run --name smoot-mongo -p 27017:27017 -d mongo

Then update your .env files accordingly.

Production Deployment

For production deployment, consider using:

  • MongoDB Atlas for managed database
  • Redis Cloud for managed Redis
  • Render, AWS Elastic Beanstalk, or DigitalOcean for hosting
  • AWS S3 or similar for video file storage

See the forthcoming deployment guide for detailed cloud setup instructions.

Troubleshooting

Redis Connection Issues

  • Verify Redis is running: redis-cli ping (should return PONG)
  • Check Redis credentials in .env file
  • Ensure Redis port is accessible

FFmpeg Not Found

  • Verify FFmpeg is installed: ffmpeg -version
  • Add FFmpeg to your system PATH if necessary

MongoDB Connection Failed

  • Verify MongoDB is running and accessible
  • Check connection string in .env file
  • Ensure IP whitelist includes your machine (for MongoDB Atlas)

Socket.IO Connection Issues

  • Verify backend server is running on configured PORT
  • Check CORS settings in backend configuration
  • Ensure frontend and backend URLs match in .env

Contributing

Contributions are welcome. Please fork the repository and submit pull requests for any improvements.

License

This project is open source and available under the MIT License.

Support

For issues, feature requests, or questions, please open an issue on the GitHub repository at https://github.com/Dzhud/smoot

Future Enhancements

  • Batch video processing
  • Custom silence detection presets
  • Processing time estimation
  • API access for third-party applications
  • Advanced features like automatic chapter markers

About

Web App that removes Silent segments of videos. It's powered by NodeJS, ReactJS, Redis, ffmpeg, and MongoDB

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages