百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

live-streaming-server-net

> 云原生
开源

一个基于 .NET 的 RTMP 直播服务器实现,支持 HTTP-FLV、WebSocket-FLV、HLS、Kubernetes、云存储服务集成等。

330 stars0 点赞4 次浏览
访问官网GitHub

工具介绍

一个基于 .NET 的 RTMP 直播服务器实现,支持 HTTP-FLV、WebSocket-FLV、HLS、Kubernetes、云存储服务集成等。

Live-Streaming-Server-Net

Live-Streaming-Server-Net is a high-performance and flexible toolset that allows you to build your own live streaming server using .NET.

Please check the documentation and code wiki for more details.

Features

  • RTMP/RTMPS protocol: Supports the RTMP and RTMPS protocols for streaming audio, video, and data.
  • RTMP Relay: Supports relaying RTMP streams between servers, allowing building a scalable RTMP server cluster.
  • RTMP Client: Provides a client library for connecting to RTMP servers and publishing/subscribing live streams.
  • HTTP-FLV/WebSocket-FLV with ASP.NET CORE: Provides support for serving FLV live streams using HTTP-FLV and WebSocket-FLV protocols within an ASP.NET Core application.
  • Transmuxing RTMP streams into HLS streams: Allows you to transmux RTMP streams into HLS (HTTP Live Streaming) streams using the built-in HLS transmuxer.
  • Transcoding RTMP streams into Adaptive HLS streams: Integrates with FFmpeg to transcode RTMP streams into multiple-bitrate Adaptive HLS streams.
  • Integration with FFmpeg: Provides support for processing the incoming RTMP stream with FFmpeg, for example, to create an MP4 archive.
  • GOP caching: Supports caching the Group of Pictures (GOP) to ensure immediate availability of live streaming content.
  • Custom authorization: Enables you to implement custom authorization mechanisms for accessing live streams.
  • Admin panel: Includes an admin panel that provides an user interface for managing and monitoring the live streaming server.
  • Cloud Storage Integration: Enabling real-time uploading of HLS files to cloud storage services like Azure Blob Storage, Google Cloud Storage, and AWS S3, which ensures scalable and efficient HLS stream distribution through CDN.
  • Realtime HLS Subtitle Transcription: Integrates with Azure AI Speech to provide real-time transcription of HLS streams, automatically generating WebVTT subtitle files.
  • Codecs: Supports AVC/H.264, HEVC/H.265, AAC, and MP3 codecs.

In-Progress

  • Custom Kubernetes Operator and Kubernetes Integration: The objective is to achieve horizontal autoscaling by scaling out the pods when more streams are published, and scaling in the pods when streams are deleted, all without affecting the existing connections.
  • Redis Integration: Integrate with Redis to share stream information among pods in the fleet.

Quick Start

Run the RTMP Server

Create a .NET 8 console application project and add the dependencies

dotnet new console
dotnet add package LiveStreamingServerNet
dotnet add package Microsoft.Extensions.Logging.Console

Program.cs

cs
using LiveStreamingServerNet;
using Microsoft.Extensions.Logging;
using System.Net;

using var server = LiveStreamingServerBuilder.Create()
    .ConfigureLogging(options => options.AddConsole())
    .Build();

await server.RunAsync(new IPEndPoint(IPAddress.Any, 1935));

Run the application

dotnet run

Publish a Live Stream

With FFmpeg

Use the following command to publish a video as the live stream using FFmpeg

ffmpeg -re -i  -c:v libx264 -c:a aac -f flv rtmp://localhost:1935/live/demo

With OBS Studio

  1. Open OBS Studio and go to "Settings".
  2. In the "Settings" window, select the "Stream" tab.
  3. Choose "Custom" as the "Service".
  4. Enter "Server": rtmp://localhost:1935/live and "Stream Key": demo.
  5. Click "OK" to save the settings.
  6. Click the "Start Streaming" button in OBS Studio to begin sending live stream to the RTMP server.

Play the Live Stream

With FFplay

Use the following command to play the live stream using FFplay

ffplay rtmp://localhost:1935/live/demo

With VLC Media Player

  1. Open VLC Media Player.
  2. Go to the "Media" menu and select "Open Network Stream".
  3. In the "Network" tab, enter the URL: rtmp://localhost:1935/live/demo.
  4. Click the "Play" button to start playing the live stream.

Serve FLV Live Streams

Create a ASP.NET CORE 8 Web API application project and add the dependencies

dotnet new webapi
dotnet add package LiveStreamingServerNet
dotnet add package LiveStreamingServerNet.Flv

Program.cs

cs
using System.Net;
using LiveStreamingServerNet;
using LiveStreamingServerNet.Flv.Installer;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddLiveStreamingServer(
    new IPEndPoint(IPAddress.Any, 1935),
    options => options.AddFlv()
);

var app = builder.Build();

app.UseWebSockets();
app.UseWebSocketFlv();

app.UseHttpFlv();

await app.RunAsync();

Run the application

dotnet run --urls="https://+:8080"

Play FLV Live Streams

Given a live stream is published to rtmp://localhost:1935/live/demo

HTTP-FLV

https://localhost:8080/live/demo.flv

WebSocket-FLV

wss://localhost:8080/live/demo.flv

Remux RTMP Streams into HLS Streams

Please refer to the LiveStreamServerNet.HlsDemo

Admin Panel

Please refer to the LiveStreamServerNet.StandaloneDemo

NuGet Packages

  Package
  Latest Version






  LiveStreamingServerNet
  




  LiveStreamingServerNet.Standalone
  




  LiveStreamingServerNet.AdminPanelUI
  




  LiveStreamingServerNet.Flv
  




  LiveStreamingServerNet.Networking
  




  LiveStreamingServerNet.Networking.Client
  




  LiveStreamingServerNet.Networking.Server
  




  LiveStreamingServerNet.Rtmp
  




  LiveStreamingServerNet.Rtmp.Client
  




  LiveStreamingServerNet.Rtmp.Relay
  




  LiveStreamingServerNet.Rtmp.Server
  




  LiveStreamingServerNet.StreamProcessor
  




  LiveStreamingServerNet.StreamProcessor.AmazonS3
  




  LiveStreamingServerNet.StreamProcessor.AspNetCore
  




  LiveStreamingServerNet.StreamProcessor.AzureAISpeech
  




  LiveStreamingServerNet.StreamProcessor.AzureBlobStorage
  




  LiveStreamingServerNet.StreamProcessor.GoogleCloudStorage
  




  LiveStreamingServerNet.Utilities

License

This project is licensed under the terms of the MIT license.

Acknowledgments

Special thanks to JetBrains for providing the open-source software license that supports the development of this project.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#asp-net-coreautoscalingcloud-nativecsharp

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类云原生
定价开源

> 相关工具

K
Kubernetes
容器编排事实标准
H
Helm
Kubernetes 包管理器
S
seaweedfs
SeaweedFS is a distributed storage system for object storage (S3), file systems, and Iceberg tables,