Pion WebRTC stands as a robust, pure Go implementation of the WebRTC API, providing developers with a powerful toolset for building real-time communication applications. This library is designed for those seeking a performant, flexible, and highly compatible solution for incorporating WebRTC functionalities into their Go projects.
Latest Release: Pion WebRTC v4.0.0
The newest version, Pion WebRTC v4.0.0, is now available! For a comprehensive understanding of the latest enhancements and modifications, please consult the release notes. If upgrading immediately isn’t feasible, you can find the most recent v3
release by checking the tags. Your feedback is highly valued! Please share your thoughts and report any issues on GitHub, or connect with the maintainers and community on the Slack channel.
Getting Started with Pion WebRTC
To utilize Pion WebRTC, Go Modules are essential. Ensure you have export GO111MODULE=on
set in your environment. When importing Pion WebRTC in your Go projects, specify /v4
(or an earlier version if needed) to ensure proper version management.
Explore practical examples and code samples in the example applications directory. These examples demonstrate common use cases and provide a starting point for your own projects.
For more sophisticated, full-featured examples that integrate with third-party libraries, visit example-webrtc-applications.
Discover real-world applications of Pion WebRTC and projects built using it in the awesome-pion list. These projects serve as excellent references and inspiration.
Refer to the auto-generated API documentation on GoDoc for a detailed API reference. All public APIs are thoroughly documented to assist you in development.
Find answers to frequently asked questions in the FAQ section. If your question isn’t addressed, feel free to ask in the Slack community – we are always looking to expand our knowledge base and assist users.
Now it’s your turn to build something incredible with Pion WebRTC! Here are a few ideas to spark your creativity:
- Synchronized Video Streaming: Stream a video file to multiple browsers in real-time for a perfectly synced viewing experience.
- Embedded Webcam Streaming: Transmit webcam feeds from embedded devices directly to browsers without requiring intermediary servers.
- Secure Server-to-Server Data Transfer: Establish secure data channels between servers, bypassing traditional pub/sub models.
- Server-Side Webcam Processing: Record webcam streams and apply special effects server-side for advanced media processing.
- Interactive Conferencing Applications: Develop conferencing applications with capabilities for real-time audio and video processing and decision-making.
- Remote Robotics Control: Remotely operate robots and receive real-time camera streams for advanced teleoperation.
Need Assistance with Pion WebRTC?
For in-depth knowledge of WebRTC beyond just APIs, check out WebRTC for the Curious. This book delves into the intricacies of ICE, SCTP, DTLS, SRTP, and their combined operation within the WebRTC stack. It’s an invaluable resource for debugging and mastering WebRTC technologies. Note that this resource is vendor-agnostic and does not contain Pion-specific information.
The Pion community is active and welcoming on Slack. Don’t hesitate to ask for help or share your projects – questions are welcome, even if they aren’t directly related to Pion. We are here to support your journey in real-time communication.
Sean-Der, a core maintainer of Pion, is available for consultations. Schedule a meeting at siobud.com/meeting to discuss Pion, general WebRTC inquiries, or any related topics. Feel free to reach out!
Key Features of Pion WebRTC
Comprehensive PeerConnection API
Pion WebRTC provides a complete Go implementation of the webrtc-pc and webrtc-stats specifications.
- DataChannels: Enable bidirectional data communication between peers.
- Audio and Video Support: Send and receive high-quality audio and video streams.
- Renegotiation: Dynamically adjust media sessions and connection parameters.
- Plan-B and Unified Plan Support: Compatible with both SDP semantics for flexibility in deployment.
- SettingEngine: Utilize SettingEngine for Pion-specific extensions and configurations, allowing for fine-grained control over WebRTC behavior.
Robust Connectivity Features
Pion WebRTC ensures reliable connectivity through a suite of features:
- Full ICE Agent: Handles NAT traversal and connection establishment using Interactive Connectivity Establishment.
- ICE Restart: Allows for restarting ICE negotiation to recover from network changes.
- Trickle ICE: Improves connection latency by sending ICE candidates incrementally.
- STUN Support: Session Traversal Utilities for NAT to discover public IP addresses.
- TURN Support: Traversal Using Relays around NAT (UDP, TCP, DTLS, and TLS) for relaying traffic when direct connections fail.
- mDNS Candidates: Multicast DNS candidates for local network peer discovery.
Flexible DataChannels
Pion WebRTC DataChannels offer versatile options for data delivery:
- Ordered and Unordered Delivery: Choose between guaranteed ordered delivery or faster, unordered delivery.
- Lossy and Lossless Transmission: Configure data channels for either reliable, lossless transmission or lower-latency, lossy transmission, depending on application needs.
Advanced Media Capabilities
Pion WebRTC provides extensive media processing and handling functionalities:
- Direct RTP/RTCP API: Gain low-level access to Real-time Transport Protocol and RTP Control Protocol for media transport.
- Packetizer Support: Includes packetizers for Opus, PCM, H264, VP8, and VP9 codecs.
- Custom Packetizer API: Developers can integrate their own packetizers for specialized media formats.
- Media File Formats: Supports IVF, Ogg, H264, and Matroska formats for easy media file handling.
- getUserMedia Implementation: Provides getUserMedia (Cgo required) for accessing local media devices.
- Integration with Media Libraries: Facilitates seamless integration with x264, libvpx, GStreamer, and ffmpeg for advanced media processing.
- Simulcast: Enables Simulcast for adaptive video streaming to multiple recipients with varying network conditions.
- SVC Support: Supports SVC (Scalable Video Coding) for VP9.
- NACK Implementation: Includes NACK (Negative Acknowledgement) for reliable RTP transmission.
- Sender and Receiver Reports: Provides Sender/Receiver Reports for RTCP-based quality monitoring.
- Transport-Wide Congestion Control Feedback: Implements Transport Wide Congestion Control Feedback for network congestion management.
- Bandwidth Estimation: Features Bandwidth Estimation for adaptive bitrate streaming.
Enhanced Security Features
Pion WebRTC prioritizes security with robust encryption protocols:
- DTLS 1.2 Support: Implements TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 and TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA for DTLS v1.2 encryption.
- SRTP Support: Supports SRTP_AEAD_AES_256_GCM and SRTP_AES128_CM_HMAC_SHA1_80 for SRTP media encryption.
- Hardware Acceleration: Leverages hardware acceleration for GCM suites to enhance performance.
Pure Go Advantage
Pion WebRTC’s pure Go implementation offers significant advantages:
- No Cgo Dependency: Eliminates the complexities and overhead of Cgo, simplifying builds and deployments.
- Broad Platform Compatibility: Supports a wide range of operating systems and architectures:
- Windows, macOS, Linux, FreeBSD
- iOS, Android
- WASM (see examples)
- 386, amd64, arm, mips, ppc64 architectures
- Fast Build Times: Enables rapid development cycles with quick compilation.
- Comprehensive Test Suite: Ensures reliability and stability through an extensive test suite.
- Performance Measurement Tools: Provides tools for performance analysis and optimization provided.
Pion WebRTC Roadmap
Pion WebRTC is under active development. Stay updated on upcoming features and milestones by following the roadmap. Explore the Big Ideas list for potential future enhancements and opportunities for contribution. Your ideas and contributions are welcome!
Sponsoring Pion WebRTC
The development of Pion’s congestion control and bandwidth estimation features was made possible through funding from the User-Operated Internet fund, supported by NLnet and financial contributions from the PKT Community/The Network Steward and stichting Technology Commons Trust.
Join the Pion Community
Engage with the vibrant Pion community on Slack for discussions, support, and collaboration.
Follow Pion Twitter for project updates and WebRTC news.
We are eager to support your projects! Contact us at [email protected] for commercial support or private assistance.
Contribute to Pion WebRTC
Become a contributor to Pion WebRTC! Refer to the contributing wiki to learn how you can join the community and help shape the future of Pion.
Pion WebRTC License
Pion WebRTC is licensed under the MIT License. See the LICENSE file for the full license text.
Alt text: Sourcegraph badge linking to Pion WebRTC code repository, indicating code search and navigation capabilities.
Alt text: Slack badge inviting users to join the Pion community on Slack for support and discussions.
Alt text: Twitter badge encouraging users to follow @_pion on Twitter for project updates and WebRTC news.
Alt text: Awesome Pion badge linking to a curated list of projects and resources related to Pion WebRTC and the Pion ecosystem.
Alt text: GitHub Workflow Status badge indicating the current build and test status of the Pion WebRTC project on GitHub Actions.
Alt text: Go Reference badge linking to GoDoc documentation for Pion WebRTC v4, providing API documentation.
Alt text: Codecov badge displaying the test coverage percentage for Pion WebRTC master branch, indicating code test coverage.
Alt text: Go Report Card badge showing the Go code quality score for Pion WebRTC v4, based on static analysis.
Alt text: MIT License badge indicating that Pion WebRTC is released under the permissive MIT License.