Skip to content

RTSP 1.0 client and server library for the Go programming language

License

Notifications You must be signed in to change notification settings

bass3m/gortsplib

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gortsplib

Test Lint Go Report Card CodeCov PkgGoDev

RTSP 1.0 client and server library for the Go programming language, written for MediaMTX.

Go ≥ 1.19 is required.

Features:

  • Client
    • Query servers about available media streams
    • Read
      • Read media streams from servers with the UDP, UDP-multicast or TCP transport protocol
      • Read TLS-encrypted streams (TCP only)
      • Switch transport protocol automatically
      • Read selected media streams only
      • Pause or seek without disconnecting from the server
      • Get PTS (relative) timestamp of incoming packets
      • Get NTP (absolute) timestamp of incoming packets
    • Publish
      • Publish media streams to servers with the UDP or TCP transport protocol
      • Publish TLS-encrypted streams (TCP only)
      • Switch transport protocol automatically
      • Pause without disconnecting from the server
  • Server
    • Handle requests from clients
    • Publish
      • Read media streams from clients with the UDP or TCP transport protocol
      • Read TLS-encrypted streams (TCP only)
      • Get PTS (relative) timestamp of incoming packets
      • Get NTP (absolute) timestamp of incoming packets
    • Read
      • Write media streams to clients with the UDP, UDP-multicast or TCP transport protocol
      • Write TLS-encrypted streams (TCP only)
      • Compute and provide SSRC, RTP-Info to clients
  • Utilities
    • Parse RTSP elements
    • Encode/decode codec-specific frames into/from RTP packets

Table of contents

Examples

API Documentation

Click to open the API Documentation

RTP Payload Formats

In RTSP, media streams are routed between server and clients by using RTP packets, which are encoded in a specific, codec-dependent, format, that is declared during the handshake. This library supports the following formats:

Video

format documentation encoder and decoder available
AV1 link ✔️
VP9 link ✔️
VP8 link ✔️
H265 link ✔️
H264 link ✔️
MPEG-4 Video (H263, Xvid) link ✔️
MPEG-1/2 Video link ✔️
M-JPEG link ✔️

Audio

format documentation encoder and decoder available
Opus link ✔️
Vorbis link
MPEG-4 Audio (AAC) link ✔️
MPEG-1/2 Audio (MP3) link ✔️
AC-3 link ✔️
Speex link
G726 link
G722 link ✔️
G711 (PCMA, PCMU) link ✔️
LPCM link ✔️

Other

format documentation encoder and decoder available
MPEG-TS link

Specifications

name area
RFC2326, RTSP 1.0 protocol
RFC7826, RTSP 2.0 protocol
RFC8866, SDP: Session Description Protocol SDP
RTP Payload Format For AV1 (v1.0) AV1 payload format
RTP Payload Format for VP9 Video VP9 payload format
RFC7741, RTP Payload Format for VP8 Video VP8 payload format
RFC7798, RTP Payload Format for High Efficiency Video Coding (HEVC) H265 payload format
RFC6184, RTP Payload Format for H.264 Video H264 payload format
RFC3640, RTP Payload Format for Transport of MPEG-4 Elementary Streams MPEG-4 audio, MPEG-4 video payload formats
RFC2250, RTP Payload Format for MPEG1/MPEG2 Video MPEG-1 video, MPEG-2 audio, MPEG-TS payload formats
RFC2435, RTP Payload Format for JPEG-compressed Video M-JPEG payload format
RFC7587, RTP Payload Format for the Opus Speech and Audio Codec Opus payload format
RFC5215, RTP Payload Format for Vorbis Encoded Audio Vorbis payload format
RFC4184, RTP Payload Format for AC-3 Audio AC-3 payload format
RFC6416, RTP Payload Format for MPEG-4 Audio/Visual Streams MPEG-4 audio payload format
RFC5574, RTP Payload Format for the Speex Codec Speex payload format
RFC3551, RTP Profile for Audio and Video Conferences with Minimal Control G726, G722, G711 payload formats
RFC3190, RTP Payload Format for 12-bit DAT Audio and 20- and 24-bit Linear Sampled Audio LPCM payload format
Codec specifications codecs
Golang project layout project layout

Related projects

About

RTSP 1.0 client and server library for the Go programming language

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 99.5%
  • Other 0.5%