Documentation / Build

Rework a media segment

Process segments in parallel, check loudness, and stitch the final output after the checks finish.

Simulated business logic; no AWS or AI calls. From the runner checkout. Download the displayed JSON into the checkout root. The local runner reads JSON.

Run the recipe

shell
cargo run --locked --bin rippflow-local -- \
  media.workflow.json \
  scene-01.mp4,scene-02.mp4,scene-03.mp4 \
  --handler "python3 examples/python/handler.py"

Expected: scene-02.mp4 triggers rework once. stitch-hls-master completes after the segments finish. No media files are read or transcoded.

Workflow definition

JSON

json
{
  "name": "media-segment-transcoder",
  "version": "1.0.0",
  "default_group": "python-standard",
  "phases": {
    "transcode-segment": {
      "requires": [],
      "service": "ffmpeg.transcode_h264",
      "scope": "per_shard",
      "inputs": {
        "preset": "fast",
        "crf": 21
      }
    },
    "loudness-qa": {
      "requires": [
        "transcode-segment"
      ],
      "service": "audio.check_lufs",
      "scope": "per_shard",
      "outcomes": {
        "completed": {
          "advance_barrier": true
        },
        "rework": {
          "rerun_phase": "transcode-segment",
          "max_loops": 1,
          "override_inputs": {
            "normalize_audio": true
          }
        }
      }
    },
    "stitch-hls-master": {
      "requires": [
        "loudness-qa"
      ],
      "service": "hls.build_master_playlist",
      "scope": "fan_in_all",
      "mode": "sync_lambda",
      "terminal": true
    }
  }
}

YAML

yaml
name: media-segment-transcoder
version: 1.0.0
default_group: python-standard
phases:
  transcode-segment:
    requires: []
    service: ffmpeg.transcode_h264
    scope: per_shard
    inputs:
      preset: fast
      crf: 21
  loudness-qa:
    requires:
      - transcode-segment
    service: audio.check_lufs
    scope: per_shard
    outcomes:
      completed:
        advance_barrier: true
      rework:
        rerun_phase: transcode-segment
        max_loops: 1
        override_inputs:
          normalize_audio: true
  stitch-hls-master:
    requires:
      - loudness-qa
    service: hls.build_master_playlist
    scope: fan_in_all
    mode: sync_lambda
    terminal: true

Download: JSON · YAML

Verified sources

Checked 2026-11-05.

Let's talk

Contact Rippflow

Tell us about your workflows, deployment or pricing.

We'll reply to your email.

Search docs

Search workflows, handlers and operations.