Concat input contract
Two generated or edited segments can differ in length, display geometry and timing even when both are MP4. A concat filter works with decoded streams and has requirements different from a packet-level concat demuxer. This recipe chooses one decoded path so its assumptions are visible. It does not promise invisible motion continuity or exact preservation of source actions. The artifact is a contract listing what was changed before the join and what remains an editorial acceptance decision afterward. Recipe prerequisite: both inputs must already have square pixels (SAR 1:1). A non-square-pixel source needs a separately approved display-geometry conversion first; setting SAR to one after arbitrary scaling is not such a conversion.
Build the evidence
- 01
Inventory the two saved inputs
Measure each actual file rather than relying on requested generation settings. Decide the intended canvas, framing and cadence. The small 320×240 test target in the example is only a local fixture; choose the real project's approved delivery dimensions. Decide whether black padding is allowed and whether rate conversion is acceptable for the action. If not, adjust the project strategy before processing either segment. Verify SAR=1 on each prepared input. Reject a non-square input from this recipe until its intended display geometry has been converted and checked independently.
- 02
Normalize every branch deliberately
Each branch scales while retaining aspect ratio, pads to the chosen canvas, sets square pixels, converts to 30 fps and yuv420p, then rebases presentation time. The fps step may duplicate or drop pictures, so it is a declared transform rather than a hidden compatibility trick. Both branches feed a video-only concat. A soundtrack can be laid over the assembly later, but that is not evidence that separate embedded audio would have joined naturally.
- 03
Verify the assembly as a new deliverable
Inspect the last action of the first segment and the first action of the second at ordinary speed and frame by frame where needed. Check that padding, subject scale and the intended side assignments remain acceptable. Compare actual output duration with the normalized branches and account for frame rounding. If the assembly is meant as another AISwapLab source, independently confirm that its complete duration and byte size meet that route's limits.
A bounded example
Local executed fixture: a six-second synthetic source and a five-second frame-extracted derivative were normalized with the listed branches and concatenated under FFmpeg 7.1. The process completed and produced an eleven-second picture-only output. That output is deliberately longer than the current existing-video upload window and is a concat test, not an upload-ready product demo. No human identity, seam aesthetics or paid generation was tested. A separate synthetic 320×240 SAR 2:1 fixture was first converted to an approved 640×240 SAR 1:1 picture, preserving its 8:3 display ratio, then passed through the normalization contract. This tests that specific preparation path, not a universal formula for every non-square input.
Local diagnostic commands
Local FFmpeg 7.1 tests covered square-pixel concat inputs and a separate 320×240 SAR 2:1 fixture first converted to approved 640×240 square-pixel geometry. The latter then passed through normalization. This does not certify arbitrary non-square inputs. No paid generation was performed.
# Prerequisite: each prepared input has verified SAR 1:1; normalize non-square display geometry separately first.
ffmpeg -n -i first.mp4 -i second.mp4 -filter_complex "[0:v:0]scale=320:240:force_original_aspect_ratio=decrease,pad=320:240:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30,format=yuv420p,setpts=PTS-STARTPTS[v0];[1:v:0]scale=320:240:force_original_aspect_ratio=decrease,pad=320:240:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30,format=yuv420p,setpts=PTS-STARTPTS[v1];[v0][v1]concat=n=2:v=1:a=0[v]" -map "[v]" -an -c:v libx264 joined-picture.mp4Concat input contract
| Property | Fixture choice | Review consequence |
|---|---|---|
| Geometry | 320×240 padded canvas | No subject stretching; border allowed |
| Cadence | 30 fps | Inspect dropped/duplicated motion |
| Audio | Excluded | Design sound separately |
| Output duration | Actual assembly | Not automatically upload-eligible |
Acceptance evidence
- The contract records every geometry and cadence transform for each branch.
- Audio absence in this recipe is deliberate and documented.
- The rendered seam receives picture and motion review.
- A later upload checks the resulting file's own duration and size.
Stop condition
Stop if normalization distorts an approved composition, damages a critical gesture or cannot make the seam acceptable. Choose a hard cut, another source boundary or a different finishing strategy. Technical concat success is not permission to describe the resulting movement as seamless, synchronized or ready for every platform.
