Skip to content

AmarnathCJD/gortc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gortc

A Go library for streaming audio and video into Telegram group calls, built on top of gogram.

It joins voice/video chats and streams from flexible sources: files, URLs, readers, raw PCM/video frames, or pre-encoded Opus/IVF.

Existing solutions (pytgcalls, ntgcalls, tgcalls, etc.) all wrap libwebrtc or other C++ stacks via bindings. gortc is the first pure-Go implementation — no libwebrtc, no CGo, no native dependencies. The SRTP, DTLS, ICE, and SFU signaling stack is all native Go.

Install

go get github.com/amarnathcjd/gortc

Quick start

client, _ := telegram.NewClient(telegram.ClientConfig{ /* ... */ })
client.Conn()

call := gortc.NewCall(client, gortc.WithLogLevel(slog.LevelInfo))
call.OnConnected(func() {
    go call.Stream(context.Background(), gortc.FromFile("movie.mkv"))
})

if err := call.Join("@mychat"); err != nil {
    log.Fatal(err)
}
defer call.Leave()

Sources

Stream from local files, remote URLs, or any io.Reader — gortc transcodes on the fly. Skip the encoder by passing pre-encoded Opus or IVF, or push raw PCM/video frames directly. Compose sources with Loop and Concat.

Examples

License

MIT — see LICENSE. The WebRTC stack under webrtc/ is adapted from pion (MIT).

About

A pure Go library for streaming audio and video through Telegram group calls and P2P calls using Gogram MTProto.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages