A web-based job submission and monitoring tool for Adobe Media Encoder (AME) in a Grassvalley AMPP environment. Editors upload `.prproj` files through the browser, the server remaps `.gves` proxy paths to high-resolution UNC paths, then delivers the remapped project to AME's watch folder for automated rendering.
## How It Works
1. Editor uploads a Premiere Pro `.prproj` file via the web UI
2. The server parses and remaps any `.gves` proxy media paths to their high-res UNC equivalents
3. The remapped project file is written to AME's watch folder
4. AME picks up the file, renders it, and writes output to the output folder
5. The job manager polls both folders and updates job status automatically: `queued → encoding → complete`
**Important**: The paths `/mnt/smb-ame/Watch`, `/mnt/smb-ame/Output`, and `/mnt/smb-ame/Logs` must exist on the Docker host after mounting. Create them if they don't exist:
## Architecture: Docker Container with Host-Level SMB Mounting
The job manager runs in Docker but needs access to SMB network shares for the watch folder, output folder, and AME logs. The architecture accomplishes this by:
1.**Host-level SMB mount**: The Docker host mounts the SMB share using native Linux `mount -t cifs`, making it available at a path like `/mnt/smb-ame`
2.**Bind-mounts from host to container**: `docker-compose.yml` binds specific subdirectories from the host into the container:
3.**Application accesses local paths**: The Node.js app reads/writes to `/watch`, `/output`, `/ame-logs` as if they were local, unaware of the SMB infrastructure
- **Capability constraints**: Docker requires `SYS_ADMIN` capability and `apparmor=unconfined` to mount CIFS from within a container. This introduces security surface and may fail depending on host kernel/Docker daemon version.
- **Reliability**: SMB mounts are more stable and persistent when managed by the host OS (systemd, `/etc/fstab`) rather than ephemeral container entrypoint scripts.
- **Separation of concerns**: The container doesn't need to know or care about SMB credentials—the host handles authentication, the container just accesses mounted paths.
- **Volume flexibility**: If the SMB share is ever replaced with local storage or a different protocol, only the host mount needs to change; the container remains unaware.
The watch folder, output folder, and logs are expected to be on a shared network location (SMB/CIFS). The Docker host must mount this share at the path specified in `docker-compose.yml` volumes.
4.**Create subdirectories on the SMB share** (if they don't exist):
```
\\172.18.210.5\ame\
├── watch\ (AME's watch folder)
├── output\ (AME's output folder)
└── logs\ (Contains AMEEncodingLog.txt)
```
5.**Restart the container** — it will mount the SMB share on next startup
### Troubleshooting SMB Mount Issues
- **Mount failed**: Check that credentials are correct and the SMB server is reachable
- **Permission denied**: Verify the SMB user has read/write access to the share
- **Container falls back to local volumes**: Check Docker logs for mount errors: `docker logs ame-job-manager`
- **Shares already mounted locally**: If the watch/output/logs folders are already mounted on the Docker host via `/etc/fstab`, use bind-mounts in `docker-compose.yml` instead:
```yaml
volumes:
- /mnt/host-smb-share/watch:/watch
- /mnt/host-smb-share/output:/output
- /mnt/host-smb-share/logs:/ame-logs
```
In this case, you don't need to configure SMB credentials in the app settings.
| `queued` | File written to watch folder, waiting for AME to pick it up |
| `encoding` | File disappeared from watch folder — AME is actively rendering |
| `complete` | Output file detected in the output folder |
| `error` | Job timed out or AME log reported an error |
The server polls both folders every `POLL_INTERVAL_MS` milliseconds to detect status transitions.
## Path Remapping
The core function of this tool is to make `.prproj` files renderable on a high-res render machine. Premiere projects created on AMPP workstations often reference `.gves` proxy files. This server rewrites those references to the corresponding UNC/high-res paths before handing the project to AME.
The remapping logic lives in `prproj-remapper.js`. You can test a remap without submitting a job using the analyze endpoint or the dry-run button in the UI.
## API Reference
| Method | Endpoint | Description |
|--------|----------|-------------|
| POST | `/api/login` | Authenticate and get a session ID |
| POST | `/api/logout` | End session |
| POST | `/api/jobs` | Submit a `.prproj` file and create a job |
| POST | `/api/jobs/analyze` | Dry-run analysis of a `.prproj` (no submission) |
| GET | `/api/jobs` | List all jobs |
| GET | `/api/jobs/:id` | Get a single job by ID |
| DELETE | `/api/jobs/:id` | Delete a job record |
| GET | `/api/status` | System status — folder health, job counts, AME log stats |
| GET | `/api/ame/logs` | Full AME log data with recent entries |
- Host kernel version or Docker daemon configuration may not support container-level mounts
- SMB credentials in container entrypoint scripts are harder to manage and rotate
**Why not a single mount point?**
- Initial implementation mounted `/mnt/smb-ame` as `/smb-share` in the container, then created separate Docker volumes for `/watch`, `/output`, `/ame-logs`
- This caused uploaded files to go to ephemeral Docker volumes instead of the SMB share
- Fixed by binding each SMB subdirectory directly to its container path
**Final solution**:
- Host mounts SMB at `/mnt/smb-ame` (persists in `/etc/fstab` or systemd automount)
-`docker-compose.yml` specifies three bind-mounts:
```yaml
- /mnt/smb-ame/Watch:/watch
- /mnt/smb-ame/Output:/output
- /mnt/smb-ame/Logs:/ame-logs
```
- App reads/writes to `/watch`, `/output`, `/ame-logs` as local paths
- Files automatically appear on the SMB share where AME can access them
### Separation of Concerns
The Docker container intentionally does NOT handle SMB mounting. This separation ensures:
- **Security**: SMB credentials live on the host, never in container code or `.env` files
- **Reliability**: Host OS manages mount persistence; container restart doesn't affect SMB access
- **Portability**: Container works with any mounted filesystem (SMB, NFS, local, etc.) — no protocol assumptions
- **Operations**: Infrastructure team manages storage layer; application team manages app container
### Why .prproj Path Remapping?
The core value of this tool is translating proxy-resolution Premiere projects to high-resolution paths:
- **AMPP Workflow**: Editors on Grassvalley AMPP workstations edit with `.gves` proxy media for responsiveness
- **Problem**: AME on a dedicated render machine can't resolve `.gves` paths — they're relative to AMPP infrastructure
- **Solution**: Before handing the project to AME, rewrite all `.gves` references to their corresponding high-resolution UNC paths
- **Result**: AME can render the full-resolution media without the editor needing to manage two versions of the project
### Why Not Auto-Generate Remappings?
The remapping rules are configured manually in the app settings because:
-`.gves` files and their high-res equivalents may not follow a consistent naming pattern
- Different projects may use different proxy strategies
- Manual configuration is explicit and auditable — you can see what gets remapped and why
## Troubleshooting
### Files Don't Appear on SMB Share After Upload
**Symptom**: File appears in job queue but isn't visible at `//172.18.210.5/ame/Watch` on the network.
**Check 1**: Verify SMB is mounted on the host
```bash
mount | grep cifs
```
**Check 2**: Verify subdirectories exist and are accessible