> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/bluenviron/gortsplib/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> A full-featured RTSP client and server library for the Go programming language.

# gortsplib

gortsplib is a production-ready RTSP client and server library for Go, written to power [MediaMTX](https://github.com/bluenviron/mediamtx). It implements RTSP 1.0 and 2.0, handles RTP/RTCP packet routing, and supports a wide array of codecs and transport modes.

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/quickstart">
    Get a working RTSP client or server running in minutes
  </Card>

  <Card title="Client Guide" icon="play" href="/client/overview">
    Read and write RTSP streams with the Client API
  </Card>

  <Card title="Server Guide" icon="server" href="/server/overview">
    Build custom RTSP servers with the handler interface
  </Card>

  <Card title="RTP Formats" icon="film" href="/formats/overview">
    Encode and decode H264, H265, AV1, AAC, Opus, and more
  </Card>
</CardGroup>

## Key features

<CardGroup cols={2}>
  <Card title="Client: Play & Record" icon="circle-play">
    Connect to any RTSP server to read media streams or publish your own, with automatic transport negotiation.
  </Card>

  <Card title="Server with handler interface" icon="sliders">
    Implement only the callbacks you need — `OnDescribe`, `OnAnnounce`, `OnSetup`, `OnPlay`, `OnRecord` — and gortsplib handles the protocol.
  </Card>

  <Card title="Multiple transports" icon="network-wired">
    UDP, UDP-multicast, and TCP transports. The library switches automatically when a transport fails.
  </Card>

  <Card title="Secure variants" icon="lock">
    RTSPS (TLS), SRTP, and SRTCP for encrypted streams and authenticated sessions.
  </Card>

  <Card title="Tunneling" icon="arrow-right-arrow-left">
    RTSP-over-HTTP and RTSP-over-WebSocket for traversing firewalls and proxies.
  </Card>

  <Card title="Rich codec support" icon="code">
    Native RTP packetizers and depacketizers for H264, H265, AV1, VP8, VP9, AAC, Opus, G711, LPCM, and more.
  </Card>

  <Card title="Accurate timestamps" icon="clock">
    Extract PTS and NTP timestamps from inbound packets for synchronized playback or recording.
  </Card>

  <Card title="ONVIF back channels" icon="camera">
    Two-way audio support for ONVIF-compatible IP cameras using RTSP back channels.
  </Card>
</CardGroup>

## Module path

gortsplib is published as a Go module. The current major version is **v5**:

```
github.com/bluenviron/gortsplib/v5
```

<Note>
  Go 1.25 or later is required.
</Note>

## Related projects

| Project | Description |
| - | - |
| [MediaMTX](https://github.com/bluenviron/mediamtx) | Production media server built on gortsplib |
| [gohlslib](https://github.com/bluenviron/gohlslib) | HLS client and server library for Go |
| [gortmplib](https://github.com/bluenviron/gortmplib) | RTMP client and server library for Go |
| [mediacommon](https://github.com/bluenviron/mediacommon) | Shared codec utilities |
| [pion/rtp](https://github.com/pion/rtp) | RTP library used internally |
| [pion/rtcp](https://github.com/pion/rtcp) | RTCP library used internally |
| [pion/srtp](https://github.com/pion/srtp) | SRTP library used internally |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.