Domain changed to archive.palanq.win . Feb 14-25 still awaits import.
[7 / 2 / 1]

Help me write a ffmpeg bash script

No.1514363 View ViewReplyOriginalReport
I need a bash one-liner that batch extracts all .ass subtitle streams of all .mkv files in a working directory and names the extracted subs to “’filename’_’language’_’stream’.ass” + extracts all font attachments and moves them into their respective folders. With some trial and error and proomting I got this:
[code:lit]for file in *.mkv; do
ffprobe -v error -show_entries stream=index:stream_tags=language -of csv=p=0 -select_streams s "$file" | while IFS=, read -r index lang; do
ffmpeg -i "$file" -map 0:s:$index "${file%.mkv}_$lang_$index.ass" -y;
done;
ffmpeg -dump_attachment:t "" -y -i "$file";
done && mkdir -p subs fonts && mv *.ass subs/ && mv *.ttf *.otf fonts/ 2>/dev/null[/code:lit]
Which works partially as for some reason it does not extract all the subs from a file and there is no language code in the filenames of extracted subs. Also occasionally throws this error in picrel while running. Not sure how to troubleshoot this since I'm tech illiterate.