From 5afb90a3ce3a4b9c7dfd85305db7c34cf95fe12a Mon Sep 17 00:00:00 2001 From: Michael Reber Date: Thu, 9 Apr 2020 15:39:52 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20match=20error=20on=20upercase=20'X'=20in?= =?UTF-8?q?=20string-re=C3=BClacement=20and=20resulting=20self=20deletion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- convert_Videos.ps1 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/convert_Videos.ps1 b/convert_Videos.ps1 index f74cd3f..8d4dde0 100644 --- a/convert_Videos.ps1 +++ b/convert_Videos.ps1 @@ -4,7 +4,7 @@ #----------------------------------------------------------------------- # Edit the $videoPath variable to point to your video-files folder: -$videoPath = 'M:\1_movies\_main.movies\' +$videoPath = 'M:\2_serien\_main.series\' #----------------------------------------------------------------------- # HEVC profiles: main, main10, main444 @@ -20,6 +20,7 @@ $fileTester = "$PSScriptRoot\mediainfo.exe" if(!(Test-Path $NVEncoder -PathType leaf)) { Write-Host "NVEncC64.exe not found, please check path in `"$NVEncoder`"." -ForegroundColor Yellow + Read-Host -Prompt "Press Enter to exit" exit } @@ -39,7 +40,8 @@ $count = $videos.Count if($videos.Count -lt 1) { Write-Host "No videos found in: $videoPath" -ForegroundColor Red - exit + Read-Host -Prompt "Press Enter to exit" + exit } # Log write function: Function LogWrite @@ -81,9 +83,9 @@ foreach($video in $videos) if($codec -ne "HEVC") { # Configure new file naming: - if ($video -match "x264") + if ($video -match "264") { - $outputFile = $videoPath + $video.Replace("x264", "x265") + $outputFile = $videoPath + $video.Replace("264", "265") } else { $outputFile = $videoPath + $video.Insert(($video.Length - 4), '-HEVC') } @@ -158,7 +160,7 @@ foreach($video in $videos) LogWrite "$inputFile" } } - Start-Sleep -Seconds 4 + #Start-Sleep -Seconds 4 } else { # Alert if video doesn't need conversion: @@ -170,7 +172,6 @@ foreach($video in $videos) $notConvertedVideos = $notConvertedVideos + 1 $Logfile = "$PSScriptRoot\logs\$logFolderName\skipped_files.log" LogWrite "$inputFile" - Start-Sleep -Seconds 4 } # Increments video counter: $videoID = $videoID + 1