fixed an bug, when encoding .mkv to .mkv

This commit is contained in:
esche 2023-07-26 23:38:46 +02:00
parent 3eb4aac1fe
commit d5a1155f1f
2 changed files with 14 additions and 3 deletions

View file

@ -56,7 +56,10 @@ for file in **/*.@($extension); do
# use mkv for videos and for multiple audio streams
is_video=$(ffprobe -v error -select_streams V -show_entries stream=codec_type "$file")
if [[ ${#channels[@]} -gt 1 || -n "$is_video" ]]; then
ffmpeg -i "$file" -map 0 -map -0:d -map -0:t -c copy -c:a libopus $bitrate_settings-v info -hide_banner "${file%.*}.mkv" &&
if [[ ${file: -3} == "mkv" ]]; then
file_out="${file%.*}2.mkv"
else file_out="${file%.*}.mkv"; fi
ffmpeg -i "$file" -map 0 -map -0:d -map -0:t -c copy -c:a libopus $bitrate_settings-v info -hide_banner "$file_out" &&
if [[ "$delete" = true ]]; then rm "$file"; fi
else
ffmpeg -i "$file" $bitrate_settings-v info -hide_banner "${file%.*}.opus" &&

View file

@ -61,13 +61,21 @@ extension="${extension[*]}"
extension=${extension// /|}
for file in **/*.@($extension); do
if [[ ${file: -3} == "mkv" ]]; then
file_out="${file%.*}2.mkv"
else file_out="${file%.*}.mkv"; fi
echo "$encoder"
#VP9_vaapi
#there are problems with the -global_quality:v/-q:v settings only being able to make quality worse. Help is appreciated
#not enough tested. So it is still experimental
#ffmpeg -hide_banner -hwaccel vaapi -vaapi_device $gpu -i "$file" -map 0 -c copy -c:v vp9_vaapi -rc_mode CQP -bf 1 -bsf:v vp9_raw_reorder,vp9_superframe -vf 'hwupload' "${file%.*}.mkv"
if [[ $encoder == "vp9_vaapi" ]]; then
ffmpeg -hide_banner -hwaccel vaapi -vaapi_device $gpu -i "$file" -map 0 -c copy -c:v vp9_vaapi -rc_mode CQP -bf 1 -bsf:v vp9_raw_reorder,vp9_superframe -vf 'hwupload' "$file_out"
fi
#VP9_qsv
#was not able to test it. So it is still experimental
#ffmpeg -hide_banner -hwaccel qsv -qsv_device $gpu -i "$file" -c:v av1_qsv -vf 'hwupload' "${file%.*}.mkv"