Add in-video overlays #87
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add FFmpeg overlay support in createInputsOutputs (in‑video image overlays)
Summary
-filter_complexinsrc/utils/metadata.js#createInputsOutputs().-loop 1,-framerate <n>; default 30).scale=1280:720).format=yuv420pfor broad player compatibility.-filter_complexinoutputs[0].optionsand map the graph output with-map [v].Background
The UI exposes overlay configuration (image path, scale, position, framerate), but previously the generated FFmpeg command did not merge overlays into the video pipeline. This PR wires the UI overlay config into the FFmpeg graph so overlays render in the encoded output.
Changes
src/utils/metadata.js-loop 1and-framerate(default 30).[{overlayInput}:v]scale=<width>:-1[logoN](width defaults to 320 when not specified).profile.video.filter.graphcontains a scale, reuse it.scale=1280:720.[<inputIndex>:v](not[<inputIndex>:0]).${current}[logoN]overlay=x=<x>:y=<y>; labels chained until final[v].x=(W-w)/2,y=(H-h)/2.ynot provided for the first overlay, default to bottom with padding:y=H-h-24.format=yuv420pto the last link in the chain:...,format=yuv420p[v].-filter_complextooutputs[0].options(not global options) and replace the video-mapwith-map [v].Example (resulting options excerpt)
-filter_complex "[0:v]scale=1280:720[bg];[1:v]scale=320:-1[logo1];[bg][logo1]overlay=x=(W-w)/2:y=H-h-24[v],format=yuv420p[v]" \ -map [v] ...Implementation Notes
:v) to reduce brittleness and to match the working example.-filter_complexis inserted at the beginning ofoutputs[0].optionsto ensure correct option ordering.Testing
REACT_APP_API_DEBUG=true) includes:-loop 1and-framerate.-filter_complexstring with base video scale, per-overlay scale, overlay chaining, and finalformat=yuv420p.-map [v]for the video stream inoutputs[0].options.Limitations / Follow‑ups
-loop 1based on media type.Risk and Rollback
src/utils/metadata.js.Checklist
format=yuv420pappended and mapped with-map [v].