• Stars
    star
    364
  • Rank 112,921 (Top 3 %)
  • Language
    Go
  • License
    MIT License
  • Created over 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

RTSP 1.0 client and server library for the Go programming language

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
    • Play (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
      • Pause or seek without disconnecting from the server
      • Write to ONVIF back channels
      • Get PTS (relative) timestamp of incoming packets
      • Get NTP (absolute) timestamp of incoming packets
    • Record (write)
      • Write media streams to servers with the UDP or TCP transport protocol
      • Write TLS-encrypted streams (TCP only)
      • Switch transport protocol automatically
      • Pause without disconnecting from the server
  • Server
    • Handle requests from clients
    • Record (read)
      • 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
    • Play (write)
      • 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 RTP packets into/from codec-specific frames

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. This library supports formats for the following codecs:

Video

codec 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

codec 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

codec 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, LPCM 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

More Repositories

1

rtsp-simple-server

ready-to-use RTSP / RTMP / LL-HLS / WebRTC server and proxy that allows to read, publish and proxy video and audio streams. Also known as MediaMTX
Go
5,439
star
2

goroslib

ROS client library for the Go programming language
Go
250
star
3

landiscover

discover devices connected to the local network within seconds
Go
86
star
4

gomavlib

Mavlink library (2.0 and 1.0) for the Go programming language
Go
77
star
5

mavp2p

flexible and efficient Mavlink router
Go
60
star
6

howto-udp-broadcast-golang

Sample code and instructions on how to send and receive UDP broadcast packets in the Go programming language.
56
star
7

rtsp-simple-proxy

DEPRECATED - please use https://github.com/aler9/rtsp-simple-server
Go
52
star
8

gst-darknet

GStreamer element to use Darknet (neural network framework) inside GStreamer
C
18
star
9

sensor-imu

C library to interact with various IMUs (MPU6000, MPU6050, MPU6500, ICM20600, ICM20601, ICM2062)
C
18
star
10

dctk

Direct Connect client library (ADC and NMDC) for the Go programming language
Go
16
star
11

raspberry-imu-viewer

view IMU estimates in 3D on a Rasberry Pi (MPU6000, MPU6050, MPU6500, ICM20600, ICM20601, ICM20602)
C
12
star
12

googlefonts-inliner

PostCSS plugin to download all Google Fonts imported by a stylesheet and serve them locally
JavaScript
6
star
13

howto-react-realtime

Sample code that shows how create web apps with a state synchronized between all users
JavaScript
6
star
14

gst-videoscale-ratio

GStreamer element to resize a video and keep its aspect ratio
C
5
star
15

gst-namedpipe

GStreamer element that allows to write/read data to/from named pipes
C
4
star
16

howto-nginx-automatic-ssl-certificates

Sample code and instructions on how to automatically obtain and update Let's Encrypt SSL certificates for nginx, with no manual steps or maintenance.
3
star
17

howto-rpi-temperature-prometheus-influxdb-netdata

Sample code and instructions on how to push the Raspberry Pi internal temperature value into Prometheus, InfluxDB or Netdata.
2
star
18

radiodb-viewer

source code of https://radiodb.freeddns.org
JavaScript
2
star
19

howto-logs-rate-exporter

Sample code and instructions on how to push the requests rate inferred from log files into Prometheus, a lightweight alternative to mtail and grok_exporter.
1
star
20

aler9

1
star
21

raspberry-make

command line tool (Makefile) to create custom Raspberry Pi images, based on Ansible and Docker
Makefile
1
star
22

sensor-hp203b

C library for interacting with the HP203B barometer sensor
C
1
star
23

howto-gmail-imap-oauth2

Sample code of the Gmail-IMAP-Oauth2 authentication procedure, in Python and Go. Allows to perform automated operations on emails without toggling the "less secure apps" switch on the Google account page.
1
star