gostream is a library to simplify the streaming of images as video to a series of WebRTC peers. The impetus for this existing was for doing simple GUI / video streaming to a browser all within go with as little cgo as possible. The package will likely be refactored over time to support some more generalized use cases and as such will be in version 0 for the time being. Many parameters are hard coded and need to be configurable over time. Use at your own risk, and please file issues!
- Support multiple codes (e.g. Firefox macos-arm does not support h264 by default yet)
- Address code TODOs (including context.TODO)
- Documentation (inner func docs, package docs, example docs)
- Version 0.1.0
- Tests
- Sound streaming (with video synchronization)
- Stream current desktop:
go run github.com/trevor403/gostream/cmd/stream_desktop
For some reason unknown yet, Firefox appears to freeze frequently. This is very unlikely an issue with pion/webrtc and very likely an issue with this library based on current testing. Current thoughts are that it has to do with the timing of writes causing dropped/faulty packets from the perspective of Firefox. Chromium seems to work just fine. Running Firefox with --MOZ_LOG=webrtc_trace:5 can show the errors it is seeing. There are a lot of no GoP in frame drops as well as NACK frame drops. Also curious if the issue is made worse with larger frames and different frame formats.
- mDNS (.local addresses) don't seem to work well with WebRTC yet. Random STUN/TURN failures appear to occur. At your own risk, you can address this in Firefox in
about:config
withmedia.peerconnection.ice.obfuscate_host_addresses
set tofalse
and in Chrome withchrome://flags/#enable-webrtc-hide-local-ips-with-mdns
set toDisabled
.
- libvpx
Linux: libvpx-dev
macOS: brew install libvpx
- x264
Linux: libx264-dev
macOS: brew install x264
make lint
make test
If I somehow took code from somewhere without acknowledging it here or via the go.mod, please file an issue and let me know.