Compare commits

..

No commits in common. "852bce9c61b56f775a63deb331b1e824020a162e" and "0894aa74e2db52cff8f10f93d074289fdb2489a3" have entirely different histories.

View File

@ -4,7 +4,7 @@
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
# Edit the $videoPath variable to point to your video-files folder: # Edit the $videoPath variable to point to your video-files folder:
$videoPath = 'M:\2_serien\_main.series\' $videoPath = 'M:\1_movies\_main.movies\'
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
# HEVC profiles: main, main10, main444 # HEVC profiles: main, main10, main444
@ -20,7 +20,6 @@ $fileTester = "$PSScriptRoot\mediainfo.exe"
if(!(Test-Path $NVEncoder -PathType leaf)) if(!(Test-Path $NVEncoder -PathType leaf))
{ {
Write-Host "NVEncC64.exe not found, please check path in `"$NVEncoder`"." -ForegroundColor Yellow Write-Host "NVEncC64.exe not found, please check path in `"$NVEncoder`"." -ForegroundColor Yellow
Read-Host -Prompt "Press Enter to exit"
exit exit
} }
@ -29,7 +28,7 @@ $videos = Get-ChildItem -LiteralPath $videoPath -Name -Recurse -Include ('*.mp4'
# Instantiating used variables: # Instantiating used variables:
$videoID = 1 $videoID = 1
$convertedVideos = 1 $convertedVideos = 0
$notConvertedVideos = 0 $notConvertedVideos = 0
$failedVideos = 0 $failedVideos = 0
# Square brackets are used as wildcards in Powershell. # Square brackets are used as wildcards in Powershell.
@ -40,8 +39,7 @@ $count = $videos.Count
if($videos.Count -lt 1) if($videos.Count -lt 1)
{ {
Write-Host "No videos found in: $videoPath" -ForegroundColor Red Write-Host "No videos found in: $videoPath" -ForegroundColor Red
Read-Host -Prompt "Press Enter to exit" exit
exit
} }
# Log write function: # Log write function:
Function LogWrite Function LogWrite
@ -83,9 +81,9 @@ foreach($video in $videos)
if($codec -ne "HEVC") if($codec -ne "HEVC")
{ {
# Configure new file naming: # Configure new file naming:
if ($video -match "264") if ($video -match "x264")
{ {
$outputFile = $videoPath + $video.Replace("264", "265") $outputFile = $videoPath + $video.Replace("x264", "x265")
} else { } else {
$outputFile = $videoPath + $video.Insert(($video.Length - 4), '-HEVC') $outputFile = $videoPath + $video.Insert(($video.Length - 4), '-HEVC')
} }
@ -160,7 +158,7 @@ foreach($video in $videos)
LogWrite "$inputFile" LogWrite "$inputFile"
} }
} }
#Start-Sleep -Seconds 4 Start-Sleep -Seconds 4
} else } else
{ {
# Alert if video doesn't need conversion: # Alert if video doesn't need conversion:
@ -172,6 +170,7 @@ foreach($video in $videos)
$notConvertedVideos = $notConvertedVideos + 1 $notConvertedVideos = $notConvertedVideos + 1
$Logfile = "$PSScriptRoot\logs\$logFolderName\skipped_files.log" $Logfile = "$PSScriptRoot\logs\$logFolderName\skipped_files.log"
LogWrite "$inputFile" LogWrite "$inputFile"
Start-Sleep -Seconds 4
} }
# Increments video counter: # Increments video counter:
$videoID = $videoID + 1 $videoID = $videoID + 1