Skip to content

Commit 5967197

Browse files
committed
Public release
0 parents  commit 5967197

22 files changed

+3236
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea/
2+
/vendor
3+

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Samuel CHEMLA
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# PhpBg\MPEGTS
2+
3+
This is a pure PHP MPEG TS library, developed with performance in mind.
4+
5+
It provides tools for :
6+
* Finding MPEG TS packets
7+
* Converting MPEG TS packets to PES packets
8+
* Filtering MPEG TS packets by PID
9+
10+
https://en.wikipedia.org/wiki/MPEG_transport_stream
11+
12+
# Requirements
13+
* PHP7+
14+
15+
Installation on ubuntu 16.04:
16+
17+
sudo apt install php7.0-cli
18+
19+
Additional you can install xdebug for development purposes:
20+
21+
sudo apt install php-xdebug
22+
23+
24+
# Examples
25+
26+
See `examples/` folder
27+
28+
# Tests
29+
To run unit tests launch:
30+
31+
php vendor/phpunit/phpunit/phpunit -c phpunit.xml
32+
33+
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)
34+
35+
## Memo for creating TS sample files
36+
1. Open a TS file with wireshark
37+
2. Export a PCAP file containing only required packets
38+
3. `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`
39+
4. `xxd -r -p test.hex test.bin`

composer.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "phpbg/mpegts",
3+
"description": "This is a pure PHP MPEG TS library, developed with performance in mind",
4+
"type": "library",
5+
"license": "MIT",
6+
"keywords": ["mpeg", "mpegts", "dvb"],
7+
"authors": [
8+
{
9+
"name": "Samuel CHEMLA",
10+
"email": "[email protected]",
11+
"role": "Developer"
12+
}
13+
],
14+
"require": {
15+
"php": ">=7.0",
16+
"myclabs/php-enum": "^1.5",
17+
"evenement/evenement": "^3.0"
18+
},
19+
"require-dev": {
20+
"phpunit/phpunit": "^6.5"
21+
},
22+
"autoload": {
23+
"psr-4": {
24+
"PhpBg\\MpegTs\\": "src"
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)