Repository navigation
Codec55: 100% pure Go video codec & streaming player (Zero CGO, 0 heap allocs/frame, 467 µs scaling) #3539
Replies: 2 comments 2 replies
|
Hello, this is pretty cool! You can define your own RTP (de)packetizers with Pion.
I think the main blocker would be browser support. Even if the codec runs well in wasm, browsers currently don't let you access raw RTP payloads or define custom RTP payloaders (at least until the RTPTransport API is ready: https://github.com/w3c/webrtc-rtptransport). You could transfer media over SCTP, however. But you lose many QoS features without RTP/RTCP. |
|
Thanks @JoTurk! That distinction makes complete sense. Rather than proposing anything prematurely for It implements Pion's standard
On the client side, rather than dropping to SCTP (and losing jitter buffers, pacing, and RTCP QoS), we validated that Chromium's standard Insertable Streams ( The end-to-end proof of concept streams a real 1280x720@25fps sequence at ~22 ms decode latency per frame with full RTP/RTCP QoS active. We see this primarily as a practical pattern for teams needing pure Go video transport and decoding today without CGO dependencies, while waiting for the W3C |
Uh oh!
There was an error while loading. Please reload this page.
Hi Pion community!
Like many in the Go ecosystem, we've always admired how Pion proved that the entire WebRTC networking stack (ICE, DTLS, SCTP, RTP) could be built in 100% pure Go without CGO.
However, whenever media frames actually need to be decoded or processed in Go (e.g. for server-side AI agents, computer vision pipelines, IoT camera ingestion, or headless media tools), developers have traditionally been forced back into CGO with FFmpeg, libvpx, or OpenH264, bringing along all the cross-compilation headaches and native memory leaks.
To explore whether video decoding could also live entirely within pure Go, we built Codec55 (
.c55):Key Highlights
CGO_ENABLED=0): Zero C dependencies, single static binary, cross-compiling instantly across all Go targets (Linux, macOS, Windows, ARM64, RISC-V).0 B/op): Continuous streaming decode loop operates entirely inside pre-allocated scratch arenas on the stack, verified under Go's race detector (testing.AllocsPerRun == 0). Zero GC pressure.c55play): Native X11 player speaking the X11 wire protocol directly over Unix domain sockets with MIT-SHM Ping-Pong shared memory (zero lag on interactive resizing, hardware 16:9 locking), plus headless 24-bit TrueColor UTF-8 console output.Links
Questions / Discussion for Pion & LiveKit
We’d love to hear your thoughts, feedback, and architectural ideas!
All reactions