Last active
August 26, 2016 12:21
-
-
Save kana-sama/09824cb526fe18d7f1d8c6aaf644ffc7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
normalize_index() { | |
local index=$1 | |
printf "%02d" $index | |
} | |
source_name() { | |
local index=$1 | |
local index=$(normalize_index $index) | |
echo "[Winter] Medaka Box $index [BDrip 1280x720 x264 Vorbis]" | |
} | |
video() { | |
local index=$1 | |
echo "./$(source_name $index).mkv" | |
} | |
video_with_subs() { | |
echo "./$(source_name $index).subs.mkv" | |
} | |
subs() { | |
local index=$1 | |
echo "./RUS Subs/$(source_name $index).ass" | |
} | |
apply_subs_to_video() { | |
local index=$1 | |
local src=$(video $index) | |
local subs=$(subs $index) | |
local out=$(video_with_subs $index) | |
ffmpeg \ | |
-i "$src" \ | |
-i "$subs" \ | |
-vcodec copy \ | |
-acodec copy \ | |
-scodec ass "$out" | |
} | |
for i in $(seq 1 12); do | |
apply_subs_to_video $i | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment