Why a Clip Turns Sideways After Merging Videos
If a clip turns sideways after merging, check its display rotation as well as its pixel size. A portrait clip may actually store landscape pixels and rely on a rotation instruction. Compare each original with the saved merge around the join. If the orientation changes, export each clip upright on the same canvas before joining again.
Explore Clipy’s online video tools (affiliate link)
What happened when we reversed the clip order
We generated two silent H.264 MP4 clips with the same 160 by 90 coded size, 24 frames per second, and a white corner marker. Each ran for two seconds and decoded to 48 frames. We copied the blue clip's video stream into a new MP4 with a 90 degree display matrix, leaving its encoded picture dimensions alone. FFmpeg still reported 160 by 90 for the blue input stream, but its automatic rotation produced 90 by 160 frames on decode. The red input produced 160 by 90 frames.
Next we joined red then blue with FFmpeg's concat demuxer and stream copy. The saved track had no reported rotation and decoded at 160 by 90. Reversing the same two files produced a track reporting 90 degrees of rotation, which decoded at 90 by 160. Both outputs ran for four seconds and decoded all 96 frames. Checking duration and frame count alone would therefore have missed the orientation difference in both outputs.
In the red-first output, the blue segment lost the display orientation that it had when decoded alone. In the blue-first output, the red segment inherited the rotation of the saved track. This pair isolates the effect of clip order for this particular stream-copy command: it changes the orientation of the whole track rather than preserving a separate orientation for each segment. We measured a local FFmpeg workflow; browser mergers may re-encode and handle rotation differently.
Repeat the test
Download the plain red input, the blue input with a display matrix, and both outputs: red first and blue first. The command log contains the measurements and FFmpeg output. Run node reproduce.cjs using the reproduction script in an empty directory with a recent FFmpeg on PATH. The script uses -display_rotation:v:0 90 on the blue input before stream copying it into a separate file.
Fix a sideways clip before exporting again
Open both sources and identify the clip that changes orientation. Export the sources with upright pixels and a common canvas, using fit and padding if you want to keep the full picture. Then merge videos online and play the downloaded MP4 on both sides of the join. If the pictures are upright but you see bars, see the portrait and landscape canvas guide.