phpbg / mpegts
This is a pure PHP MPEG TS library, developed with performance in mind
Installs: 1 604
Dependents: 2
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 2
Open Issues: 0
Requires
- php: >=7.0
- evenement/evenement: ^3.0
- myclabs/php-enum: ^1.5
Requires (Dev)
- phpunit/phpunit: ^6.5
This package is auto-updated.
Last update: 2024-12-09 14:14:49 UTC
README
This is a pure PHP MPEG TS library, developed with performance in mind.
It provides tools for :
- Finding MPEG TS packets
- Converting MPEG TS packets to PES packets
- Filtering MPEG TS packets by PID
https://en.wikipedia.org/wiki/MPEG_transport_stream
Requirements
- PHP7+
Installation on ubuntu 16.04:
sudo apt install php7.0-cli
Additional you can install xdebug for development purposes:
sudo apt install php-xdebug
Examples
See examples/
folder
Tests
To run unit tests launch:
php vendor/phpunit/phpunit/phpunit -c phpunit.xml
NB: to report code coverage add --coverage-text
but keep in mind that launching with code coverage increase greatly the time required for tests to run (thus do not reflect real use case compute time)
Memo for creating TS sample files
- Open a TS file with wireshark
- Export a PCAP file containing only required packets
tshark -x -r test.pcap | sed -n 's/^[0-9a-f]*\s\(\(\s[0-9a-f][0-9a-f]\)\{1,16\}\).*$/\1/p' > test.hex
xxd -r -p test.hex test.bin