Convert Figma logo to code with AI

medooze logomedia-server

WebRTC Media Server

1,342
296
1,342
10

Top Related Projects

Jitsi Videobridge is a WebRTC compatible video router or SFU that lets build highly scalable video conferencing infrastructure (i.e., up to hundreds of conferences per server).

Janus WebRTC Server

Cutting Edge WebRTC Video Conferencing

13,642

Pure Go implementation of the WebRTC API

9,473

End-to-end stack for WebRTC. SFU media server and SDKs.

25,534

SRS is a simple, high-efficiency, real-time media server supporting RTMP, WebRTC, HLS, HTTP-FLV, HTTP-TS, SRT, MPEG-DASH, and GB28181.

Quick Overview

Medooze Media Server is an open-source WebRTC media server written in C++. It provides a high-performance, scalable solution for building real-time communication applications, supporting various media processing features such as SFU (Selective Forwarding Unit) and MCU (Multipoint Control Unit) functionalities.

Pros

  • High performance and low latency, suitable for large-scale deployments
  • Supports both SFU and MCU modes, offering flexibility in media routing and processing
  • Extensive feature set, including simulcast, SVC, and RTCP feedback mechanisms
  • Active development and community support

Cons

  • Steep learning curve due to its low-level C++ implementation
  • Limited documentation compared to some other WebRTC solutions
  • Requires significant system resources for optimal performance
  • May be overkill for simple WebRTC applications

Code Examples

  1. Creating a MediaServer instance:
#include "mediaserver.h"

int main() {
    MediaServer* server = MediaServer::Create();
    // Use the server instance
    MediaServer::Destroy(server);
    return 0;
}
  1. Setting up an endpoint:
Endpoint* endpoint = server->CreateEndpoint(ip);
endpoint->Init();
  1. Creating and starting a WebRTCTransport:
Properties properties;
properties.SetProperty("bundle", true);
properties.SetProperty("rtcpMux", true);

WebRTCTransport* transport = endpoint->CreateWebRTCTransport(properties);
transport->Start();
  1. Adding an incoming stream to the transport:
RTPIncomingSourceGroup* audio = transport->GetIncomingSourceGroup(MediaFrame::Audio);
RTPIncomingSourceGroup* video = transport->GetIncomingSourceGroup(MediaFrame::Video);

transport->AddIncomingSourceGroup(audio);
transport->AddIncomingSourceGroup(video);

Getting Started

To get started with Medooze Media Server:

  1. Clone the repository:

    git clone https://github.com/medooze/media-server.git
    
  2. Install dependencies (on Ubuntu):

    sudo apt-get install libssl-dev libsrtp2-dev libnice-dev libopus-dev libvpx-dev
    
  3. Build the project:

    cd media-server
    mkdir build && cd build
    cmake ..
    make
    
  4. Include the necessary headers and link against the built library in your project.

  5. Create a MediaServer instance and start building your WebRTC application using the provided APIs.

Competitor Comparisons

Jitsi Videobridge is a WebRTC compatible video router or SFU that lets build highly scalable video conferencing infrastructure (i.e., up to hundreds of conferences per server).

Pros of Jitsi-videobridge

  • More mature and widely adopted project with a larger community
  • Supports advanced features like simulcast and bandwidth estimation
  • Integrates well with other Jitsi components for a complete conferencing solution

Cons of Jitsi-videobridge

  • Higher resource consumption, especially for large-scale deployments
  • More complex setup and configuration process
  • Less flexible for custom implementations outside the Jitsi ecosystem

Code Comparison

Jitsi-videobridge (Java):

public class VideoChannel extends RtpChannel {
    private final List<RtpEncoder> rtpEncoders = new ArrayList<>();
    private final List<RtpDecoder> rtpDecoders = new ArrayList<>();
    // ...
}

Media-server (C++):

class VideoStream : public RTPStream {
    std::vector<RTPEncoder*> encoders;
    std::vector<RTPDecoder*> decoders;
    // ...
};

Both projects use similar concepts for handling video streams, but Media-server's C++ implementation may offer better performance in some scenarios. Jitsi-videobridge's Java codebase might be more accessible to a wider range of developers.

While Jitsi-videobridge provides a more comprehensive solution for video conferencing, Media-server offers a lightweight and flexible alternative that can be easily integrated into custom applications. The choice between the two depends on specific project requirements and scalability needs.

Janus WebRTC Server

Pros of Janus-gateway

  • More extensive plugin architecture, allowing for greater flexibility and customization
  • Supports a wider range of protocols, including WebRTC, SIP, RTMP, and more
  • Larger community and more active development, with frequent updates and contributions

Cons of Janus-gateway

  • Higher resource consumption due to its more comprehensive feature set
  • Steeper learning curve for beginners due to its complexity and extensive configuration options
  • Can be more challenging to deploy and scale in certain environments

Code Comparison

Janus-gateway (C):

janus_plugin *create(void) {
    janus_plugin *plugin = (janus_plugin *)calloc(1, sizeof(janus_plugin));
    plugin->init = janus_echotest_init;
    plugin->destroy = janus_echotest_destroy;
    plugin->handle_message = janus_echotest_handle_message;
    return plugin;
}

Media-server (C++):

MediaServer::MediaServer()
{
    //Create tcp listeners
    listeners.emplace_back(new TCPListener(this,port));
    //Create muxer
    muxer = new RTPBundleMuxer();
}

