mirror of
https://github.com/AlexxIT/go2rtc.git
synced 2026-04-22 23:57:20 +08:00
WebSocket
Endpoint: /api/ws
Query parameters:
src(required) - Stream name
WebRTC
Request SDP:
{"type":"webrtc/offer","value":"v=0\r\n..."}
Response SDP:
{"type":"webrtc/answer","value":"v=0\r\n..."}
Request/response candidate:
- empty value also allowed and optional
{"type":"webrtc/candidate","value":"candidate:3277516026 1 udp 2130706431 192.168.1.123 54321 typ host"}
MSE
Request:
- codecs list optional
{"type":"mse","value":"avc1.640029,avc1.64002A,avc1.640033,hvc1.1.6.L153.B0,mp4a.40.2,mp4a.40.5,flac,opus"}
Response:
{"type":"mse","value":"video/mp4; codecs=\"avc1.64001F,mp4a.40.2\""}
HLS
Request:
{"type":"hls","value":"avc1.640029,avc1.64002A,avc1.640033,hvc1.1.6.L153.B0,mp4a.40.2,mp4a.40.5,flac"}
Response:
- you MUST rewrite full HTTP path to
http://192.168.1.123:1984/api/hls/playlist.m3u8
{"type":"hls","value":"#EXTM3U\n#EXT-X-STREAM-INF:BANDWIDTH=1000000,CODECS=\"avc1.64001F,mp4a.40.2\"\nhls/playlist.m3u8?id=DvmHdd9w"}
MJPEG
Request/response:
{"type":"mjpeg"}