Complete documentation for building and running VideoTools: Sections: • Quick start (2-minute setup) • Making VideoTools permanent (bash/zsh setup) • Script documentation (what each does) • Build requirements and versions • Troubleshooting guide • Development workflow • DVD encoding complete workflow • Performance notes • Production deployment guide • Getting help and reporting issues Easy setup: source scripts/alias.sh VideoTools That's all users need to run the application!
6.8 KiB
VideoTools - Build and Run Guide
Quick Start (2 minutes)
Option 1: Using the Convenience Script (Recommended)
cd /home/stu/Projects/VideoTools
source scripts/alias.sh
VideoTools
This will:
- Load the convenience commands
- Build the application (if needed)
- Run VideoTools GUI
Available commands after sourcing alias.sh:
VideoTools- Run the applicationVideoToolsRebuild- Force a clean rebuildVideoToolsClean- Clean all build artifacts
Option 2: Using build.sh Directly
cd /home/stu/Projects/VideoTools
bash scripts/build.sh
./VideoTools
Option 3: Using run.sh
cd /home/stu/Projects/VideoTools
bash scripts/run.sh
Making VideoTools Permanent (Optional)
To use VideoTools command from anywhere in your terminal:
For Bash users:
Add this line to ~/.bashrc:
source /home/stu/Projects/VideoTools/scripts/alias.sh
Then reload:
source ~/.bashrc
For Zsh users:
Add this line to ~/.zshrc:
source /home/stu/Projects/VideoTools/scripts/alias.sh
Then reload:
source ~/.zshrc
After setting up:
From any directory, you can simply type:
VideoTools
What Each Script Does
build.sh
bash scripts/build.sh
Purpose: Builds VideoTools from source with full dependency management
What it does:
- Checks if Go is installed
- Displays Go version
- Cleans previous builds and cache
- Downloads and verifies all dependencies
- Builds the application
- Shows output file location and size
When to use:
- First time building
- After major code changes
- When you want a clean rebuild
- When dependencies are out of sync
Exit codes:
0= Success1= Build failed (check errors above)
run.sh
bash scripts/run.sh
Purpose: Runs VideoTools, building first if needed
What it does:
- Checks if binary exists
- If binary missing, runs
build.sh - Verifies binary was created
- Launches the application
When to use:
- Every time you want to run VideoTools
- When you're not sure if it's built
- After code changes (will rebuild if needed)
Advantages:
- Automatic build detection
- No manual steps needed
- Always runs the latest code
alias.sh
source scripts/alias.sh
Purpose: Creates convenient shell commands
What it does:
- Adds
VideoToolscommand (alias forscripts/run.sh) - Adds
VideoToolsRebuildfunction - Adds
VideoToolsCleanfunction - Prints help text
When to use:
- Once per shell session
- Add to ~/.bashrc or ~/.zshrc for permanent access
Commands created:
VideoTools # Run the app
VideoToolsRebuild # Force rebuild
VideoToolsClean # Remove build artifacts
Build Requirements
Required:
- Go 1.21 or later
If not installed: https://golang.org/dlgo version
Recommended:
- At least 2 GB free disk space (for dependencies)
- Stable internet connection (for downloading dependencies)
Optional:
- FFmpeg (for actual video encoding)
ffmpeg -version
Troubleshooting
Problem: "Go is not installed"
Solution:
- Install Go from https://golang.org/dl
- Add Go to PATH: Add
/usr/local/go/binto your$PATH - Verify:
go version
Problem: Build fails with "CGO_ENABLED" error
Solution: The script already handles this with CGO_ENABLED=0. If you still get errors:
export CGO_ENABLED=0
bash scripts/build.sh
Problem: "Permission denied" on scripts
Solution:
chmod +x scripts/*.sh
bash scripts/build.sh
Problem: Out of disk space
Solution: Clean the cache
bash scripts/build.sh
# Or manually:
go clean -cache -modcache
Problem: Outdated dependencies
Solution: Clean and rebuild
rm -rf go.mod go.sum
go mod init git.leaktechnologies.dev/stu/VideoTools
bash scripts/build.sh
Problem: Binary won't run
Solution: Check if it was built:
ls -lh VideoTools
file VideoTools
If missing, rebuild:
bash scripts/build.sh
Development Workflow
Making code changes and testing:
# After editing code, rebuild and run:
VideoToolsRebuild
VideoTools
# Or in one command:
bash scripts/build.sh && ./VideoTools
Quick test loop:
# Terminal 1: Watch for changes and rebuild
while true; do bash scripts/build.sh; sleep 2; done
# Terminal 2: Test the app
VideoTools
DVD Encoding Workflow
To create a professional DVD video:
-
Start the application
VideoTools -
Go to Convert module
- Click the Convert tile from main menu
-
Load a video
- Drag and drop, or use file browser
-
Select DVD format
- Choose "DVD-NTSC (MPEG-2)" or "DVD-PAL (MPEG-2)"
- DVD options appear automatically
-
Choose aspect ratio
- Select 4:3 or 16:9
-
Name output
- Enter filename (without .mpg extension)
-
Add to queue
- Click "Add to Queue"
-
Start encoding
- Click "View Queue" → "Start Queue"
-
Use output file
- Output:
filename.mpg - Import into DVDStyler
- Author and burn to disc
- Output:
Output specifications:
NTSC:
- 720×480 @ 29.97fps
- MPEG-2 video
- AC-3 stereo audio @ 48 kHz
- Perfect for USA, Canada, Japan, Australia
PAL:
- 720×576 @ 25 fps
- MPEG-2 video
- AC-3 stereo audio @ 48 kHz
- Perfect for Europe, Africa, Asia
Both output region-free, DVDStyler-compatible, PS2-compatible video.
Performance Notes
Build time:
- First build: 30-60 seconds (downloads dependencies)
- Subsequent builds: 5-15 seconds (uses cached dependencies)
- Rebuild with changes: 10-20 seconds
File sizes:
- Binary: ~35 MB (optimized)
- With dependencies in cache: ~1 GB total
Runtime:
- Startup: 1-3 seconds
- Memory usage: 50-150 MB depending on video complexity
- Encoding speed: Depends on CPU and video complexity
Production Use
For production deployment:
# Create optimized binary
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o VideoTools
# Verify it works
./VideoTools
# File size will be smaller with -ldflags
ls -lh VideoTools
Getting Help
Check the documentation:
DVD_USER_GUIDE.md- How to use DVD encodingDVD_IMPLEMENTATION_SUMMARY.md- Technical detailsREADME.md- Project overview
Debug a build:
# Verbose output
bash scripts/build.sh 2>&1 | tee build.log
# Check go environment
go env
# Verify dependencies
go mod graph
Report issues:
Include:
- Output from
go version - OS and architecture (
uname -a) - Exact error message
- Steps to reproduce
Summary
Easiest way:
cd /home/stu/Projects/VideoTools
source scripts/alias.sh
VideoTools
That's it! The scripts handle everything else automatically.