fixed an bug, when encoding .mkv to .mkv
This commit is contained in:
parent
3eb4aac1fe
commit
d5a1155f1f
2 changed files with 14 additions and 3 deletions
|
@ -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" &&
|
||||
|
|
|
@ -61,12 +61,20 @@ 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
|
||||
|
|
Loading…
Reference in a new issue