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.

Revisions

  1. HeyBanditoz created this gist Jun 8, 2020.
    12 changes: 12 additions & 0 deletions encoder.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    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"