# rtsp_convert **Repository Path**: baixiantao/rtsp_convert ## Basic Information - **Project Name**: rtsp_convert - **Description**: 解决rtsp不能直接在前端页面播放的问题,使用go语言开发了一个websocket服务,将rtsp地址转换为前端页面可播放的格式 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2025-01-10 - **Last Updated**: 2025-11-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: 视频流处理 ## README ### rtsp地址转换为html页面可播放的websocket地址 ## 背景 为了解决rtsp不能直接自html播放的问题,使用go语言开发了一个转换服务,将rtsp地址转换为前端页面可播放的格式 ## 1、rtsp在传入前使用window.btoa进行编码 ## 2、端口为8100,端口可自行修改,在main.go中56行修改 ## 3、接口地址为/rtsp参数为url,值为rtsp地址经过window.btoa编码后的值 ## 4、传入rtsp的地址示例: `ws://127.0.0.1:8100/rtsp?url=cnRzcDovL2FkbWluOmR4ei0yMDIzQDE5Mi4xNjguMC42NDo1NTQvU3RyZWFtaW5nL0NoYW5uZWxzLzEwMQ==` ## 4、图片 ![img.png](img.png) ## 5、开发环境 1.golang版本:go1.22.3 2.ffmpeg版本:ffmpeg version N-113384-g9da0594f1d-20240120 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 13.2.0 (crosstool-NG 1.25.0.232_c175b21),其实ffmpeg没啥版本要求,只要能用就行 3.系统:windows(win10、win11),macos(未测试),linux(未测试)