First build

This commit is contained in:
Uula Ilola (LAB)
2026-05-20 12:04:28 +03:00
parent efeef41059
commit c1e9b5c575
8 changed files with 31 additions and 11 deletions
+2
View File
@@ -0,0 +1,2 @@
/build/**
/lib/yt-dlp
+6
View File
@@ -0,0 +1,6 @@
[submodule "lib/sys"]
path = lib/sys
url = https://go.googlesource.com/sys
[submodule "lib/fsnotify"]
path = lib/fsnotify
url = https://github.com/fsnotify/fsnotify.git
Binary file not shown.
Binary file not shown.
Submodule
+1
Submodule lib/fsnotify added at 20b1e15ef3
Submodule
+1
Submodule lib/sys added at 99666ae32e
+11 -8
View File
@@ -39,6 +39,9 @@ import (
// ── Configuration ────────────────────────────────────────────────────────────── // ── Configuration ──────────────────────────────────────────────────────────────
const ( const (
ffmpegBin = `C:\Users\x119877\ffmpeg\bin\ffmpeg.exe`
ffprobeBin = `C:\Users\x119877\ffmpeg\bin\ffprobe.exe`
frameInterval = 5 // Extract one key frame every N seconds frameInterval = 5 // Extract one key frame every N seconds
panelWidth = 320 // Each filmstrip panel width in px panelWidth = 320 // Each filmstrip panel width in px
panelHeight = 240 // Each filmstrip panel height in px panelHeight = 240 // Each filmstrip panel height in px
@@ -56,8 +59,8 @@ const (
vignetteAngle = "PI/4" vignetteAngle = "PI/4"
defaultExhibit = "Stories from the Community" defaultExhibit = "Stories from the Community"
fontBold = "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf" fontBold = `../lib/fonts/DejaVuSans-Bold.ttf`
fontRegular = "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" fontRegular = `../lib/fonts/DejaVuSans.ttf`
) )
// videoExtensions that trigger the watch pipeline // videoExtensions that trigger the watch pipeline
@@ -99,7 +102,7 @@ func run(label string, name string, args ...string) {
// probeFormat returns the "format" section from ffprobe as a map. // probeFormat returns the "format" section from ffprobe as a map.
func probeFormat(path string) map[string]interface{} { func probeFormat(path string) map[string]interface{} {
out, err := exec.Command( out, err := exec.Command(
"ffprobe", "-v", "quiet", "-print_format", "json", ffprobeBin, "-v", "quiet", "-print_format", "json",
"-show_format", "-show_streams", path, "-show_format", "-show_streams", path,
).Output() ).Output()
if err != nil { if err != nil {
@@ -167,7 +170,7 @@ func extractFrames(inputPath, framesDir string) []string {
panelWidth, panelHeight, panelWidth, panelHeight,
panelWidth, panelHeight, panelWidth, panelHeight,
) )
run("", "ffmpeg", "-y", "-i", inputPath, run("", ffmpegBin, "-y", "-i", inputPath,
"-vf", vf, "-q:v", "2", "-vf", vf, "-q:v", "2",
filepath.Join(framesDir, "frame_%04d.jpg"), filepath.Join(framesDir, "frame_%04d.jpg"),
) )
@@ -245,7 +248,7 @@ func buildFilmstrip(frames []string, tmpDir string) (stripPath string, stripW, s
stripPath, stripPath,
) )
run("Stitching panels with hstack…", "ffmpeg", args...) run("Stitching panels with hstack…", ffmpegBin, args...)
return stripPath, stripW, stripH return stripPath, stripW, stripH
} }
@@ -309,7 +312,7 @@ func composite(
}, ";") }, ";")
run("Rendering composite (this may take a while)…", run("Rendering composite (this may take a while)…",
"ffmpeg", "-y", ffmpegBin, "-y",
"-i", inputPath, "-i", inputPath,
"-i", stripPath, "-i", stripPath,
"-filter_complex", filterComplex, "-filter_complex", filterComplex,
@@ -328,7 +331,7 @@ func composite(
func archiveCopy(displayPath, archivePath string) { func archiveCopy(displayPath, archivePath string) {
log.Println("\n[4/5] Writing archive copy (ProRes HQ)...") log.Println("\n[4/5] Writing archive copy (ProRes HQ)...")
run("", run("",
"ffmpeg", "-y", ffmpegBin, "-y",
"-i", displayPath, "-i", displayPath,
"-c:v", "prores_ks", "-profile:v", "3", "-c:v", "prores_ks", "-profile:v", "3",
"-c:a", "pcm_s16le", "-c:a", "pcm_s16le",
@@ -507,4 +510,4 @@ func main() {
fmt.Printf("Unknown command %q. Use 'process' or 'watch'.\n", os.Args[1]) fmt.Printf("Unknown command %q. Use 'process' or 'watch'.\n", os.Args[1])
os.Exit(1) os.Exit(1)
} }
} }
+10 -3
View File
@@ -1,7 +1,14 @@
module booth module booth
go 1.26 go 1.25.0
require github.com/fsnotify/fsnotify v1.10.1 require github.com/fsnotify/fsnotify v1.7.0
require golang.org/x/sys v0.44.0 // indirect require golang.org/x/sys v0.35.0 // indirect
// Replace directives point the module resolver to your local copies.
// Paths are relative to this go.mod file adjust if your layout differs.
replace (
github.com/fsnotify/fsnotify => ../lib/fsnotify
golang.org/x/sys => ../lib/sys
)