danog / php-rtc-rtp
RTP packet and media transport handling for PHP, ported to Amp v3. MadelineProto's PHP 8.2+ fork supports optional media FFI in the modular danog/php-rtc stack.
Fund package maintenance!
Requires
- php: ^8.2
- amphp/amp: ^3.1
- amphp/pipeline: ^1
- danog/php-rtc-codecs: ^1.1.2
- danog/php-rtc-exception: ^1.0
- danog/php-rtc-ntp: ^1.0
- danog/php-rtc-rtcp: ^1.0
- danog/php-rtc-rtp-parameter: ^1.0
- danog/php-rtc-sdp: ^1.0
- danog/php-rtc-stats: ^1.0
- ramsey/uuid: ^4.7
Requires (Dev)
- dg/bypass-finals: dev-master
- phpunit/phpunit: ^13.0
- symfony/phpunit-bridge: 7.3.x-dev
README
A PHP library for handling RTP (Real-time Transport Protocol) packets. This package provides tools for encoding, decoding, parsing, and analyzing RTP streams—useful for WebRTC, VoIP, and media streaming applications.
About this fork
This is the danog/php-rtc-rtp fork used by MadelineProto. It targets PHP 8.2+, ports media scheduling from ReactPHP promises to Amp v3 fibers and Revolt timers, avoids busy-loop polling, and reports voice activity through the negotiated RTP audio-level extension. Already-encoded media can be packetized without FFI.
All internal Composer dependencies use their danog/php-rtc-* package names directly, so installing a component selects the maintained danog packages throughout the dependency graph.
Features
- Encode and decode RTP packets
- Extract RTP header fields
- Support for common RTP payload types
Requirements
- PHP ≥ 8.2
- FFI and native codec libraries only when encoding, decoding, or transcoding media
- Linux (Windows and macOS support planned for future releases)
- FFmpeg/libav shared libraries (libavcodec, libavfilter, etc.)
- Compatible with FFmpeg version 7.1.1
- libopus development libraries
- libvpx development libraries
- Compatible with libvpx version 1.15.0
Documentation
This package is part of the PHP WebRTC library. For complete documentation, examples, and API reference, visit:
Credits
Authors
-
Amin Yazdanpanah
- Website: aminyazdanpanah.com
- Email: github@aminyazdanpanah.com
-
Sana Moniri
- GtiHub: sanamoniri
Reporting Issues
Found a bug? Please report it on our issues.
License
BSD 3-Clause License. See LICENSE for details.