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
- 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
See examples/
folder
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)
- 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