-
Notifications
You must be signed in to change notification settings - Fork 0
/
ComfyInfo.ps1
49 lines (38 loc) · 1.99 KB
/
ComfyInfo.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#push script location
$scriptPath = $MyInvocation.MyCommand.Path
$dir = Split-Path $scriptPath
Push-Location $dir
#loading functions
. .\helpers\commonFunctions.ps1
. .\helpers\Verifier.ps1
write-host "`r"
write-host "Information extractor. Checks for useful video information" -ForegroundColor Magenta -BackgroundColor black
Push-Location -path $rootLocation #Don't edit edit this, edit the config.json or delete it
write-host "`r"
Write-Host "Please select the video file" -ForegroundColor Yellow
$inputVideo = Get-FileName
if ($inputVideo -eq "") {
Write-Host "you didn't select anything, exiting" -ForegroundColor Red
Pause
exit
}
write-host "`r"
write-host "Parsing file, please wait..." -ForegroundColor Yellow
#Probe video info. This returns a custom object
$videoInfo = Get-VideoStreamInfo -inputFile $inputVideo
# Add the first keyframe interval to the video information
$videoInfo | Add-Member -Type NoteProperty -Name GOP -Value $firstKeyframeInterval
if ($videoInfo.codec_name -eq "h264") {
$tableProps = "codec_name", "profile", "level", 'MaxFPS(R)', "AvgFPS", 'VFR?', 'keyint (sec)', "GOP Struct", "time_base", "DAR", "SAR", "refs", "BFrames", "pix_fmt", "color_range", "color_space", "color_transfer", "color_primaries"
} elseif ($videoInfo.codec_name -eq "hevc") {
$tableProps = "codec_name", "profile", "level", 'MaxFPS(R)', "AvgFPS", 'VFR?', 'keyint (sec)', "GOP Struct", "time_base", "DAR", "SAR", "BFrames", "pix_fmt", "color_range", "color_space", "color_transfer", "color_primaries"
} else {
$tableProps = "codec_name", "profile", "level", 'MaxFPS(R)', "AvgFPS", 'VFR?', 'keyint (sec)', "GOP Struct", "time_base", "DAR", "SAR", "pix_fmt", "color_range", "color_space", "color_transfer", "color_primaries"
}
#print table
write-host "`r"
write-host "Result for: $inputVideo" -ForegroundColor Yellow
$videoInfo | Format-Table -Property $tableProps
pause
Pop-Location #pop location back to the dir script was ran from
Pop-Location #pop location back to the dir script was ran from