Skip to content

SCTE to OverlayEvent support#2

Draft
lucabenvenuto wants to merge 8 commits into
masterfrom
feat/scte-to-overlay
Draft

SCTE to OverlayEvent support#2
lucabenvenuto wants to merge 8 commits into
masterfrom
feat/scte-to-overlay

Conversation

@lucabenvenuto
Copy link
Copy Markdown
Collaborator

Summary

This PR adds support for translating SCTE-35 SegmentationDescriptor events into DASH OverlayEvent elements, and unifies the previously separate scte-to-overlay and scte-to-alternative processing paths into a single always-on flow.

SCTE-35 → OverlayEvent mapping (ngx_morpheus_internal.cpp)

  • New morph_overlay() function scans each Period for EventStreams with a scte35 schemeIdUri and converts them into a new urn:scte:dash:scte214-events EventStream.
  • segmentationTypeId=56 (start) events read a segmentationUpidType=14 UPID whose value encodes the ad shape (shape=banner|skyscraper|lshape-right|lshape-left). Each shape maps to a hardcoded shape_cfg entry with URL, z-index, viewport, size, top-left position, and optional squeeze configuration.
  • segmentationTypeId=57 (stop) events emit an OverlayEvent with mode=stop referencing the paired start event by refId.
  • The original SCTE-35 EventStream is removed from the Period after conversion.

Unified processing flow

Previously, alternative MPD insertion (morph_alternative) was gated behind a ?mode=scte-to-alternative query parameter (HTTP module) and a -a CLI flag (morphdriver). Both gates have been removed. morph_alternative and the new morph_overlay now both run unconditionally on every morph_process call.

  • morph_alternative now guards against claiming SCTE-35 streams that contain no SpliceInsert events, preventing it from consuming SegmentationDescriptor streams intended for overlay.
  • morph_process signature simplified: const bool alternativeconf parameter dropped.
  • ngx_http_morpheus_module.cpp, morpheus_main.cpp, and Makefile updated accordingly.

Docker image

Initial work was done on the feat/dockerimage branch (commit 74935c3). A multi-stage Dockerfile was added:

  • Stage 1 (builder): starts from nginx:1.24.0, downloads matching nginx source, patches the build system to remove -Werror (required for C++ modules), fetches pugixml v1.15 source directly from the upstream repository, and compiles the dynamic module.
  • Stage 2 (production): copies only the compiled .so into a clean nginx:1.24.0 image alongside the nginx config and MIME types. Creates /dev/shm/nginx/client_temp at container startup (tmpfs is not available at build time).

lucabenvenuto and others added 8 commits March 10, 2026 16:18
… unify scte-to-overlay and scte-to-alternative into a single flow
The four SHAPE_CONFIGS overlay ad URLs pointed at localhost:3001, but the
real-time-ad-gen API serving /image/html is published on host port 8888
(8888:8000). The player resolving the OverlayEvent uri got nothing on
:3001, so overlays never loaded. Point all four at localhost:8888.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the four hardcoded *_AD_URL #defines with runtime resolution:
the overlay uri is built as ${AD_GEN_BASE_URL}/image/html?${MORPHEUS_<SHAPE>_QUERY}.
Each value is read with getenv() and falls back to the compiled default
(localhost:8888 + the original per-shape query strings) when the env var
is unset or empty, so the demo still runs with no configuration. Adds the
required `env` directives in nginx_morpheus.conf so the vars reach workers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Personalization params (city, gender, hobbies, ...) no longer belong in
the compiled fallback: client-side params now flow in from the MPD URL
query via ExtUrlQueryInfo. Keep only the template_id per shape as the
default; the rest is supplied per-request by the player.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolve (prefetch) the overlay ad ~5s before display instead of 35s, so
the prefetch→load→show sequence is observable in a short window and the
lead stays close to the real fetch/present timing measured in the WG.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants