Browse Source

rewrite OpenWrt installation procedure (#2794)

Forward users to standalone binaries whey they are available for their
architecture, otherwise send them to instructions on how to compile
from source.
pull/2795/head
Alessandro Ros 1 year ago committed by GitHub
parent
commit
5ee26130d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 65
      README.md
  2. 36
      openwrt.mk

65
README.md

@ -74,7 +74,7 @@ _rtsp-simple-server_ has been rebranded as _MediaMTX_. The reason is pretty obvi @@ -74,7 +74,7 @@ _rtsp-simple-server_ has been rebranded as _MediaMTX_. The reason is pretty obvi
* [Standalone binary](#standalone-binary)
* [Docker image](#docker-image)
* [Arch Linux package](#arch-linux-package)
* [OpenWRT package](#openwrt-package)
* [OpenWrt binary](#openwrt-binary)
* [Basic usage](#basic-usage)
* [Publish to the server](#publish-to-the-server)
* [By software](#by-software)
@ -136,11 +136,11 @@ _rtsp-simple-server_ has been rebranded as _MediaMTX_. The reason is pretty obvi @@ -136,11 +136,11 @@ _rtsp-simple-server_ has been rebranded as _MediaMTX_. The reason is pretty obvi
## Installation
There are several installation methods available: standalone binary, Docker image, Arch Linux package and OpenWRT package.
There are several installation methods available: standalone binary, Docker image, Arch Linux package and OpenWrt binary.
### Standalone binary
1. Download and extract a standalone binary from the [release page](https://github.com/bluenviron/mediamtx/releases).
1. Download and extract a standalone binary from the [release page](https://github.com/bluenviron/mediamtx/releases) that corresponds to your operating system and architecture.
2. Start the server:
@ -192,39 +192,11 @@ cd mediamtx @@ -192,39 +192,11 @@ cd mediamtx
makepkg -si
```
### OpenWRT package
### OpenWrt binary
1. In a x86 Linux system, download the OpenWRT SDK corresponding to the wanted OpenWRT version and target from the [OpenWRT website](https://downloads.openwrt.org/releases/) and extract it.
If the architecture of the OpenWrt device is amd64, armv6, armv7 or arm64, use the [standalone binary method](#standalone-binary) and download a Linux binary that corresponds to your architecture.
2. Open a terminal in the SDK folder and setup the SDK:
```sh
./scripts/feeds update -a
./scripts/feeds install -a
make defconfig
```
3. Download the server Makefile and set the server version inside the file:
```sh
mkdir package/mediamtx
wget -O package/mediamtx/Makefile https://raw.githubusercontent.com/bluenviron/mediamtx/main/openwrt.mk
sed -i "s/v0.0.0/$(git ls-remote --tags --sort=v:refname https://github.com/bluenviron/mediamtx | tail -n1 | sed 's/.*\///; s/\^{}//')/" package/mediamtx/Makefile
```
4. Compile the server:
```sh
make package/mediamtx/compile -j$(nproc)
```
5. Transfer the .ipk file from `bin/packages/*/base` to the OpenWRT system
6. Install it with:
```sh
opkg install [ipk-file-name].ipk
```
Otherwise, [compile the server from source](#openwrt).
## Basic usage
@ -1666,10 +1638,12 @@ where secret is the secret of the TURN server. MediaMTX will generate a set of c @@ -1666,10 +1638,12 @@ where secret is the secret of the TURN server. MediaMTX will generate a set of c
### Standard
Install Go ≥ 1.21, download the repository, open a terminal in it and run:
Install git and Go ≥ 1.21. Clone the repository, enter into the folder and start the building process:
```sh
go build .
git clone https://github.com/bluenviron/mediamtx
cd mediamtx
CGO_ENABLED=0 go build .
```
The command will produce the `mediamtx` binary.
@ -1694,6 +1668,25 @@ go build -tags rpicamera . @@ -1694,6 +1668,25 @@ go build -tags rpicamera .
The command will produce the `mediamtx` binary.
### OpenWrt
The compilation procedure is the same as the standard one. On the OpenWrt device, install git and Go:
```sh
opkg update
opkg install golang git git-http
```
Clone the repository, enter into the folder and start the building process:
```sh
git clone https://github.com/bluenviron/mediamtx
cd mediamtx
CGO_ENABLED=0 go build .
```
The command will produce the `mediamtx` binary.
### Compile for all supported platforms
Install Docker and launch:

36
openwrt.mk

@ -1,36 +0,0 @@ @@ -1,36 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mediamtx
PKG_VERSION:=v0.0.0
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/bluenviron/mediamtx
PKG_SOURCE_VERSION:=$(PKG_VERSION)
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
GO_PKG:=github.com/bluenviron/mediamtx
GO_PKG_LDFLAGS_X:=github.com/bluenviron/mediamtx/internal/core.version=$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
GO_MOD_ARGS:=-buildvcs=false
define Package/mediamtx
SECTION:=net
CATEGORY:=Network
TITLE:=mediamtx
URL:=https://github.com/bluenviron/mediamtx
DEPENDS:=$(GO_ARCH_DEPENDS)
endef
define Package/mediamtx/description
ready-to-use server and proxy that allows users to publish, read and proxy live video and audio streams through various protocols
endef
$(eval $(call GoBinPackage,mediamtx))
$(eval $(call BuildPackage,mediamtx))
Loading…
Cancel
Save