streamd: optional keys, per-stream proxy, auto deps; agent module.yaml sync; RTE AutoPlay; Telegram release announces
- streamd: MPD-only start, proxy field, ffmpeg/NRE/mp4decrypt auto-install - GET/PUT /api/modules for module.yaml sync; agent sync_modules - RTE Live-tab AutoPlay fixes; modules zip named bbc/rte/tg4.zip - Telegram notify scripts wired into Forgejo release workflows
This commit is contained in:
parent
f9c28be3f1
commit
ac8701b5a6
36 changed files with 1460 additions and 143 deletions
50
apps/streamd/internal/deps/fetch_mp4decrypt.go
Normal file
50
apps/streamd/internal/deps/fetch_mp4decrypt.go
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
package deps
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
// Official Bento4 SDK binaries from bento4.com (v1.6.0-641).
|
||||
// linux/arm64 and windows/arm64 are not published there — clear error.
|
||||
func fetchMP4Decrypt(binDir string, logf func(string, ...any)) (string, error) {
|
||||
url, archiveName, err := bento4URL()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
archivePath := filepath.Join(binDir, archiveName)
|
||||
if err := downloadTo(url, archivePath, logf); err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer func() { _ = os.Remove(archivePath) }()
|
||||
|
||||
want := "mp4decrypt"
|
||||
if runtime.GOOS == "windows" {
|
||||
want = "mp4decrypt.exe"
|
||||
}
|
||||
dest := filepath.Join(binDir, want)
|
||||
if err := extractNamed(archivePath, binDir, want, dest); err != nil {
|
||||
return "", err
|
||||
}
|
||||
chmodX(dest)
|
||||
return dest, nil
|
||||
}
|
||||
|
||||
func bento4URL() (url, archiveName string, err error) {
|
||||
const base = "https://www.bok.net/Bento4/binaries/"
|
||||
switch runtime.GOOS + "/" + runtime.GOARCH {
|
||||
case "windows/amd64":
|
||||
name := "Bento4-SDK-1-6-0-641.x86_64-microsoft-win32.zip"
|
||||
return base + name, name, nil
|
||||
case "linux/amd64":
|
||||
name := "Bento4-SDK-1-6-0-641.x86_64-unknown-linux.zip"
|
||||
return base + name, name, nil
|
||||
case "darwin/amd64", "darwin/arm64":
|
||||
name := "Bento4-SDK-1-6-0-641.universal-apple-macosx.zip"
|
||||
return base + name, name, nil
|
||||
default:
|
||||
return "", "", fmt.Errorf("no Bento4 binary for %s/%s (place mp4decrypt in bin/ manually)", runtime.GOOS, runtime.GOARCH)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue