# media-server **Repository Path**: simplecoder-1/media-server ## Basic Information - **Project Name**: media-server - **Description**: RTSP/RTMP/HLS/HTTP协议的轻量级流媒体框架,支持大并发连接请求 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-07 - **Last Updated**: 2026-03-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 轻量级流媒体框架 支持 RTSP/RTMP/HLS/HTTP 协议的流媒体服务器,支持大并发连接。 ## 快速开始 ### 安装 ```bash pip install -r requirements.txt ``` ### 启动 ```bash python src/main.py ``` 或使用启动脚本: ```bash start.bat # Windows ./start.sh # Linux/Mac ``` ## 协议端口 - **RTSP**: 8554 - **RTMP**: 1935 - **HLS**: 8888 - **HTTP**: 8080 ## 使用示例 ### 推流(FFmpeg) ```bash # RTMP ffmpeg -re -i input.mp4 -c copy -f flv rtmp://localhost:1935/live/stream1 # RTSP ffmpeg -re -i input.mp4 -c copy -f rtsp rtsp://localhost:8554/stream1 ``` ### 播放 - RTMP: `rtmp://localhost:1935/live/stream1` - HLS: `http://localhost:8888/stream1/playlist.m3u8` - HTTP-FLV: `http://localhost:8080/live/stream1.flv` ## API 接口 ```bash # 统计信息 curl http://localhost:8080/api/stats # 流列表 curl http://localhost:8080/api/streams # 创建流 curl -X POST http://localhost:8080/api/streams/mystream/publish \ -H "Content-Type: application/json" \ -d '{"protocol": "rtmp", "codec": "h264"}' # 健康检查 curl http://localhost:8080/health ``` ## 配置 编辑 `config.yaml`: ```yaml server: host: "0.0.0.0" ports: rtsp: 8554 rtmp: 1935 hls: 8888 http: 8080 max_connections: 10000 ``` ## 性能 - 支持 10000+ 并发连接 - 低延迟:< 500ms - 异步 IO,事件驱动 ## License MIT