https://github.com/monibuca/plugin-ps
handle mpeg-ps stream for monibuca
https://github.com/monibuca/plugin-ps
Last synced: 12 months ago
JSON representation
handle mpeg-ps stream for monibuca
- Host: GitHub
- URL: https://github.com/monibuca/plugin-ps
- Owner: Monibuca
- License: apache-2.0
- Created: 2023-05-05T11:10:57.000Z (about 3 years ago)
- Default Branch: v4
- Last Pushed: 2024-09-13T05:43:23.000Z (over 1 year ago)
- Last Synced: 2025-04-05T17:51:08.653Z (about 1 year ago)
- Language: Go
- Size: 55.7 KB
- Stars: 1
- Watchers: 1
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.en.md
- License: LICENSE
Awesome Lists containing this project
README
_[简体中文](https://github.com/Monibuca/plugin-ps) | English_
# PS Plugin
enable receive MpegPS stream
## Plugin Address
https://github.com/Monibuca/plugin-ps
## Plugin Import
```go
import ( _ "m7s.live/plugin/ps/v4" )
```
## Default Config
```yaml
ps:
http: # format refer to global config
publish: # format refer to global config
publish: # format refer to global config
relaymode: 1 # 0:relay only 1:protocol transfar only 2:relay and protocol transfar
```
## API
### receive PS stream
`/ps/api/receive?streamPath=xxx&ssrc=xxx&port=xxx&reuse=1&dump=xxx`
- reuse means whether to reuse port, if reuse port, please make sure the ssrc from device is same as ssrc parameter, otherwise it will cause mixed stream
- dump means whether to dump to file, if dump to file, it will generate a folder named dump in current directory, the folder contains a file named by streamPath parameter, the file content is the data received from port [4byte content length][2byte relative time][content]
### replay PS dump file
`/ps/api/replay?streamPath=xxx&dump=xxx`
- dump means the file to replay, default is dump/ps
- streamPath means the streamPath of replayed video stream, default is replay/dump/ps (if dump is abc, then streamPath is replay/abc)
### read PS stream by ws protocol
`ws://[host]/ps/[streamPath]`
for example: ws://localhost:8080/ps/live/test
the data is raw PS data, without rtp header