[no ci] add go2rtc package (#1204)

Co-authored-by: Signor Pellegrino <68112357+FlyRouter@users.noreply.github.com>
pull/1208/head
gtxaspec 2023-12-21 13:10:18 -08:00 committed by GitHub
parent 601872d835
commit 835f1e2909
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 71 additions and 0 deletions

View File

@ -109,3 +109,4 @@ source "$BR2_EXTERNAL_GENERAL_PATH/package/xiongmai-osdrv-xm530/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/xmdp/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/yaml-cli/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/zerotier-one/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/go2rtc/Config.in"

View File

@ -0,0 +1,7 @@
config BR2_PACKAGE_GO2RTC
bool "go2rtc streamer"
default n
help
Ultimate camera streaming application with support RTSP, WebRTC, HomeKit, FFmpeg, RTMP, etc.
Note: Binary will be UPX Compressed, binary size ~3.4mb
https://github.com/AlexxIT/go2rtc

View File

@ -0,0 +1,20 @@
log:
level: info # default level
api: trace
exec: debug
ngrok: info
rtsp: warn
streams: error
webrtc: fatal
rtsp:
listen: ":8553"
webrtc:
candidates:
- stun:8555
streams:
openipc_jpeg: http://username:password@127.0.0.1/image.jpg
openipc_rtsp-1: rtsp://username:password@127.0.0.1/stream=0
openipc_rtsp-2: rtsp://username:password@127.0.0.1/stream=1

View File

@ -0,0 +1,43 @@
################################################################################
#
# go2rtc
#
################################################################################
GO2RTC_VERSION = master
GO2RTC_SITE = $(call github,AlexxIT,go2rtc,$(GO2RTC_VERSION))
GO2RTC_LICENSE = MIT
GO2RTC_LICENSE_FILES = LICENSE
GO2RTC_INSTALL_TARGET = YES
GO2RTC_DEPENDENCIES = host-go host-upx
GO2RTC_GO_LDFLAGS = -s -w
define GO2RTC_BUILD_CMDS
GOARCH=$$( \
case $(BR2_ARCH) in \
x86) echo 386 ;; \
x86_64) echo amd64 ;; \
arm) echo arm ;; \
aarch64) echo arm64 ;; \
mips) echo mips ;; \
mipsel) echo mipsle ;; \
*) echo "Unsupported architecture: $(BR2_ARCH)" && exit 1 ;; \
esac \
); \
echo "Building for GOARCH: $$GOARCH"; \
(cd $(@D); \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=$$GOARCH \
go build -ldflags "$(GO2RTC_GO_LDFLAGS)")
endef
define GO2RTC_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0755 $(@D)/go2rtc $(TARGET_DIR)/usr/bin/go2rtc
upx --best --lzma $(TARGET_DIR)/usr/bin/go2rtc
$(INSTALL) -m 644 -t $(TARGET_DIR)/etc/ $(GO2RTC_PKGDIR)/files/go2rtc.yaml
endef
$(eval $(golang-package))