for i in Ghosts_S02E*.mkv; do ffmpeg -i "$i" -c:v libx265 -crf 28 -c:a aac "$i%.mkv.mp4" done
ffmpeg -i "Ghosts_S02E04.mp4" -i "Ghosts_S02E04.srt" -c:v copy -c:a copy -c:s mov_text "Ghosts_S02E04_with_subs.mp4" 6. Combine Opening Credits Across Episodes (Concatenation) Create a files.txt : ghosts s02 ffmpeg
ffmpeg -i "Ghosts_S02E01.mkv" -c copy "Ghosts_S02E01.mp4" ( -c copy avoids re-encoding – fast but keeps original quality) Use H.265/HEVC for better compression (smaller file, same quality): for i in Ghosts_S02E*