Convert Figma logo to code with AI

anyrtcIO-Community logoanyRTC-RTMP-OpenSource

RTMP 推流器,RTMP(HLS)秒开播放器,直播点播,跨平台(Win,IOS,Android)开源代码

4,683
1,608
4,683
72

Top Related Projects

13,642

Pure Go implementation of the WebRTC API

WebRTC Media Server

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.

[ARCHIVED] Contents migrated to monorepo: https://github.com/Kurento/kurento

Quick Overview

The anyRTC-RTMP-OpenSource project is an open-source RTMP (Real-Time Messaging Protocol) server implementation that allows developers to build real-time video and audio streaming applications. It is part of the anyRTC-Community project, which provides a suite of tools and libraries for building real-time communication (RTC) applications.

Pros

  • Cross-Platform Compatibility: The project supports multiple platforms, including Windows, macOS, and Linux, making it accessible to a wide range of developers.
  • Scalable and Efficient: The server is designed to be scalable and efficient, handling a large number of concurrent connections without compromising performance.
  • Customizable: The project provides a modular architecture, allowing developers to customize and extend the server's functionality to fit their specific needs.
  • Active Community: The anyRTC-Community project has an active community of contributors and users, providing support, bug fixes, and feature enhancements.

Cons

  • Limited Documentation: The project's documentation could be more comprehensive, making it challenging for new users to get started quickly.
  • Dependency on Third-Party Libraries: The project relies on several third-party libraries, which may introduce additional complexity and potential compatibility issues.
  • Lack of Detailed Benchmarking: The project does not provide detailed benchmarking information, making it difficult to assess its performance characteristics compared to other RTMP server implementations.
  • Potential Licensing Concerns: The project's licensing terms may need to be carefully reviewed, as they could impact the use of the server in certain commercial or enterprise-level applications.

Code Examples

Here are a few code examples demonstrating the usage of the anyRTC-RTMP-OpenSource project:

  1. Initializing the RTMP Server:
#include "RTMPServer.h"

int main() {
    RTMPServer server;
    server.Init("0.0.0.0", 1935);
    server.Start();
    // Server is now running and accepting RTMP connections
    return 0;
}
  1. Handling RTMP Client Connections:
class MyRTMPHandler : public RTMPHandler {
public:
    virtual void OnConnect(RTMPSession* session) override {
        // Handle client connection
    }

    virtual void OnDisconnect(RTMPSession* session) override {
        // Handle client disconnection
    }

    virtual void OnPublish(RTMPSession* session, const std::string& streamName) override {
        // Handle client publishing a stream
    }

    virtual void OnPlay(RTMPSession* session, const std::string& streamName) override {
        // Handle client playing a stream
    }
};

int main() {
    RTMPServer server;
    server.SetRTMPHandler(std::make_unique<MyRTMPHandler>());
    server.Init("0.0.0.0", 1935);
    server.Start();
    return 0;
}
  1. Integrating with a Media Server:
#include "RTMPServer.h"
#include "MediaServer.h"

int main() {
    RTMPServer rtmpServer;
    MediaServer mediaServer;

    rtmpServer.SetRTMPHandler(std::make_unique<MyRTMPHandler>());
    rtmpServer.Init("0.0.0.0", 1935);

    mediaServer.Init("0.0.0.0", 8080);
    mediaServer.SetRTMPServer(&rtmpServer);

    rtmpServer.Start();
    mediaServer.Start();

    // Server is now running and accepting both RTMP and HTTP connections
    return 0;
}

Getting Started

To get started with the anyRTC-RTMP-OpenSource project, follow these steps:

  1. Clone the repository:
git clone https://github.com/anyrtcIO-Community/anyRTC-RTMP-OpenSource.git
  1. Build the project:
    • On Windows, open the solution file in Visual Studio and build the project.
    • On macOS or Linux, navigate to the project directory and run the following commands:

Competitor Comparisons

13,642

Pure Go implementation of the WebRTC API

Pros of pion/webrtc

  • Extensive documentation and community support
  • Actively maintained with frequent updates
  • Supports a wide range of WebRTC features and functionality

Cons of pion/webrtc

  • Potentially more complex to set up and configure compared to anyRTC-RTMP-OpenSource
  • May have a steeper learning curve for developers new to WebRTC

Code Comparison

anyRTC-RTMP-OpenSource:

func (s *Server) Start() error {
    s.listener, err = net.Listen("tcp", s.Addr)
    if err != nil {
        return err
    }
    defer s.listener.Close()

    for {
        conn, err := s.listener.Accept()
        if err != nil {
            return err
        }
        go s.handleConnection(conn)
    }
}

pion/webrtc:

func main() {
    // Create a new RTCPeerConnection
    peerConnection, err := webrtc.NewPeerConnection(webrtc.Configuration{})
    if err != nil {
        panic(err)
    }

    // Add a track
    track, err := peerConnection.NewTrack(webrtc.DefaultPayloadTypeVP8, rand.Uint32(), "video", "pion")
    if err != nil {
        panic(err)
    }
    _, err = peerConnection.AddTrack(track)
    if err != nil {
        panic(err)
    }
}

WebRTC Media Server

Pros of medooze/media-server

  • Supports a wide range of media protocols, including SIP, WebRTC, and RTMP
  • Highly scalable and can handle a large number of concurrent connections
  • Provides a comprehensive set of features for media processing and management

Cons of medooze/media-server

  • Steeper learning curve compared to anyRTC-RTMP-OpenSource
  • Requires more system resources to run, which may not be suitable for smaller deployments
  • Limited documentation and community support compared to some other media server projects

