Document local folder scheduler profile

This commit is contained in:
JSLMPR 2026-07-10 08:58:25 +02:00
parent 90cadbe097
commit 8e67566f0d
3 changed files with 52 additions and 1 deletions

View File

@ -30,7 +30,7 @@ Note: the local machine's filesystem root is read-only in this workspace, so abs
10. [x] Add failure handling for FFmpeg or filesystem errors.
11. [x] Add unit tests for ordering, invalid-file handling, repeat prevention, and state transitions.
12. [x] Add optional FFmpeg integration test for a short fixture.
13. [ ] Add local profile or documented runtime config for enabling the scheduler.
13. [x] Add local profile or documented runtime config for enabling the scheduler.
14. [ ] Run verification and mark feature complete.
## Format Recommendation
@ -77,6 +77,18 @@ video-clipping.folder-scheduler.exact-preset=veryfast
Keep the existing API-driven clipper config separate from this folder scheduler. The folder scheduler is a direct filesystem workflow, not an API/upload/session workflow.
### Running Locally
Install `ffmpeg` and `ffprobe`, then start the service with the repository-local scheduler profile:
```bash
mvn spring-boot:run -Dspring-boot.run.profiles=folder-scheduler-local
```
Place source videos in `input/source`. The service creates `input/working`, `input/processed`, and `input/rejected` at startup and writes clips to `output/clips/<video-name>`.
For production, keep the default absolute paths and mount persistent writable volumes at `/input` and `/output`. Run only one scheduler replica unless a cross-process lease is added.
## Processing Rules
The scheduler should:

View File

@ -0,0 +1,12 @@
video-clipping.folder-scheduler.enabled=true
video-clipping.folder-scheduler.input-directory=./input/source
video-clipping.folder-scheduler.output-directory=./output/clips
video-clipping.folder-scheduler.processed-directory=./input/processed
video-clipping.folder-scheduler.rejected-directory=./input/rejected
video-clipping.folder-scheduler.working-directory=./input/working
video-clipping.folder-scheduler.poll-interval-ms=5000
video-clipping.folder-scheduler.segment-duration-seconds=8
video-clipping.folder-scheduler.ffmpeg-binary=ffmpeg
video-clipping.folder-scheduler.ffprobe-binary=ffprobe
video-clipping.folder-scheduler.output-container=mp4
video-clipping.folder-scheduler.exact-preset=veryfast

View File

@ -0,0 +1,27 @@
package org.example.videoclips.folder;
import org.junit.jupiter.api.Test;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.support.PropertiesLoaderUtils;
import java.util.Properties;
import static org.junit.jupiter.api.Assertions.assertEquals;
class FolderSchedulerLocalProfileTest {
@Test
void enablesSchedulerWithRepositoryLocalEightSecondPaths() throws Exception {
Properties properties = PropertiesLoaderUtils.loadProperties(
new ClassPathResource("application-folder-scheduler-local.properties"));
assertEquals("true", properties.getProperty("video-clipping.folder-scheduler.enabled"));
assertEquals("./input/source", properties.getProperty("video-clipping.folder-scheduler.input-directory"));
assertEquals("./output/clips", properties.getProperty("video-clipping.folder-scheduler.output-directory"));
assertEquals("./input/working", properties.getProperty("video-clipping.folder-scheduler.working-directory"));
assertEquals("./input/processed", properties.getProperty("video-clipping.folder-scheduler.processed-directory"));
assertEquals("./input/rejected", properties.getProperty("video-clipping.folder-scheduler.rejected-directory"));
assertEquals("8", properties.getProperty("video-clipping.folder-scheduler.segment-duration-seconds"));
assertEquals("mp4", properties.getProperty("video-clipping.folder-scheduler.output-container"));
}
}