for i in *.mkv; do ffmpeg -i "$i" -vf "subtitles=$i:si=0" -c:v libx264 -crf 20 -c:a copy "hardsub_${i%.*}.mp4" done

If you know the intro ends at 00:01:15 and outro starts at 00:18:30 for a 20‑min episode:

ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "Young.Sheldon.S07E01.mkv" ffprobe -v error -show_entries stream=index,codec_name -of default=noprint_wrappers=1 "Young.Sheldon.S07E01.mkv"