deepch / RTSPtoWebRTC

RTSP to WebRTC use Pion WebRTC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running installation script

rshapira1 opened this issue · comments

Running on pi 4 running Debian GNU/Linux 11 (bullseye) 64 Bit version using Raspberry pi imager.
I'm trying to run the script $ GO111MODULE=on go run *.go
After it downloading bunch of files I get this error:

gcc: error: unrecognized command-line option '-marm'.

my gcc version gcc (Debian 10.2.1-6) 10.2.1 20210110
go: go version go1.21.1 linux/arm

My environment:
SHELL=/bin/bash
NO_AT_BRIDGE=1
PWD=/home/pi/RTSPtoWeb
LOGNAME=pi
XDG_SESSION_TYPE=tty
MOTD_SHOWN=pam
HOME=/home/pi
LANG=en_GB.UTF-8
LS_COLORS: ...........
SSH_CONNECTION=192.168.1.203 52727 192.168.1.215 22
XDG_SESSION_CLASS=user
TERM=xterm
USER=pi
SHLVL=1
XDG_SESSION_ID=4
XDG_RUNTIME_DIR=/run/user/1000
SSH_CLIENT=192.168.1.203 52727 22
PATH=/home/pi/.local/share/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
SSH_TTY=/dev/pts/0
OLDPWD=/home/pi
GOPATH=/home/pi/.local/share/go
TEXTDOMAIN=Linux-PAM
_=/usr/bin/printenv

I added those line
CGO_ENABLED=1
CC=aarch64-linux-gnu-gcc
GOOS=linux GOARCH=arm64
GOARM=
GOMIPS=
GOMIPS64=

However, i still getting the same error, Furthermore, looking for instruction how to install the package on PI since I understand that the gcc doesn't support the -marm on arm.

I managed to run the app on Raspberry Pi using docker
You can just containerize the app for arm-based systems

FROM --platform=linux/arm64 golang:1.18

WORKDIR /go/src/app
COPY .  .

RUN go get -d -v ./...
RUN go install -v ./...

EXPOSE 8083

ENV GO111MODULE=on
ENV GIN_MODE=release

CMD go run *.go

and run it this with docker-compose for example:

version: "3.7"

services:
  webrtc:
    image: your-repo/your-image:your-tag
    container_name: rtsp-to-webrtc
    network_mode: host
    restart: always