copy av1 inputs, copy audio lang that matches video, and only copy english subs

This commit is contained in:
2025-10-19 14:14:12 -05:00
parent 4b88fe30f8
commit d5680d8816
2 changed files with 105 additions and 93 deletions

View File

@@ -91,18 +91,15 @@ get_file_format() {
get_num_streams() {
local file="$1"
ffprobe \
-v error \
-show_entries stream=index \
-of default=noprint_wrappers=1:nokey=1 \
"${file}"
}
local type="${2:-}"
local select=()
if [[ ${type} != '' ]]; then
select=("-select_streams" "${type}")
fi
get_num_audio_streams() {
local file="$1"
ffprobe \
-v error \
-select_streams a \
-v error "${select[@]}" \
-show_entries stream=index \
-of default=noprint_wrappers=1:nokey=1 \
"${file}"
@@ -118,3 +115,14 @@ get_num_audio_channels() {
-of default=noprint_wrappers=1:nokey=1 \
"${file}"
}
get_stream_lang() {
local file="$1"
local stream="$2"
ffprobe \
-v error \
-select_streams "${stream}" \
-show_entries stream_tags=language \
-of default=noprint_wrappers=1:nokey=1 \
"${file}"
}