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.3
- amphp/pipeline: ^1.2.7
- danog/php-rtc-codecs: ^1.1.7
- danog/php-rtc-exception: ^1.1.5
- danog/php-rtc-mixin: ^2.0
- danog/php-rtc-ntp: ^1.1.6
- danog/php-rtc-rtcp: ^1.1.4
- danog/php-rtc-rtp-parameter: ^1.1.4
- danog/php-rtc-sdp: ^1.1.6
- danog/php-rtc-stats: ^1.1.3
- ramsey/uuid: ^4.9.3
- symfony/polyfill-php83: *
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.9.1
- dg/bypass-finals: dev-master
- phpunit/phpunit: ^11.5 || ^12.0 || ^13.3.2
- symfony/phpunit-bridge: 7.3.x-dev
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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.