https://github.com/bluenviron/gohlslib
HLS client and muxer library for the Go programming language
https://github.com/bluenviron/gohlslib
go golang h264 h265 hls ll-hls streaming video
Last synced: 14 days ago
JSON representation
HLS client and muxer library for the Go programming language
- Host: GitHub
- URL: https://github.com/bluenviron/gohlslib
- Owner: bluenviron
- License: mit
- Created: 2023-03-10T11:27:05.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-04T09:30:10.000Z (25 days ago)
- Last Synced: 2025-05-04T10:30:40.450Z (25 days ago)
- Topics: go, golang, h264, h265, hls, ll-hls, streaming, video
- Language: Go
- Homepage:
- Size: 547 KB
- Stars: 118
- Watchers: 3
- Forks: 35
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gohlslib
[](https://github.com/bluenviron/gohlslib/actions/workflows/test.yml)
[](https://github.com/bluenviron/gohlslib/actions/workflows/lint.yml)
[](https://goreportcard.com/report/github.com/bluenviron/gohlslib)
[](https://app.codecov.io/gh/bluenviron/gohlslib/tree/main)
[](https://pkg.go.dev/github.com/bluenviron/gohlslib/v2#pkg-index)HLS client and muxer library for the Go programming language, written for [MediaMTX](https://github.com/bluenviron/mediamtx).
Go ≥ 1.23 is required.
Features:
* Client
* Read streams in MPEG-TS, fMP4 or Low-latency format
* Read a single video track and/or multiple audio tracks
* Read tracks encoded with AV1, VP9, H265, H264, Opus, MPEG-4 Audio (AAC)
* Get absolute timestamp of incoming data* Muxer
* Generate streams in MPEG-TS, fMP4 or Low-latency format
* Write a single video track and/or multiple audio tracks
* Write tracks encoded with AV1, VP9, H265, H264, Opus, MPEG-4 audio (AAC)
* Save generated segments on disk* General
* Parse and produce M3U8 playlists
* Examples## Table of contents
* [Examples](#examples)
* [API Documentation](#api-documentation)
* [Specifications](#specifications)
* [Related projects](#related-projects)## Examples
* [playlist-parser](examples/playlist-parser/main.go)
* [client](examples/client/main.go)
* [client-absolute-timestamp](examples/client-absolute-timestamp/main.go)
* [client-codec-h264-save-to-disk](examples/client-codec-h264-save-to-disk/main.go)
* [client-codec-h264-convert-to-jpeg](examples/client-codec-h264-convert-to-jpeg/main.go)
* [client-codec-mpeg4audio-save-to-disk](examples/client-codec-mpeg4audio-save-to-disk/main.go)
* [muxer](examples/muxer/main.go)## API Documentation
[Click to open the API Documentation](https://pkg.go.dev/github.com/bluenviron/gohlslib#pkg-index)
## Specifications
|name|area|
|----|----|
|[RFC2616, HTTP 1.1](https://datatracker.ietf.org/doc/html/rfc2616)|protocol|
|[RFC8216, HLS](https://datatracker.ietf.org/doc/html/rfc8216)|protocol|
|[HLS v2](https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis)|protocol|
|[HTTP Live Streaming by Apple](https://developer.apple.com/documentation/http-live-streaming)|protocol|
|[Codec specifications](https://github.com/bluenviron/mediacommon#specifications)|codecs|
|[Golang project layout](https://github.com/golang-standards/project-layout)|project layout|## Related projects
* [MediaMTX](https://github.com/bluenviron/mediamtx)
* [gortsplib](https://github.com/bluenviron/gortsplib)
* [mediacommon](https://github.com/bluenviron/mediacommon)