Turn multi-angle drag race footage into a vertical YouTube Short using FFmpeg.
The script takes 4 camera angles of the same drag race, shows the pass-by angle first, then stacks the three remaining angles into a single 9:16 (1080×1920) frame.
The final video is a sequence of two segments:
- Camera 4 — exterior pass-by of both cars, cropped/scaled to fill the full 1080×1920 frame.
- Stacked segment — cameras 1, 2, and 3 stacked vertically on a black canvas:
- Top — camera 2 (exterior facing opponent car)
- Middle — camera 1 (exterior behind the car)
- Bottom — camera 3 (interior speedometer)
- FFmpeg and
ffprobeavailable on yourPATH - Python 3.8+
Check your install:
ffmpeg -version
ffprobe -version-
Drop exactly 4
.mp4camera angle files into./files/.Files are picked up in sorted filename order, so name them so they sort into the intended camera order (
cam1,cam2,cam3,cam4). -
Adjust the trim settings in
main.pyif needed:stack_start = "00:00:14" # start for the stacked clips (cam1/2/3) stack_end = "00:00:33" # end for the stacked clips cam4_start = "00:00:17" # start for the pass-by clip cam4_end = "00:00:20" # end for the pass-by clip
-
Run it:
python main.py
-
The result is written to
./files/converted/final_short.mp4.
The three stacked recordings were started at different moments but end at the same real-world instant. The script probes each clip's duration with ffprobe, then keeps only the last min_dur seconds of each so their tails line up, and applies stack_start/stack_end inside that common window. This is the FFmpeg equivalent of dragging the clip tails together on a timeline.
- The canvas is fixed at 1080×1920 @ 60fps (YouTube Shorts standard).
- All clips get a
brightness=0.10/contrast=1.16color adjustment; camera 2 is additionally cropped (top 15%, bottom 28%). - Contents of
./files/are git-ignored. - See
ffmpeg-cheatsheet.mdfor a filter reference andNotesfor the original layout values from the Adobe project.