Both projects are open-source media servers, but Janus-gateway offers more flexibility and protocol support, while Media-server focuses on simplicity and performance. The code snippets demonstrate Janus-gateway's plugin-based architecture and Media-server's more straightforward approach to server initialization.

Cutting Edge WebRTC Video Conferencing

Pros of mediasoup

  • Written in modern C++ and Node.js, offering better performance and scalability
  • Supports WebRTC and ORTC, providing more flexibility for different use cases
  • Active development with frequent updates and a responsive community

Cons of mediasoup

  • Steeper learning curve due to its modular architecture
  • Requires more setup and configuration compared to media-server

Code Comparison

mediasoup (JavaScript):

const mediasoup = require('mediasoup');
const worker = await mediasoup.createWorker();
const router = await worker.createRouter({ mediaCodecs });
const transport = await router.createWebRtcTransport(webRtcTransportOptions);

media-server (C++):

MediaServer server;
Properties properties;
server.Start(properties);
WebRTCEndpoint* endpoint = server.CreateWebRTCEndpoint();

mediasoup uses a more modular approach with separate workers and routers, while media-server has a more straightforward setup. mediasoup's code is more verbose but offers finer control over the media pipeline.

Both projects are robust WebRTC solutions, but mediasoup is more modern and flexible, while media-server might be easier to get started with for simpler use cases. The choice between them depends on specific project requirements and developer expertise.

13,642

Pure Go implementation of the WebRTC API

Pros of webrtc

  • Written in Go, offering better concurrency and easier deployment
  • More active community with frequent updates and contributions
  • Extensive documentation and examples for easier integration

Cons of webrtc

  • Less mature and potentially less stable than media-server
  • May have fewer advanced features for complex media processing scenarios

Code Comparison

media-server (C++):

RTPIncomingMediaStream* stream = session->CreateIncomingStream();
stream->AddMediaListener(this);
stream->Start();

webrtc (Go):

peerConnection, err := webrtc.NewPeerConnection(webrtc.Configuration{})
if err != nil {
    log.Fatal(err)
}

Key Differences

  • Language: media-server uses C++, while webrtc is written in Go
  • API Design: media-server has a more low-level API, whereas webrtc provides a higher-level abstraction
  • Performance: C++ may offer better raw performance, but Go provides easier concurrency management
  • Community: webrtc has a larger and more active community, potentially leading to faster development and issue resolution

Use Cases

  • media-server: Ideal for projects requiring fine-grained control and maximum performance
  • webrtc: Better suited for projects prioritizing ease of use, rapid development, and cross-platform compatibility
9,473

End-to-end stack for WebRTC. SFU media server and SDKs.

Pros of LiveKit

  • More active development with frequent updates and releases
  • Comprehensive documentation and examples for easier integration
  • Built-in support for advanced features like simulcast and SFU

Cons of LiveKit

  • Higher resource consumption due to its feature-rich nature
  • Steeper learning curve for developers new to WebRTC

Code Comparison

LiveKit (Go):

room, err := server.CreateRoom(&livekit.CreateRoomRequest{
    Name: "my-room",
})

Media Server (C++):

auto room = MediaServer::CreateRoom("my-room");

Key Differences

  • LiveKit is written in Go, while Media Server is primarily in C++
  • LiveKit offers a more comprehensive API with built-in room management
  • Media Server provides lower-level control but requires more manual configuration

Use Cases

  • LiveKit: Ideal for projects requiring quick deployment and scalability
  • Media Server: Better suited for custom, performance-critical applications

Both projects are open-source and actively maintained, with LiveKit having a larger community and more frequent updates. The choice between them depends on specific project requirements, development expertise, and desired level of control over the WebRTC infrastructure.

25,534

SRS is a simple, high-efficiency, real-time media server supporting RTMP, WebRTC, HLS, HTTP-FLV, HTTP-TS, SRT, MPEG-DASH, and GB28181.

Pros of SRS

  • More comprehensive documentation and examples
  • Broader protocol support (RTMP, HLS, WebRTC, etc.)
  • Active community and frequent updates

Cons of SRS

  • Higher resource consumption
  • Steeper learning curve for beginners
  • Less focus on WebRTC compared to media-server

Code Comparison

SRS (C++):

SrsRtcConnection::SrsRtcConnection(SrsRtcServer* s, const SrsContextId& cid)
{
    server = s;
    cid_ = cid;
    req = NULL;
    sendonly_skt = NULL;
    // ... (additional initialization)
}

media-server (C++):

MediaServer::MediaServer()
{
    loop = Loop::Create();
    dtls = DTLSConnection::Create(loop);
    // ... (additional initialization)
}

Both projects use C++ for their core implementations. SRS tends to have more extensive class structures and initialization processes, while media-server appears to have a more compact codebase. SRS focuses on a wider range of protocols, which is reflected in its more complex setup, whereas media-server is more specialized for WebRTC and related technologies.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

media-server-unit-tests

media-server

WebRTC Media Server

Documentation coming soon, major refactoring ongoing. Stay tuned!

Usage

This repository is currently a host for the base media code used in different projects. While it may take a while to propertly encapsulate it and define reusable components to create a proper SDK, you can use the following native wrappers:

Functionality

We intend to implement support the following features:

Support

To discuss issues related to this project or ask for help please join the google comunity group.

Contributing

To get started, sign the Contributor License Agreement.

License

Dual: