From 87226dc587f4202e4e2c7fd67a4003ee49ca6095 Mon Sep 17 00:00:00 2001 From: esche Date: Thu, 27 Jul 2023 00:13:08 +0200 Subject: [PATCH] implemented the -d flag --- to_vp9/README.md | 2 +- to_vp9/to_vp9.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/to_vp9/README.md b/to_vp9/README.md index 46585dc..6992a41 100644 --- a/to_vp9/README.md +++ b/to_vp9/README.md @@ -9,7 +9,7 @@ If used on containers with subtitles or audiostreams, this skript will only conv ## Flags ```-e``` defines the extension of the files that should be converted
-```-d``` deletes original files after conversion (not implemented)
+```-d``` deletes original files after conversion
```-h``` show help (not implemented) ## Examples diff --git a/to_vp9/to_vp9.sh b/to_vp9/to_vp9.sh index a20e08d..4095132 100755 --- a/to_vp9/to_vp9.sh +++ b/to_vp9/to_vp9.sh @@ -72,13 +72,15 @@ for file in **/*.@($extension); do #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 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" + 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" && + if [[ "$delete" = true ]]; then rm "$file"; fi fi #VP9_qsv #was not able to test it. So it is still experimental if [[ $encoder == "vp9_qsv" ]]; then - ffmpeg -hide_banner -hwaccel qsv -qsv_device $gpu -i "$file" -c:v vp9_qsv -vf 'hwupload' "${file%.*}.mkv" + ffmpeg -hide_banner -hwaccel qsv -qsv_device $gpu -i "$file" -c:v vp9_qsv -vf 'hwupload' "${file%.*}.mkv" && + if [[ "$delete" = true ]]; then rm "$file"; fi fi #libvpx-vp9