Code Comparison

anyRTC-RTMP-OpenSource

int main(int argc, char* argv[]) {
    // Initialize the RTMP server
    CRtmpServer rtmpServer;
    rtmpServer.Initialize();

    // Start the server
    rtmpServer.Start();

    // Wait for the server to stop
    rtmpServer.WaitForStop();

    return 0;
}

media-server

int main(int argc, char* argv[]) {
    // Create a new media server instance
    MediaServer server;

    // Configure the server
    server.setLogLevel(LOG_DEBUG);
    server.setRTPPortRange(10000, 10100);

    // Start the server
    server.start();

    // Wait for the server to stop
    server.join();

    return 0;
}
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

  • SRS is a more mature and widely-used project, with a larger community and more contributors.
  • SRS has a more comprehensive set of features, including support for various streaming protocols and codecs.
  • SRS has better documentation and more active development.

Cons of SRS

  • SRS may have a steeper learning curve, especially for beginners.
  • SRS may be more complex and resource-intensive, depending on the specific use case.
  • SRS may have a larger codebase, which could make it more difficult to customize or extend.

Code Comparison

Here's a brief comparison of the code structure between the two projects:

anyRTC-RTMP-OpenSource

int main(int argc, char* argv[]) {
    // Initialize the server
    ARTCServer server;
    server.Init();

    // Start the server
    server.Start();

    // Wait for the server to stop
    server.Wait();

    return 0;
}

SRS

int main(int argc, char* argv[]) {
    // Parse the command line arguments
    SrsConfDirective* conf = _srs_config->parse_argv(argc, argv);

    // Initialize the server
    SrsServer server;
    server.initialize(conf);

    // Run the server
    server.run();

    return 0;
}

Both projects have a similar structure, with a main() function that initializes and runs the server. However, SRS has a more complex configuration system, with the ability to parse command-line arguments and load a configuration file.

[ARCHIVED] Contents migrated to monorepo: https://github.com/Kurento/kurento

Pros of Kurento/kurento-media-server

  • Supports a wide range of media processing capabilities, including video and audio processing, recording, and streaming.
  • Provides a modular and extensible architecture, allowing developers to easily integrate custom media processing modules.
  • Offers a WebRTC-based communication protocol, enabling real-time, low-latency media exchange.

Cons of Kurento/kurento-media-server

  • Relatively complex setup and configuration compared to anyRTC-RTMP-OpenSource, which may require more technical expertise.
  • Larger codebase and dependencies, which can result in a higher resource footprint and potential performance impact.
  • Limited support for RTMP-based streaming, which is a key feature of anyRTC-RTMP-OpenSource.

Code Comparison

Kurento/kurento-media-server (WebRTC-based media processing):

MediaPipeline pipeline = kurento.createMediaPipeline();
WebRtcEndpoint webRtcEp = new WebRtcEndpoint.Builder(pipeline).build();
webRtcEp.connect(webRtcEp);

anyRTC-RTMP-OpenSource (RTMP-based streaming):

RTMPPublisher* publisher = new RTMPPublisher();
publisher->Init("rtmp://localhost/live/stream");
publisher->PushVideoFrame(frame);
publisher->PushAudioFrame(audio);

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

anyLive

anyLive 是 anyRTC 开源的推拉流项目。采用跨平台架构设计(采用WebRTC(93)版本为基础框架),一套代码支持Android、iOS、Windows、Mac、Ubuntu等平台。

功能特性

类型功能说明
风格统一C++核心库代码风格采用:Google code style
框架WebRTC-93
协议rtmp、http/https、rtsp、hls、m3u8、mkv、mp3、mp4等
布局自定义SDK 和 UI 分离,可以自定义添加视频UI层
滤镜支持基于GPUImage美颜滤镜,可自定义滤镜
帧图视频第一帧、视频帧截图功能
播放单例播放、多个同时播放、视频列表滑动自动播放、列表切换详情页面无缝播放
自采集/自渲染可自定义音视频采集层和渲染层,方便接入第三方美颜、美声等
推流不限制用户的推流、拉流地址
图片推流支持特殊场景下关闭摄像头,图片进行推流
屏幕共享支持屏幕共享
SEI支持自定义信息的发送与接收
音量检测支持音量大小检测提示
镜像支持本地预览镜像以及编码镜像
编解码器H264/H265/Opus/AAC/G.711

平台兼容

系统编译环境CPU架构
Android 4.4及以上Android Studio、NDKarmeabi-v7a、arm64-v8a
iOS 9.0及以上Xcode14arm64
Windows 7及以上VS2015,VS2017x86、x86-64

第三方库

  • libfaac 1.28
  • libfaad2 2.7
  • ffmpeg 4.3
  • libsrtp
  • libvpx
  • pffft
  • rapidjson
  • usrsctplib
  • libyuv newest
  • openh264 1.6.0

配套规划

  • 支持 P2P-CDN 播放,为用户节省开支
  • 加入连麦功能
  • 美颜美型贴纸库
  • 低延迟直播推拉流

技术支持

anyRTC官方网址:https://www.anyrtc.io QQ技术交流群:554714720(已满) 2群:698167259 联系电话:021-65650071-816 Email:hi@dync.cc

技术问题:开发者论坛

加微信入技术群交流:

版权声明

若本开源项目涉及到其他软件的版权,请及时联系作者进行修正。

捐赠

本项目不接受任何形式的捐赠,您的支持就是最大的动力。

License

anyLive is available under the GNU license. See the LICENSE file for more info.

mailto:hi@dync.cc)