Please note, we will be using ffmpeg via command-line. If you are not comfortable with command-line, then better find another way.
- Move all weekly videos into a folder (e.g.
vidoes
). - Rename all videos according to week numbers such as 01.mp4, 02.mp4
- (Optional) since we are goint to mute the sound, you may trim earlier part where we speak secret code.
I am assuming you have them already in mp4 format. If you have them in mov format, it also works, just replace mp4 references to mov.
Run following command to add week-number label to each video
cd videos
for i in *.mp4; do
ffmpeg -i $i -vf \
"format=yuv444p, \
drawbox=y=10:[email protected]:width=300:height=120:t=fill, \
drawtext=text='W ${i%%.*}':fontcolor=white:fontsize=100:x=20:y=30, \
format=yuv420p" \
-c:v libx264 -c:a copy -movflags +faststart t-${i%%.*}.mp4
done
Now you have two options to create mosiac/collage from 12 videos. It can be 4x3 or 3x4. I prefer as 3x4 was becoming too "vertical".
Use following to create 3x4 mosaic/collage
ffmpeg \
-i ./t-01.mp4 \
-i ./t-02.mp4 \
-i ./t-03.mp4 \
-i ./t-04.mp4 \
-i ./t-05.mp4 \
-i ./t-06.mp4 \
-i ./t-07.mp4 \
-i ./t-08.mp4 \
-i ./t-09.mp4 \
-i ./t-10.mp4 \
-i ./t-11.mp4 \
-i ./t-12.mp4 \
-filter_complex " \
[0:v] setpts=PTS-STARTPTS, scale=qvga [a0]; \
[1:v] setpts=PTS-STARTPTS, scale=qvga [a1]; \
[2:v] setpts=PTS-STARTPTS, scale=qvga [a2]; \
[3:v] setpts=PTS-STARTPTS, scale=qvga [a3]; \
[4:v] setpts=PTS-STARTPTS, scale=qvga [a4]; \
[5:v] setpts=PTS-STARTPTS, scale=qvga [a5]; \
[6:v] setpts=PTS-STARTPTS, scale=qvga [a6]; \
[7:v] setpts=PTS-STARTPTS, scale=qvga [a7]; \
[8:v] setpts=PTS-STARTPTS, scale=qvga [a8]; \
[9:v] setpts=PTS-STARTPTS, scale=qvga [a9]; \
[10:v] setpts=PTS-STARTPTS, scale=qvga [a10]; \
[11:v] setpts=PTS-STARTPTS, scale=qvga [a11]; \
[a0][a1][a2][a3][a4][a5][a6][a7][a8][a9][a10][a11]xstack=inputs=12:layout=0_0|w0_0|w0+w1_0|w0+w1+w2_0|0_h0|w0_h0|w0+w1_h0|w0+w1+w2_h0|0_h0+h1|w0_h0+h1|w0+w1_h0+h1|w0+w1+w2_h0+h1[out] \
" \
-map "[out]" \
-vsync 2 new-3x4.mp4
Alternative
Use following to create 4x3 mosaic/collage
ffmpeg \
-i t-01.mp4 \
-i t-02.mp4 \
-i t-03.mp4 \
-i t-04.mp4 \
-i t-05.mp4 \
-i t-06.mp4 \
-i t-07.mp4 \
-i t-08.mp4 \
-i t-09.mp4 \
-i t-10.mp4 \
-i t-11.mp4 \
-i t-12.mp4 \
-filter_complex " \
[0:v] setpts=PTS-STARTPTS, scale=qvga [a0]; \
[1:v] setpts=PTS-STARTPTS, scale=qvga [a1]; \
[2:v] setpts=PTS-STARTPTS, scale=qvga [a2]; \
[3:v] setpts=PTS-STARTPTS, scale=qvga [a3]; \
[4:v] setpts=PTS-STARTPTS, scale=qvga [a4]; \
[5:v] setpts=PTS-STARTPTS, scale=qvga [a5]; \
[6:v] setpts=PTS-STARTPTS, scale=qvga [a6]; \
[7:v] setpts=PTS-STARTPTS, scale=qvga [a7]; \
[8:v] setpts=PTS-STARTPTS, scale=qvga [a8]; \
[9:v] setpts=PTS-STARTPTS, scale=qvga [a9]; \
[10:v] setpts=PTS-STARTPTS, scale=qvga [a10]; \
[11:v] setpts=PTS-STARTPTS, scale=qvga [a11]; \
[a0][a1][a2][a3][a4][a5][a6][a7][a8][a9][a10][a11]xstack=inputs=12:layout=0_0|w0_0|w0+w1_0|0_h0|w0_h0|w0+w1_h0|0_h0+h1|w0_h0+h1|w0+w1_h0+h1|0_h0+h1+h2|w0_h0+h1+h2|w0+w1_h0+h1+h2[out] \
" \
-map "[out]" \
-vsync 2 new-4x3.mp4
In videos
folder you an use following to convert all files from one video format to another format.
for i in *.mov; do
ffmpeg -i $i ${i%%.*}.mp4
done