{"id":13371325,"url":"https://github.com/bluenviron/gortsplib","last_synced_at":"2025-05-13T19:03:14.546Z","repository":{"id":37403255,"uuid":"235060192","full_name":"bluenviron/gortsplib","owner":"bluenviron","description":"RTSP 1.0 client and server library for the Go programming language","archived":false,"fork":false,"pushed_at":"2025-05-06T05:29:53.000Z","size":4215,"stargazers_count":773,"open_issues_count":22,"forks_count":213,"subscribers_count":21,"default_branch":"main","last_synced_at":"2025-05-13T15:10:47.432Z","etag":null,"topics":["aac","go","golang","h264","rtcp","rtp","rtsp","rtsp-client","rtsp-player","rtsp-proxy","rtsp-relay","rtsp-server"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bluenviron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":["https://www.buymeacoffee.com/aler9"]}},"created_at":"2020-01-20T09:08:24.000Z","updated_at":"2025-05-13T01:42:55.000Z","dependencies_parsed_at":"2023-07-28T12:54:29.867Z","dependency_job_id":"ab9dee82-32cf-4e2a-b849-a4e653a549cb","html_url":"https://github.com/bluenviron/gortsplib","commit_stats":null,"previous_names":["aler9/gortsplib"],"tags_count":76,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluenviron%2Fgortsplib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluenviron%2Fgortsplib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluenviron%2Fgortsplib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluenviron%2Fgortsplib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bluenviron","download_url":"https://codeload.github.com/bluenviron/gortsplib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254010793,"owners_count":21998993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aac","go","golang","h264","rtcp","rtp","rtsp","rtsp-client","rtsp-player","rtsp-proxy","rtsp-relay","rtsp-server"],"created_at":"2024-07-30T02:01:29.573Z","updated_at":"2025-05-13T19:03:14.539Z","avatar_url":"https://github.com/bluenviron.png","language":"Go","funding_links":["https://www.buymeacoffee.com/aler9"],"categories":["Repositories","Video","视频"],"sub_categories":["Fail injection","实用程序/Miscellaneous","Utility/Miscellaneous"],"readme":"# gortsplib\n\n[![Test](https://github.com/bluenviron/gortsplib/actions/workflows/test.yml/badge.svg)](https://github.com/bluenviron/gortsplib/actions/workflows/test.yml)\n[![Lint](https://github.com/bluenviron/gortsplib/actions/workflows/lint.yml/badge.svg)](https://github.com/bluenviron/gortsplib/actions/workflows/lint.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/bluenviron/gortsplib)](https://goreportcard.com/report/github.com/bluenviron/gortsplib)\n[![CodeCov](https://codecov.io/gh/bluenviron/gortsplib/branch/main/graph/badge.svg)](https://app.codecov.io/gh/bluenviron/gortsplib/tree/main)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/bluenviron/gortsplib/v4)](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4#pkg-index)\n\nRTSP 1.0 client and server library for the Go programming language, written for [MediaMTX](https://github.com/bluenviron/mediamtx).\n\nGo \u0026ge; 1.23 is required.\n\nFeatures:\n\n* Client\n  * Query servers about available media streams\n  * Read media streams from a server (\"play\")\n    * Read streams with the UDP, UDP-multicast or TCP transport protocol\n    * Read TLS-encrypted streams (TCP only)\n    * Switch transport protocol automatically\n    * Read selected media streams\n    * Pause or seek without disconnecting from the server\n    * Write to ONVIF back channels\n    * Get PTS (relative) timestamp of incoming packets\n    * Get NTP (absolute) timestamp of incoming packets\n  * Write media streams to a server (\"record\")\n    * Write streams with the UDP or TCP transport protocol\n    * Write TLS-encrypted streams (TCP only)\n    * Switch transport protocol automatically\n    * Pause without disconnecting from the server\n* Server\n  * Handle requests from clients\n  * Validate client credentials\n  * Read media streams from clients (\"record\")\n    * Read streams with the UDP or TCP transport protocol\n    * Read TLS-encrypted streams (TCP only)\n    * Get PTS (relative) timestamp of incoming packets\n    * Get NTP (absolute) timestamp of incoming packets\n  * Serve media streams to clients (\"play\")\n    * Write streams with the UDP, UDP-multicast or TCP transport protocol\n    * Write TLS-encrypted streams (TCP only)\n    * Compute and provide SSRC, RTP-Info to clients\n    * Read ONVIF back channels\n* Utilities\n  * Parse RTSP elements\n  * Encode/decode RTP packets into/from codec-specific frames\n\n## Table of contents\n\n* [Examples](#examples)\n* [API Documentation](#api-documentation)\n* [RTP Payload Formats](#rtp-payload-formats)\n* [Specifications](#specifications)\n* [Related projects](#related-projects)\n\n## Examples\n\n* [client-query](examples/client-query/main.go)\n* [client-play](examples/client-play/main.go)\n* [client-play-timestamp](examples/client-play-timestamp/main.go)\n* [client-play-options](examples/client-play-options/main.go)\n* [client-play-pause](examples/client-play-pause/main.go)\n* [client-play-to-record](examples/client-play-to-record/main.go)\n* [client-play-backchannel](examples/client-play-backchannel/main.go)\n* [client-play-format-av1](examples/client-play-format-av1/main.go)\n* [client-play-format-av1-to-jpeg](examples/client-play-format-av1-to-jpeg/main.go)\n* [client-play-format-g711](examples/client-play-format-g711/main.go)\n* [client-play-format-h264](examples/client-play-format-h264/main.go)\n* [client-play-format-h264-to-jpeg](examples/client-play-format-h264-to-jpeg/main.go)\n* [client-play-format-h264-to-disk](examples/client-play-format-h264-to-disk/main.go)\n* [client-play-format-h264-mpeg4audio-to-disk](examples/client-play-format-h264-mpeg4audio-to-disk/main.go)\n* [client-play-format-h265](examples/client-play-format-h265/main.go)\n* [client-play-format-h265-to-jpeg](examples/client-play-format-h265-to-jpeg/main.go)\n* [client-play-format-h265-to-disk](examples/client-play-format-h265-to-disk/main.go)\n* [client-play-format-lpcm](examples/client-play-format-lpcm/main.go)\n* [client-play-format-mjpeg](examples/client-play-format-mjpeg/main.go)\n* [client-play-format-mpeg4audio](examples/client-play-format-mpeg4audio/main.go)\n* [client-play-format-mpeg4audio-to-disk](examples/client-play-format-mpeg4audio-to-disk/main.go)\n* [client-play-format-opus](examples/client-play-format-opus/main.go)\n* [client-play-format-opus-to-disk](examples/client-play-format-opus-to-disk/main.go)\n* [client-play-format-vp8](examples/client-play-format-vp8/main.go)\n* [client-play-format-vp9](examples/client-play-format-vp9/main.go)\n* [client-record-options](examples/client-record-options/main.go)\n* [client-record-pause](examples/client-record-pause/main.go)\n* [client-record-format-av1](examples/client-record-format-av1/main.go)\n* [client-record-format-g711](examples/client-record-format-g711/main.go)\n* [client-record-format-h264](examples/client-record-format-h264/main.go)\n* [client-record-format-h264-from-disk](examples/client-record-format-h264-from-disk/main.go)\n* [client-record-format-h265](examples/client-record-format-h265/main.go)\n* [client-record-format-lpcm](examples/client-record-format-lpcm/main.go)\n* [client-record-format-mjpeg](examples/client-record-format-mjpeg/main.go)\n* [client-record-format-mpeg4audio](examples/client-record-format-mpeg4audio/main.go)\n* [client-record-format-opus](examples/client-record-format-opus/main.go)\n* [client-record-format-vp8](examples/client-record-format-vp8/main.go)\n* [client-record-format-vp9](examples/client-record-format-vp9/main.go)\n* [server](examples/server/main.go)\n* [server-tls](examples/server-tls/main.go)\n* [server-auth](examples/server-auth/main.go)\n* [server-record-format-h264-to-disk](examples/server-record-format-h264-to-disk/main.go)\n* [server-play-format-h264-from-disk](examples/server-play-format-h264-from-disk/main.go)\n* [server-play-backchannel](examples/server-play-backchannel/main.go)\n* [proxy](examples/proxy/main.go)\n* [proxy-backchannel](examples/proxy-backchannel/main.go)\n\n## API Documentation\n\n[Click to open the API Documentation](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4#pkg-index)\n\n## RTP Payload Formats\n\nIn RTSP, media streams are transmitted by using RTP packets, which are encoded in a specific, codec-dependent, format. This library supports formats for the following codecs:\n\n### Video\n\n|codec|documentation|encoder and decoder available|\n|------|-------------|-----------------------------|\n|AV1|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#AV1)|:heavy_check_mark:|\n|VP9|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#VP9)|:heavy_check_mark:|\n|VP8|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#VP8)|:heavy_check_mark:|\n|H265|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#H265)|:heavy_check_mark:|\n|H264|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#H264)|:heavy_check_mark:|\n|MPEG-4 Video (H263, Xvid)|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#MPEG4Video)|:heavy_check_mark:|\n|MPEG-1/2 Video|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#MPEG1Video)|:heavy_check_mark:|\n|M-JPEG|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#MJPEG)|:heavy_check_mark:|\n\n### Audio\n\n|codec|documentation|encoder and decoder available|\n|------|-------------|-----------------------------|\n|Opus|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#Opus)|:heavy_check_mark:|\n|Vorbis|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#Vorbis)||\n|MPEG-4 Audio (AAC)|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#MPEG4Audio)|:heavy_check_mark:|\n|MPEG-1/2 Audio (MP3)|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#MPEG1Audio)|:heavy_check_mark:|\n|AC-3|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#AC3)|:heavy_check_mark:|\n|Speex|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#Speex)||\n|G726|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#G726)||\n|G722|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#G722)|:heavy_check_mark:|\n|G711 (PCMA, PCMU)|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#G711)|:heavy_check_mark:|\n|LPCM|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#LPCM)|:heavy_check_mark:|\n\n### Other\n\n|codec|documentation|encoder and decoder available|\n|------|-------------|-----------------------------|\n|MPEG-TS|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#MPEGTS)||\n\n## Specifications\n\n|name|area|\n|----|----|\n|[RFC2326, RTSP 1.0](https://datatracker.ietf.org/doc/html/rfc2326)|protocol|\n|[RFC7826, RTSP 2.0](https://datatracker.ietf.org/doc/html/rfc7826)|protocol|\n|[RFC8866, SDP: Session Description Protocol](https://datatracker.ietf.org/doc/html/rfc8866)|SDP|\n|[RTP Payload Format For AV1 (v1.0)](https://aomediacodec.github.io/av1-rtp-spec/)|payload formats / AV1|\n|[RTP Payload Format for VP9 Video](https://datatracker.ietf.org/doc/html/draft-ietf-payload-vp9-16)|payload formats / VP9|\n|[RFC7741, RTP Payload Format for VP8 Video](https://datatracker.ietf.org/doc/html/rfc7741)|payload formats / VP8|\n|[RFC7798, RTP Payload Format for High Efficiency Video Coding (HEVC)](https://datatracker.ietf.org/doc/html/rfc7798)|payload formats / H265|\n|[RFC6184, RTP Payload Format for H.264 Video](https://datatracker.ietf.org/doc/html/rfc6184)|payload formats / H264|\n|[RFC3640, RTP Payload Format for Transport of MPEG-4 Elementary Streams](https://datatracker.ietf.org/doc/html/rfc3640)|payload formats / MPEG-4 audio, MPEG-4 video|\n|[RFC2250, RTP Payload Format for MPEG1/MPEG2 Video](https://datatracker.ietf.org/doc/html/rfc2250)|payload formats / MPEG-1 video, MPEG-2 audio, MPEG-TS|\n|[RFC2435, RTP Payload Format for JPEG-compressed Video](https://datatracker.ietf.org/doc/html/rfc2435)|payload formats / M-JPEG|\n|[RFC7587, RTP Payload Format for the Opus Speech and Audio Codec](https://datatracker.ietf.org/doc/html/rfc7587)|payload formats / Opus|\n|[Multiopus in libwebrtc](https://webrtc-review.googlesource.com/c/src/+/129768)|payload formats / Opus|\n|[RFC5215, RTP Payload Format for Vorbis Encoded Audio](https://datatracker.ietf.org/doc/html/rfc5215)|payload formats / Vorbis|\n|[RFC4184, RTP Payload Format for AC-3 Audio](https://datatracker.ietf.org/doc/html/rfc4184)|payload formats / AC-3|\n|[RFC6416, RTP Payload Format for MPEG-4 Audio/Visual Streams](https://datatracker.ietf.org/doc/html/rfc6416)|payload formats / MPEG-4 audio|\n|[RFC5574, RTP Payload Format for the Speex Codec](https://datatracker.ietf.org/doc/html/rfc5574)|payload formats / Speex|\n|[RFC3551, RTP Profile for Audio and Video Conferences with Minimal Control](https://datatracker.ietf.org/doc/html/rfc3551)|payload formats / G726, G722, G711, LPCM|\n|[RFC3190, RTP Payload Format for 12-bit DAT Audio and 20- and 24-bit Linear Sampled Audio](https://datatracker.ietf.org/doc/html/rfc3190)|payload formats / LPCM|\n|[Codec specifications](https://github.com/bluenviron/mediacommon#specifications)|codecs|\n|[Golang project layout](https://github.com/golang-standards/project-layout)|project layout|\n\n## Related projects\n\n* [MediaMTX](https://github.com/bluenviron/mediamtx)\n* [gohlslib](https://github.com/bluenviron/gohlslib)\n* [mediacommon](https://github.com/bluenviron/mediacommon)\n* [pion/sdp (SDP library used internally)](https://github.com/pion/sdp)\n* [pion/rtp (RTP library used internally)](https://github.com/pion/rtp)\n* [pion/rtcp (RTCP library used internally)](https://github.com/pion/rtcp)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluenviron%2Fgortsplib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluenviron%2Fgortsplib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluenviron%2Fgortsplib/lists"}