From ae4ae486c002574161193fd8a7cb8b7dd15b8044 Mon Sep 17 00:00:00 2001 From: wanghaoxi3000 Date: Wed, 18 Dec 2019 02:15:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=B3=A8=E9=87=8A=E5=92=8C?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++++++ service/rtsptrans.go | 1 + 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 094b869..2d088b8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,12 @@ # gin-rtsp +## 测试 +/stream/play +``` +{ + "url":"rtsp://admin:admin@192.168.1.11:554/cam/realmonitor?channel=1&subtype=0" +} +``` + ## 参考 [JSMpeg – MPEG1 Video & MP2 Audio Decoder in JavaScript](https://github.com/phoboslab/jsmpeg/) \ No newline at end of file diff --git a/service/rtsptrans.go b/service/rtsptrans.go index 3fb689b..46c7549 100644 --- a/service/rtsptrans.go +++ b/service/rtsptrans.go @@ -34,6 +34,7 @@ func (service *RTSPTransSrv) Service() *serializer.Response { } } + // 多个客户端需要播放相同的RTSP流地址时,保证返回WebSocket地址相同 processCh := uuid.NewV3(uuid.NamespaceURL, splitList[1]).String() if ch, ok := processMap.Load(processCh); ok { *ch.(*chan int) <- 1