Use this accessibility check to flag potential flashing risks in uploaded video before publishing it. Editframe Factory splits the recording into overlapping windows and sends them to your analysis workers. The report gives reviewers time ranges and estimated frame regions they can inspect without playing the footage.
Inspect the result
The Factory example shows a report from a synthetic SDR fixture. The source stays private so the report can be inspected without exposure to its flashing sequences.
Review recommended
- General flash
0:09.567–0:10.533
- Peak flashes in one second
- 6
- Estimated affected frame area
- 19%
- Red flash
0:33.167–0:34.133
- Peak flashes in one second
- 6
- Estimated affected frame area
- 8%
Scan coverage
- Window 1 · 0:00.000–0:10.000
- Window 2 · 0:08.000–0:20.000 · 2.000s overlap
- Window 3 · 0:18.000–0:30.000 · 2.000s overlap
- Window 4 · 0:28.000–0:40.000 · 2.000s overlap
- Window 5 · 0:38.000–0:50.000 · 2.000s overlap
- Window 6 · 0:48.000–1:00.000 · 2.000s overlap
- Window 7 · 0:58.000–1:06.000 · 2.000s overlap
The review workflow was inspired by Steve Frenzel’s Testing flashing content for accessibility issues. The scan uses the relative luminance and saturated red thresholds described in WCAG 2.2 Success Criterion 2.3.1.
The pipeline
Scan segments
This definition targets 10-second windows with 2 seconds of leading overlap. Factory aligns the windows to fragment boundaries, which can lengthen both the window and its overlap. The worker uses the actual start, end and overlap from each request. The overlap supplies earlier frame changes for a rolling one-second count. Each window reports findings whose final qualifying transition falls in its own time range after the overlap.
{
"scan": {
"type": "endpoint",
"granularity": { "mode": "segment", "window_ms": 10000, "overlap_ms": 2000 },
"with": { "endpoint_id": "00000000-0000-4000-8000-000000000000", "max_concurrency": 8 }
}
}The runner replaces the example endpoint ID with your registered endpoint ID. The step can dispatch up to eight window requests at a time, subject to available Factory dispatch capacity and worker instances. The endpoint limit caps requests across runs. For a library of recordings, use a pipeline group and set its run limit separately.
The worker uses the upload’s signed index and track URLs to read the fragments it needs from the first video track. FFmpeg decodes the frames in presentation order. The scanner groups nearby pixels into tiles and counts qualifying pairs of opposing luminance or saturated red changes. A tile contributes to a finding when more than three complete pairs occur within a rolling second.
After the run finishes, the compiler reads every accepted window output. It verifies that the reported windows cover the recording and writes one JSON report with source-relative times, peak flash counts and estimated affected area.
Run it
Use Node.js for the runner and Docker on a server where you can expose the worker through HTTPS. Use a Pipelines-enabled organization and a seekable SDR MP4 uploaded to Editframe. The worker supports up to 2,073,600 pixels per frame (1920 × 1080) with BT.709 or sRGB color. Each fragment-aligned window can cover up to 30 seconds, 96 MiB of encoded media and 2,400 decoded frames.
-
Set
EDITFRAME_TOKENto the organization's API key. SetEDITFRAME_HOSTif your Editframe origin differs fromhttps://editframe.com. SetFLASH_ENDPOINT_URLto the public HTTPS URL at which your server will receive Factory requests, including the/scanpath. Register the endpoint from the repository root.bashelements/scripts/editframe pipelines endpoints create "$FLASH_ENDPOINT_URL" --timeout-ms 90000 --max-concurrency 8 --json -
Copy the returned
idtoEDITFRAME_FLASH_ENDPOINT_IDin the runner’s environment. SetEDITFRAME_ENDPOINT_SECRETto the returnedsigning_secreton the worker host. SetEDITFRAME_MEDIA_ORIGINthere if the media origin differs fromhttps://editframe.com. Forward the HTTPS endpoint to port 8080 on the worker host. Build and start the worker from the repository root.bashdocker build -t flash-detection-worker elements/examples/flash-detection docker run --rm -p 127.0.0.1:8080:8080 \ -e EDITFRAME_ENDPOINT_SECRET -e EDITFRAME_MEDIA_ORIGIN \ -e FLASH_WORKER_CONCURRENCY=8 flash-detection-workerSet
FLASH_WORKER_CONCURRENCYfrom 1 to 8 based on the memory and CPU available to each worker. The registered endpoint limit covers the service as a whole, including when a load balancer routes requests to multiple workers. -
Set
VIDEO_MP4to the path of your SDR MP4. Upload it and copy the returnedfile.idintoFILE_ID.bashelements/scripts/editframe pipelines upload "$VIDEO_MP4" --json -
Run the example. It creates or reuses a pipeline version, starts the scan, and writes the compiled report to standard output.
bashnode elements/examples/flash-detection/run.mjs "$FILE_ID" > flash-detection-report.json
To compare the same input with serial execution, add --concurrency 1. If the run recorded worker timing and read sizes, the JSON includes peak Factory windows in progress, elapsed worker time from first pickup to last completion, and bytes read.
Reproduce the fixture
These commands require FFmpeg locally. The first creates a private test video containing flashing patterns for automated scans. The second creates a control with no flashes. Upload and scan each file to compare their reports.
node elements/examples/flash-detection/fixture.mjs flash-fixture.mp4
node elements/examples/flash-detection/fixture.mjs --control flash-control.mp4Read the report
reviewmeans the scan found one or more ranges to inspect. Each finding contains the flash type, times in milliseconds, peak count, and estimated affected frame area.no-flagsmeans the scanner covered the input and found no ranges matching its rules.incompletemeans the scan failed or some coverage was missing. The runner writes any partial evidence and exits with an error. Review coverage or retry the failed run before using the result.
Use the scan as a screening step. Tile averaging can lose fine patterns and small regions. The frame-area estimate describes the encoded image. A WCAG conformance assessment also considers the video at its largest playback size, viewing area, looping and any other flashing content on the page. Use the flagged times to revise or remove the effect and scan the revised asset.