Last active
October 21, 2023 06:59
-
-
Save HunterAP23/0b5f5b0930ee74654f35a96e1c998960 to your computer and use it in GitHub Desktop.
Revisions
-
HunterAP23 revised this gist
Aug 26, 2021 . 1 changed file with 31 additions and 21 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,60 +1,70 @@ $loc = $args[0] If ($args.length -eq 0) { "Defaulting to current directory of `"$(Get-Location)`"" | Tee-Object -Append -filepath "$(Get-Location)\media_to_avi.log" } ElseIf ( $(Try { Test-Path $args[0].trim() } Catch { $false }) ) { "Path `"$loc`" was found." | Tee-Object -Append -filepath "$(Get-Location)\media_to_avi.log" } Else { "Path `"$loc`" was not found." | Tee-Object -Append -filepath "$(Get-Location)\media_to_avi.log" exit } @(Get-ChildItem -Path $loc -File -Filter *.webm).foreach({ "Working on file `"$_`"" | Tee-Object -Append -filepath "$(Get-Location)\media_to_avi.log" $pat = Split-Path ($_).FullName $codec = ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 "$_" $new = "$pat\$(($_).BaseName)_RAWVIDEO.avi" If ($codec -eq "vp8") { ffmpeg -hide_banner -hwaccel auto -c:v libvpx -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 -y "$new" } ElseIf ($codec -eq "vp9") { ffmpeg -hide_banner -hwaccel auto -c:v libvpx-vp9 -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 -y "$new" } Else { ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 -y "$new" } "Finished file `"$_`"" | Tee-Object -Append -filepath "$(Get-Location)\media_to_avi.log" }) @(Get-ChildItem -Path $loc -File -Filter *.mov).foreach({ "Working on file `"$_`"" | Tee-Object -Append -filepath "$(Get-Location)\media_to_avi.log" $pat = Split-Path ($_).FullName $new = "$pat\$(($_).BaseName)_RAWVIDEO.avi" ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 -y "$new" "Finished file `"$_`"" | Tee-Object -Append -filepath "$(Get-Location)\media_to_avi.log" }) @(Get-ChildItem -Path $loc -File -Filter *.mp4).foreach({ "Working on file `"$_`"" | Tee-Object -Append -filepath "$(Get-Location)\media_to_avi.log" $pat = Split-Path ($_).FullName $new = "$pat\$(($_).BaseName)_RAWVIDEO.avi" ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 -y "$new" "Finished file `"$_`"" | Tee-Object -Append -filepath "$(Get-Location)\media_to_avi.log" }) @(Get-ChildItem -Path $loc -File -Filter *.mkv).foreach({ "Working on file `"$_`"" | Tee-Object -Append -filepath "$(Get-Location)\media_to_avi.log" $pat = Split-Path ($_).FullName $codec = ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 "$_" $new = "$pat\$(($_).BaseName)_RAWVIDEO.avi" If ($codec -eq "vp8") { ffmpeg -hide_banner -hwaccel auto -c:v libvpx -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 -y "$new" } ElseIf ($codec -eq "vp9") { ffmpeg -hide_banner -hwaccel auto -c:v libvpx-vp9 -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 -y "$new" } Else { ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 -y "$new" } "Finished file `"$_`"" | Tee-Object -Append -filepath "$(Get-Location)\media_to_avi.log" }) @(Get-ChildItem -Path $loc -File -Filter *.avi).foreach({ If ($_ -notmatch "_RAWVIDEO.avi") { $codec = ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 "$_" If ($codec -eq "rawvideo") { "File `"$_`" is already in rawvideo AVI format - skipping..." | Out-File -append -noClobber -encoding UTF8 -filepath "$(Get-Location)\media_to_avi.log" } Else { "Working on file `"$_`"" | Tee-Object -Append -filepath "$(Get-Location)\media_to_avi.log" $pat = Split-Path ($_).FullName $new = "$pat\$(($_).BaseName)_RAWVIDEO.avi" ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 -y "$new" "Finished file `"$_`"" | Tee-Object -Append -filepath "$(Get-Location)\media_to_avi.log" } } }) -
HunterAP23 revised this gist
Aug 26, 2021 . 1 changed file with 21 additions and 21 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,17 @@ $loc = $args[0] If ($args.length -eq 0) { Write-Host "Defaulting to current directory of $(Get-Location)" } ElseIf ( $(Try { Test-Path $args[0].trim() } Catch { $false }) ) { Write-Host "Path $loc was found." } Else { Write-Host "Path $loc was not found." exit } @(Get-ChildItem -Path $loc -File -Filter *.webm).foreach({ Write-Host "Working on file $_" $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 -hwaccel auto -c:v libvpx -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" @@ -23,23 +23,23 @@ If ($args.length -eq 0) { }) @(Get-ChildItem -Path $loc -File -Filter *.mov).foreach({ Write-Host "Working on file $_" $pat = Split-Path ($_).FullName $new = "$pat\$(($_).BaseName)_RAWVIDEO.avi" ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" }) @(Get-ChildItem -Path $loc -File -Filter *.mp4).foreach({ Write-Host "Working on file $_" $pat = Split-Path ($_).FullName $new = "$pat\$(($_).BaseName)_RAWVIDEO.avi" ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" }) @(Get-ChildItem -Path $loc -File -Filter *.mkv).foreach({ Write-Host "Working on file $_" $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 -hwaccel auto -c:v libvpx -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" @@ -51,10 +51,10 @@ If ($args.length -eq 0) { }) @(Get-ChildItem -Path $loc -File -Filter *.avi).foreach({ If ($_ -notmatch "_RAWVIDEO.avi") { Write-Host "Working on file $_" $pat = Split-Path ($_).FullName $new = "$pat\$(($_).BaseName)_RAWVIDEO.avi" ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" } }) -
HunterAP23 revised this gist
Aug 26, 2021 . 1 changed file with 14 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,32 +10,36 @@ If ($args.length -eq 0) { @(Get-ChildItem -Path $loc -File -Filter *.webm).foreach({ Write-Host "Working on file $_" $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 -hwaccel auto -c:v libvpx -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" } ElseIf ($codec -eq "vp9") { ffmpeg -hide_banner -hwaccel auto -c:v libvpx-vp9 -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" } Else { ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" } }) @(Get-ChildItem -Path $loc -File -Filter *.mov).foreach({ Write-Host "Working on file $_" $pat = Split-Path ($_).FullName $new = "$pat\$(($_).BaseName)_RAWVIDEO.avi" ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" }) @(Get-ChildItem -Path $loc -File -Filter *.mp4).foreach({ Write-Host "Working on file $_" $pat = Split-Path ($_).FullName $new = "$pat\$(($_).BaseName)_RAWVIDEO.avi" ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" }) @(Get-ChildItem -Path $loc -File -Filter *.mkv).foreach({ Write-Host "Working on file $_" $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 -hwaccel auto -c:v libvpx -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" @@ -47,8 +51,10 @@ If ($args.length -eq 0) { }) @(Get-ChildItem -Path $loc -File -Filter *.avi).foreach({ If ($_ -notmatch "_RAWVIDEO.avi") { Write-Host "Working on file $_" $pat = Split-Path ($_).FullName $new = "$pat\$(($_).BaseName)_RAWVIDEO.avi" ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" } }) -
HunterAP23 revised this gist
Aug 26, 2021 . 1 changed file with 6 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,17 +22,15 @@ If ($args.length -eq 0) { @(Get-ChildItem -Path $loc -File -Filter *.mov).foreach({ Write-Host "Working on file $_" $pat = Split-Path ($_).FullName $new = "$pat\$(($_).BaseName)_RAWVIDEO.avi" ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" }) @(Get-ChildItem -Path $loc -File -Filter *.mp4).foreach({ Write-Host "Working on file $_" $pat = Split-Path ($_).FullName $new = "$pat\$(($_).BaseName)_RAWVIDEO.avi" ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" }) @(Get-ChildItem -Path $loc -File -Filter *.mkv).foreach({ @@ -51,6 +49,6 @@ If ($args.length -eq 0) { @(Get-ChildItem -Path $loc -File -Filter *.avi).foreach({ Write-Host "Working on file $_" $pat = Split-Path ($_).FullName $new = "$pat\$(($_).BaseName)_RAWVIDEO.avi" ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" }) -
HunterAP23 revised this gist
Aug 26, 2021 . 1 changed file with 33 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,16 @@ $loc = $args[0] If ($args.length -eq 0) { Write-Host "Defaulting to current directory of $(Get-Location)" } ElseIf ( $(Try { Test-Path $args[0].trim() } Catch { $false }) ) { Write-Host "Path $loc was found." } Else { Write-Host "Path $loc was not found." exit } @(Get-ChildItem -Path $loc -File -Filter *.webm).foreach({ Write-Host "Working on file $_" $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 -hwaccel auto -c:v libvpx -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" @@ -9,20 +19,25 @@ } }) @(Get-ChildItem -Path $loc -File -Filter *.mov).foreach({ Write-Host "Working on file $_" $pat = Split-Path ($_).FullName $new = "$pat\$(($_).BaseName)_HEVC.mp4" ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" }) @(Get-ChildItem -Path $loc -File -Filter *.mp4).foreach({ If ($_ -notmatch '_HEVC.mp4') { Write-Host "Working on file $_" $pat = Split-Path ($_).FullName $new = "$pat\$(($_).BaseName)_HEVC.mp4" ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" } }) @(Get-ChildItem -Path $loc -File -Filter *.mkv).foreach({ Write-Host "Working on file $_" $pat = Split-Path ($_).FullName $new = "$pat\$(($_).BaseName)_RAWVIDEO.avi" If ($codec -eq "vp8") { ffmpeg -hide_banner -hwaccel auto -c:v libvpx -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" @@ -31,4 +46,11 @@ } Else { ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" } }) @(Get-ChildItem -Path $loc -File -Filter *.avi).foreach({ Write-Host "Working on file $_" $pat = Split-Path ($_).FullName $new = "$pat\$(($_).BaseName)_HEVC.mp4" ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" }) -
HunterAP23 revised this gist
Aug 3, 2021 . 1 changed file with 20 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ @echo off setlocal EnableDelayedExpansion for %%a in (*.webm *.mkv) do ( FOR /F "usebackq" %%F IN (`ffprobe -v error -select_streams v:0 -show_entries stream^=codec_name -of default^=noprint_wrappers^=1:nokey^=1 "%%a"`) DO ( if "%%F"=="vp8" ( ffmpeg -hide_banner -c:v libvpx -i "%%a" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "%%~dpna_RAWVIDEO.avi" ) else ( if "%%F"=="vp9" ( ffmpeg -hide_banner -c:v libvpx-vp9 -i "%%a" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "%%~dpna_RAWVIDEO.avi" ) else ( ffmpeg -hide_banner -i "%%a" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "%%~dpna_RAWVIDEO.avi" ) ) ) ) for %%a in (*.mp4 *.mov) do ( ffmpeg -hide_banner -i "%%a" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "%%~dpna_RAWVIDEO.avi" ) -
HunterAP23 revised this gist
Aug 3, 2021 . 1 changed file with 13 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ $new = "$pat\$(($_).BaseName)_RAWVIDEO.avi" If ($codec -eq "vp8") { ffmpeg -hide_banner -hwaccel auto -c:v libvpx -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" } ElseIf ($codec -eq "vp9") { ffmpeg -hide_banner -hwaccel auto -c:v libvpx-vp9 -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" } }) @@ -19,4 +19,16 @@ $pat = Split-Path ($_).FullName $new = "$pat\$(($_).BaseName)_RAWVIDEO.avi" ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" }) @(Get-ChildItem -File -Recurse -Filter *.mkv).foreach({ $pat = Split-Path ($_).FullName $new = "$pat\$(($_).BaseName)_RAWVIDEO.avi" If ($codec -eq "vp8") { ffmpeg -hide_banner -hwaccel auto -c:v libvpx -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" } ElseIf ($codec -eq "vp9") { ffmpeg -hide_banner -hwaccel auto -c:v libvpx-vp9 -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" } Else { ffmpeg -hide_banner -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" } }) -
HunterAP23 revised this gist
Aug 3, 2021 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,20 +3,20 @@ $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 -hwaccel auto -c:v libvpx -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" }ElseIf{ ffmpeg -hide_banner -hwaccel auto -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 -hwaccel auto -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 -hwaccel auto -i "$(($_).FullName)" -pix_fmt rgba -c:v rawvideo -c:a aac -q:a 5 "$new" }) -
HunterAP23 revised this gist
Aug 3, 2021 . No changes.There are no files selected for viewing
-
HunterAP23 created this gist
Aug 3, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ @(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" })