# RTPServer **Repository Path**: xtitxss/RTPServer ## Basic Information - **Project Name**: RTPServer - **Description**: No description available - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2026-07-10 - **Last Updated**: 2026-08-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # RTPServer RTSP/RTP Streaming Server ## Project Overview RTPServer is a streaming server implemented in Java that supports RTSP (Real Time Streaming Protocol) and RTP (Real-time Transport Protocol). The server can parse MP4 media files and deliver streaming media to clients via the RTSP protocol, supporting real-time transmission of video and audio. ## Key Features - **RTSP Protocol Support**: Full implementation of the RTSP protocol, supporting operations such as DESCRIBE, SETUP, PLAY, PAUSE, and TEARDOWN. - **RTP Streaming Transmission**: Supports RTP packet encapsulation and transmission for video (H.264) and audio (AAC). - **MP4 File Parsing**: Built-in MP4 parser capable of reading media track information, sample data, and decoding configurations. - **Playlist Management**: Supports multiple playlist types, including karaoke playlists. - **Session Management**: Manages multiple client sessions and maintains playback states. - **SDP Generation**: Dynamically generates Session Description Protocol (SDP) description files. ## Technology Stack - **Java 8+** - **RTSP/RTP Protocols** - **MP4 Media Format** - **Maven** (Build Tool) ## Project Structure ``` RTPServer ├── src/main/java/com/ │ ├── http/ # HTTP client (for fetching playlists) │ ├── rtp/ # RTP protocol implementation │ │ ├── packet/ # RTP packet generator │ │ ├── server/ # RTP server │ │ └── stream/ # Stream management │ ├── rtsp/ # RTSP protocol implementation │ │ ├── server/ # RTSP server │ │ ├── request/ # RTSP request handling │ │ ├── response/ # RTSP response handling │ │ └── session/ # Session management │ └── tj/mp4/ # MP4 file parsing │ ├── boxes/ # MP4 Box structures │ └── descriptor/ # Descriptor parsing ├── src/main/resources/ # Configuration files └── src/test/java/ # Unit tests ``` ## Quick Start ### Build the Project ```bash mvn clean package ``` ### Run the Server ```bash # Run the RTSP server (default port 554) java -jar target/RTPServer.jar # Specify a custom port java -jar target/RTPServer.jar --port 8554 ``` ## Usage Examples ### Access via RTSP URL Clients can access the stream using the following URLs: ``` rtsp://localhost:554/playlist rtsp://localhost:554/channel rtsp://localhost:554/item rtsp://localhost:554/kareoke ``` ### RTP Packet Transmission The server automatically encapsulates MP4 media content into RTP packets and transmits them to the client-specified ports. ## Configuration ### Application.properties The configuration file is located at `src/main/resources/Application.properties`. Configurable parameters include: - Server port - Media file path - Playlist source URL ## Core Classes | Class Name | Description | |------------|-------------| | `RTSPServer` | Main RTSP server class responsible for accepting client connections | | `RTPServer` | RTP server responsible for transmitting media data | | `MP4Reader` | MP4 file parser that reads media metadata | | `RTPVideoPacketGenerator` | Video RTP packet generator | | `RTPAudioPacketGenerator` | Audio RTP packet generator | | `SessionManager` | Session manager that maintains client session states | ## Dependencies - Jackson (JSON processing) - JUnit (Unit testing) ## License MIT License