Skip to content

Instantly share code, notes, and snippets.

@HeyBanditoz
Created June 8, 2020 07:24
Show Gist options
  • Save HeyBanditoz/e85aa647574bb3883fa97f49f08cc359 to your computer and use it in GitHub Desktop.
Save HeyBanditoz/e85aa647574bb3883fa97f49f08cc359 to your computer and use it in GitHub Desktop.
param (
[string]$fps = "30",
[Parameter(Mandatory=$true)][string]$File,
[Parameter(Mandatory=$true)][string]$Start,
[Parameter(Mandatory=$true)][string]$Duration
)
$Size = 7.5*8000
$Bitrate=$Size/$duration
write-output "$fps fps, $duration duration, $Bitrate bitrate."
ffmpeg -hide_banner -loglevel info -an -ss $Start -t $Duration -y -i $File -c:v libvpx-vp9 -b:v ${BITRATE}k -pass 1 -row-mt 1 -r $FPS -f webm - > $null
Invoke-Expression "ffmpeg -hide_banner -loglevel info -ss $Start -t $Duration -i $File -c:v libvpx-vp9 -b:v ${BITRATE}k -c:a libopus -b:a 128k -pass 2 -row-mt 1 -r $FPS -f webm ${File}.webm"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment