FatalBulletHit

mkv2mp4 Converter

Oct 23rd, 2019 (edited)
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # https://pastebin.com/4ne6PgP6
  2. # Converts .mkv files to .mp4 files
  3. # Requires VLC Media Player
  4.  
  5. Param (
  6.  
  7.     [Parameter(ValueFromPipeline=$true)]
  8.     $InputFile
  9.  
  10. )
  11.  
  12. $Host.UI.RawUI.WindowTitle = 'mkv2mp4 Converter'
  13. $OutputFile = $InputFile.Replace('.mkv', '.mp4')
  14. $VLCProcess = Start-Process 'C:\Program Files\VideoLAN\VLC\vlc.exe' -ArgumentList ('-I dummy -vvv "' + $InputFile + '" --sout=#transcode{}:standard{access="file",mux="mp4",dst="' + $OutputFile + '"} vlc://quit') -PassThru
  15.  
  16. Write-Host ("Converting '" + $InputFile + "'   ") -NoNewline
  17.  
  18. while ((Get-Process -Id $VLCProcess.Id 2>$null) -ne $null) {
  19.  
  20.     Write-Host "`b`b`b   " -NoNewline
  21.     Start-Sleep -Milliseconds 250
  22.     Write-Host "`b`b`b.  " -NoNewline
  23.     Start-Sleep -Milliseconds 250
  24.     Write-Host "`b`b`b.. " -NoNewline
  25.     Start-Sleep -Milliseconds 250
  26.     Write-Host "`b`b`b..." -NoNewline
  27.     Start-Sleep -Milliseconds 250
  28.  
  29. }
  30.  
  31. Write-Host -ForegroundColor Green " Done!"
  32. Start-Sleep 1
Add Comment
Please, Sign In to add comment