Created
September 1, 2024 22:03
-
-
Save popstas/5300b7975c3243a68f4413df02f5e08d 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
#!/bin/bash | |
set -e | |
n="$n" | |
cd /media/media/video | |
if [ -z "$n" ]; then | |
n="$(ls -1 *.mkv | fzf | sed 's/\.mkv$//')" | |
fi | |
subslist="$(ffprobe "$n.mkv" 2>&1 | grep -A 2 Subtitle)" | |
echo "$subslist"; sleep 3 | |
count="$(ffprobe "$n.mkv" 2>&1 | grep Subtitle | wc -l)" | |
lastind="$(( $count - 1 ))" | |
rusind="$(seq 0 "$lastind" | fzf --prompt="select rus subtitles:" --header="$subslist")" | |
engind="$(seq 0 "$lastind" | fzf --prompt="select eng subtitles:" --header="$subslist")" | |
ffmpeg -y -i "$n.mkv" -map 0:s:$rusind "$n.rus.srt" && ffmpeg -y -i "$n.mkv" -map 0:s:$engind "$n.eng.srt" | |
ls -lh | grep "$n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment