Skip to content

Instantly share code, notes, and snippets.

@mmodrow
Created March 26, 2024 17:56
Show Gist options
  • Save mmodrow/dc9b76ba43ca5f98b23602d599d80a1b to your computer and use it in GitHub Desktop.
Save mmodrow/dc9b76ba43ca5f98b23602d599d80a1b to your computer and use it in GitHub Desktop.
Remove Video that had no (proper) audio and was stripped by ConvertTo-SilentVideo.ps1
$silentVideos = Get-ChildItem *.mp4 -Include @("*_noAudio*", "*_h264*") | Where-Object { $_.length -gt 0 }
foreach ($silentVideo in $silentVideos) {
$silentVideoName = ($silentVideo.basename.replace("_noAudio", "").replace("_h264", "")) + ".avi"
if (Test-Path($silentVideoName)) {
Write-Host ( "removing " + $silentVideoName)
Remove-Item $silentVideoName
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment