„to_opus.sh“ ändern

This commit is contained in:
esche 2023-05-18 16:38:30 +02:00
parent 6b19634352
commit aea5b45965

View file

@ -41,13 +41,19 @@ for file in **/*.@($extension); do
else print $2>=450000 ? "-b:a:"NR-1" 128k" : "-b:a:"NR-1" "$2 else print $2>=450000 ? "-b:a:"NR-1" 128k" : "-b:a:"NR-1" "$2
} }
END{ END{
print "\""file_output"\" -v 32 -hide_banner" print "\""file_output"\" -v info -hide_banner"
}') }')
is_video=$(ffprobe -i Hair.m4v -v fatal -select_streams V -show_entries stream=codec_type) is_video=$(ffprobe -i Hair.m4v -v fatal -select_streams V -show_entries stream=codec_type)
if [[ -n "$is_video" ]]; then if [[ -n "$is_video" ]]; then
echo "$file is a video file and will not be converted" echo "$file is a video file and will not be converted"
#an Example for converting the audiostreams in a container while copying subtitles and videostreams.
#ffmpeg -i Hair.m4v -map 0:a -map 0:s -map 0:v -c:a libopus -c:v copy -c:s copy Hair.mkv -hide_banner -v info
#for extracting the audiostreams of a video file just use "eval "$command"".
#it is recommended to check the result before deleting the original file.
else else
eval "$command" && rm "$file" eval "$command" && rm "$file"
fi fi