Video Compressor

I made this compressor because I hate all of the compressors that require admin permissions to download, so I made a quick compressor that compresses videos from gigabytes to megabytes, all according to what you want.

How to use:

  1. Download the EXE
  2. Download ffmpeg (I like to go to Command Prompt and write winget install ffmpeg)
  3. Open the EXE and select the video(s)/file(s) you want to compress
  4. Wait
  5. It will make a new folder in the same folder as the video with the name "compressed" and put all the compressed videos in there
  6. Enjoy the compressed videos!




If you want to know the prototype code, here it is:


# Where your videos you want to compress
$mainFolder = "F:\video"  # Video source folder
$compressedFolderName = "compressed"

Get-ChildItem -Path $mainFolder -Recurse -File -Include *.mp4 | ForEach-Object {
    $input = $_.FullName
    $relativePath = $input.Substring($mainFolder.Length).TrimStart("\")
    $outputDir = Join-Path $mainFolder $compressedFolderName
    $outputPath = Join-Path $outputDir $relativePath

    # Create output folder if it doesn't exist
    $outputPathDir = Split-Path $outputPath
    if (-not (Test-Path $outputPathDir)) {
        New-Item -ItemType Directory -Path $outputPathDir -Force | Out-Null
    }

    # Compress video to width 1024, preserve aspect ratio
    ffmpeg -i "$input" -vf "scale=1024:-2" -c:v libx264 -preset veryfast -crf 28 -c:a aac -b:a 128k "$outputPath"
    
    Write-Host "Compressed: $input -> $outputPath"
}

Remember to save the code as a .ps1 file or just run it in PowerShell (this doesn't have the GUI)