Skip to content

DhruvWebDev/streaming

OpenMux - Open Source Alternative to Mux

OpenMux Banner

πŸš€ Introduction

OpenMux is an open-source alternative to Mux, providing a scalable and developer-friendly API for video encoding, streaming, and playback. Whether you're building a video-sharing platform, a live-streaming service, or an educational content platform, OpenMux gives you the tools you need without the vendor lock-in.

🌟 Features

  • πŸŽ₯ Video Upload & Encoding: Supports multiple formats and resolutions.
  • πŸ“‘ Live Streaming: RTMP ingest and HLS playback.
  • πŸ”₯ Adaptive Bitrate Streaming (ABR): Ensures smooth playback across devices.
  • πŸ—„οΈ Storage Integration: Works with AWS S3, Google Cloud Storage, and local storage.
  • πŸ“Š Analytics: Real-time video insights and engagement tracking.
  • πŸ›‘ Security: Token-based access control, watermarking, and DRM support.
  • πŸ›  Developer-Friendly API: RESTful API and Webhooks for seamless integration.
  • 🌐 Web3 Integration: NFT-based video access, decentralized storage (IPFS, Arweave), and crypto payments.

🎯 Roadmap

  • Add WebRTC support for ultra-low latency streaming.
  • Implement server-side ad insertion (SSAI).
  • Expand cloud provider integrations.
  • Develop a React-based video player component.
  • Web3 smart contract integration for NFT video access.
  • Support for decentralized storage (IPFS, Arweave).

πŸ— Installation

Prerequisites

  • Node.js (>=16.x)
  • PostgreSQL or MongoDB
  • FFmpeg (for video processing)
  • Docker (optional, for deployment)
  • MetaMask or WalletConnect (for Web3 integration)

Steps

  1. Clone the Repository:

    git clone https://github.com/yourusername/openmux.git
    cd openmux
  2. Install Dependencies:

    npm install
  3. Set Up Environment Variables:

    cp .env.example .env
    # Update the .env file with your configurations
  4. Run Migrations (for PostgreSQL users):

    npm run migrate
  5. Start the Server:

    npm start

πŸ“– API Documentation

Check out our full API docs at https://docs.openmux.io.

Example: Upload a Video

curl -X POST "https://api.openmux.io/videos" \
     -H "Authorization: Bearer YOUR_API_KEY" \
     -F "file=@video.mp4"

Example: Retrieve Video Details

curl -X GET "https://api.openmux.io/videos/{video_id}" \
     -H "Authorization: Bearer YOUR_API_KEY"

Web3 Example: Verify NFT Ownership for Video Access

const ethers = require("ethers");
const contractAddress = "0xYourContractAddress";
const abi = ["function ownerOf(uint256 tokenId) view returns (address)"];

async function checkOwnership(tokenId, userAddress) {
  const provider = new ethers.providers.JsonRpcProvider("https://your_rpc_url");
  const contract = new ethers.Contract(contractAddress, abi, provider);
  const owner = await contract.ownerOf(tokenId);
  return owner.toLowerCase() === userAddress.toLowerCase();
}

πŸ“¦ Deployment

Using Docker

docker-compose up -d

Deploying to Vercel (Frontend) & Render/Fly.io (Backend)

  1. Push your repo to GitHub.
  2. Connect your repo to Render or Fly.io for backend hosting.
  3. Deploy the frontend on Vercel or Netlify.

🀝 Contributing

We welcome contributions! Please read our CONTRIBUTING.md for guidelines.

πŸ“œ License

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

πŸŽ‰ Acknowledgments

🌍 Community & Support

About

open source alternative of mux with web3 integration

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •