分享一个牛逼的rtsp库-gortsplib

开源库地址

基于go的开源流媒体库:
https://gitee.com/kingecg/gortsplib

概述

这个库里面有好多demo代码,根据demo代码可以很容易实现想要的功能,非常简单易用,如果你不熟悉go语言,可以把demo代码丢给AI,告诉它你的需求,它可以帮你修改,你只需要验证测试……

demo预览

client-query
client-play
client-play-timestamp
client-play-options
client-play-pause
client-play-to-record
client-play-backchannel
client-play-format-av1
client-play-format-g711
client-play-format-g722
client-play-format-h264
client-play-format-h264-convert-to-jpeg
client-play-format-h264-save-to-disk
client-play-format-h264-mpeg4audio-save-to-disk
client-play-format-h265
client-play-format-h265-convert-to-jpeg
client-play-format-h265-save-to-disk
client-play-format-lpcm
client-play-format-mjpeg
client-play-format-mpeg4audio
client-play-format-mpeg4audio-save-to-disk
client-play-format-opus
client-play-format-opus-save-to-disk
client-play-format-vp8
client-play-format-vp9
client-record-options
client-record-pause
client-record-format-g711
client-record-format-g722
client-record-format-h264
client-record-format-h264-from-disk
client-record-format-h265
client-record-format-lpcm
client-record-format-mjpeg
client-record-format-mjpeg-from-image
client-record-format-mpeg4audio
client-record-format-opus
client-record-format-vp8
client-record-format-vp9
server
server-tls
server-h264-save-to-disk
proxy

视频格式支持

codecdocumentationencoder and decoder available
AV1link✔️
VP9link✔️
VP8link✔️
H265link✔️
H264link✔️
MPEG-4 Video (H263, Xvid)link✔️
MPEG-1/2 Videolink✔️
M-JPEGlink✔️

问题处理

针对不同的摄像机进行测试,有一个海康、大华都没问题,有个不知名的小摄像机会报如下错误:

2024/11/22 09:07:52 RTP packet is too big to be read with UDP
2024/11/22 09:07:52 RTP packet is too big to be read with UDP
2024/11/22 09:07:52 RTP packet is too big to be read with UDP
2024/11/22 09:07:52 RTP packet is too big to be read with UDP
2024/11/22 09:07:52 RTP packet is too big to be read with UDP

这个通过修改constants.go文件,将udp的MTU(udpMaxPayloadSize)增大一些:
在这里插入图片描述
修改后测试正常没有报错了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

fensnote

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值