Skip to content

Instantly share code, notes, and snippets.

@HunterAP23
Last active October 21, 2023 06:59
Show Gist options
  • Select an option

  • Save HunterAP23/0b5f5b0930ee74654f35a96e1c998960 to your computer and use it in GitHub Desktop.

Select an option

Save HunterAP23/0b5f5b0930ee74654f35a96e1c998960 to your computer and use it in GitHub Desktop.
Convert Media Sources to rawvideo AVI with transparency
@(Get-ChildItem -File -Recurse -Filter *.webm).foreach({
$pat = Split-Path ($_).FullName
$codec = ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 ($_).FullName
$new = "$pat\$(($_).BaseName)_RAWVIDEO.avi"
If ($codec -eq "vp8") {
ffmpeg -hide_banner -c:v libvpx -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new"
}ElseIf{
ffmpeg -hide_banner -c:v libvpx-vp9 -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new"
}
})
@(Get-ChildItem -File -Recurse -Filter *.mov).foreach({
$pat = Split-Path ($_).FullName
$new = "$pat\$(($_).BaseName)_RAWVIDEO.avi"
ffmpeg -hide_banner -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new"
})
@(Get-ChildItem -File -Recurse -Filter *.mp4).foreach({
$pat = Split-Path ($_).FullName
$new = "$pat\$(($_).BaseName)_RAWVIDEO.avi"
ffmpeg -hide_banner -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new"
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment