logo
0
0
WeChat Login
Willzen<willzen@yeah.net>
mac: static link liblgplayer, eliminate dyld rpath issue

Go Player (Go CLI, cross-platform)

Overview

  • This is a Go CLI replacement for legacy_player (DuiLib).
  • Playback uses the existing core (lgplayercore) via cgo.
  • Video is rendered by the core SDL renderer in its own window.

Build requirements

  • Go 1.20+
  • SDL2 + SDL2_ttf development libraries
  • FFmpeg development libraries (avcodec/avformat/avutil/swscale/swresample)
  • The core library must be built in ./native/build* according to the OS (see go/lgplayer/lgplayer.go for link flags).

macOS notes

  • Install deps with Homebrew:
    • brew install sdl2 sdl2_image sdl2_ttf ffmpeg pkg-config
  • live555 on macOS:
    • Bundled go_player/third_party/live555 is Windows-only (VS project).
    • Use official live555 source, then pass -DLIVE555_ROOT=... to CMake.
  • Build native core:
    • cmake -S go_player/native -B go_player/native/build-macos
    • cmake --build go_player/native/build-macos
  • Optional universal build:
    • cmake -S go_player/native -B go_player/native/build-macos -DLGPLAYER_OSX_UNIVERSAL=ON
  • Helper script (builds, copies dylibs into ./bin, runs):
    • bash go_player/run_macos.sh

Run

  • Windows example: go run ./cmd/go_player -url rtsp://10.10.0.117:30003/desktop -cport 30004 ^ -user u001 -pass p001 -term desktop -playarg "imagelevel#1#platform#1"

CLI options (same as legacy_player/legacy_cli) -url <rtsp_url> -ip (builds rtsp://:/desktop) -port <rtsp_port> (default 554) -cport <ctrl_port> -user -pass

-term -orient <0|1> -stall <sec> -playarg <arg> -list ip:port#.. (accepted for compatibility; not used by core) -auth (force auth) -rtsp_tcp (rtsp over tcp, default true) -noaudio (disable audio) -heartbeat (append heartbeat to playarg) -json (legacy JSON payload) -uibottom (show bottom control bar, default true)

Notes

  • The window title uses -term or the RTSP host.