- Use
create-slide-video.py
to download the slides and create video out of them. If it doesn't work, check the hardcoded parts of the urls. - Use
yt-dlp
to download the videos from youtube. Links can be found in the source code of Slideslive webpage of given video. It can take also a link to youtube playlist (and use naming template then), download subtitles (even autogenerated) and embed them in the video file. - Use
ffmpeg
to merge the two videos together, as inmerge-videos.sh
.
for f in slides/*.mp4;
do
num="${f:7:2}"
ffmpeg \
-i videos/"$num"-video.mp4 \
-i slides/"$num"-slides.mp4 \
-filter_complex '[0:v]scale=w=1024:h=572,pad=1024:ih+572:x=0:y=571[int];[int][1:v]overlay=0:0[vid]' \
-map "[vid]" \
-map 0:a \
-map 0:s? \
-c:s copy \
-c:v libx264 \
-crf 23 \
-preset veryfast \
"$num"-final.mp4
done
The
[0:v]scale=w=1024:h=572,pad=1024:ih+572:x=0:y=571[int]
takes the video (v
) at index 0
, scales it to 1024x572 and pads to width 1024 and height ih
(original) +572
. The video is placed on coordinates x=0:y=571, so that the padding appears at the top.
[int][1:v]overlay=0:0[vid]
then overlays the result with video (v
) at index 1
, placing it at coordinates 0:0.
-map 0:a
takes the audio (a
) from file at index 0
, -map 0:s?
takes all the subtitles (s
) from the same file. -c:s copy
copies some subtitle settings, -c:v libx264
uses this encoding for the video.