Skip to content

Instantly share code, notes, and snippets.

@mmodrow
Last active March 26, 2024 19:55
Show Gist options
  • Save mmodrow/e0446dae2dbbd0abbc8e9b05b1b919cd to your computer and use it in GitHub Desktop.
Save mmodrow/e0446dae2dbbd0abbc8e9b05b1b919cd to your computer and use it in GitHub Desktop.
Use FFMpeg to strip (unusable) Audio from video files
$videos = @(Get-ChildItem *.avi | Where-Object { -not $_.name.contains("_h264") -and -not $_.name.contains("_noAudio") })
$total = $videos.count
$current = 1
foreach ($video in $videos) {
$silentVideoName = $video.basename + "_noAudio_h264.mp4"
Write-Progress -Status "Stripping Audio and recoding video to h.264." -PercentComplete ($current / $total * 100) -Activity "Writing file $current of $total."
if ( -not (Test-Path $silentVideoName )) {
Write-Host ("Converting " + $silentVideo.name + " to " + $silentVideoName + ".")
ffmpeg -i $video.name -an -c:v libx264 -hide_banner -v warning $silentVideoName
}
$current++
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment