Overview
Studio provides multiple methods for publishing media events from devices, including file-based uploads, direct HTTP uploads, and automatic harvesting. It supports any file type with optional thumbnails and configurable device actions.Configuration
Docker Compose
Environment variables
| Variable | Description | Default |
|---|---|---|
PORT | Service port | 8001 |
POCKETBASE_URL | PocketBase connection URL | Required |
JOYSTICK_API_URL | Joystick service URL | Required |
Directory structure
Studio creates a directory structure for each device:Features
Flexible media support
- Any file type - Images, videos, audio, documents, and more
- Optional thumbnails - Works with devices that don’t generate thumbnails
- Media type detection - Automatic classification based on file extensions
- File size tracking - Monitors file sizes and metadata
Dynamic device actions
- Configurable actions - Use any PocketBase-configured action
- Fallback actions - Tries
list-events,list-files,list-media - Parameter templating - Support for dynamic parameters in commands
- Flexible output parsing - Handles various output formats
Event publishing methods
- File-based upload - Directory-based file upload system
- Harvesting - Automatic polling of device events
- Direct upload - HTTP POST endpoint with files
- URL-based upload - Pre-signed URLs for secure uploads
API endpoints
Media management
Get device paths
List events
Start service
Stop service
Get status
Pull event
Get statistics
Delete event
Event upload
Direct upload
Get upload URL
Hook management
List hooks
Create hook
Update hook
Delete hook
File watcher management
Get watcher status
Refresh watchers
Sync watchers
Add device watcher
Remove watcher
Hook event types
Studio supports 7 hook event types:after_event_pulled- After event pulled from deviceafter_all_events_pulled- After all events in batch processedafter_event_processed- After event processed and storedafter_thumbnail_generated- After thumbnail generatedon_file_detected- When new file detected in incoming directoryon_error- When error occurs during processingon_service_start- When media service starts for device
File-based upload workflow
- Get device paths
- Copy event file to incoming directory
- Optionally copy thumbnail with same name
- Studio detects new file
- Creates gallery record with metadata
- Moves file to processed directory
- Triggers appropriate hooks
Parameter templating
Action commands support dynamic parameter injection:{{device_id}}- Current device ID{{event_name}}- Event filename{{media_type}}- Media type (image, video, audio){{file_path}}- Full file path{{timestamp}}- Current timestamp{{date}}- Current date (YYYY-MM-DD)
Device action examples
List events
Remove events
File watcher system
Studio automatically manages file watchers for all devices:- Auto-initialization - Watchers created on startup
- Periodic sync - Syncs every 5 minutes
- Graceful cleanup - Removes orphaned watchers
- Error recovery - Automatic watcher restart