Last active
May 28, 2024 17:40
-
-
Save ftischhauser/8a0642bda85eed1dbcf04a8dd641f444 to your computer and use it in GitHub Desktop.
DoVi_Check_Infuse_Compatibility.ps1
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 characters
$fn = $args[0] | |
Start-Process -Wait -NoNewWindow 'cmd.exe' -ArgumentList "/C `"ffmpeg.exe -hide_banner -loglevel panic -i `"$fn`" -c:v copy -frames:v 1 -vbsf hevc_mp4toannexb -f hevc - | dovi_tool extract-rpu - -o `"$($fn).RPU.bin`"`"" | |
Start-Process -Wait -NoNewWindow 'cmd.exe' -ArgumentList "/C `"dovi_tool.exe info `"$($fn).RPU.bin`" -f 0 > `"$($fn).RPU.json`"`"" | |
$rpu = (Get-Content "$($fn).RPU.json" | Select-Object -Skip 1) | ConvertFrom-Json | |
if ($rpu.dovi_profile) { | |
Write-Output "Profile: $($rpu.dovi_profile)" | |
if ($rpu.dovi_profile -eq 5) { | |
Write-Output "Natively supported." | |
} | |
elseif ($rpu.dovi_profile -eq 8) { | |
foreach ($curve in $rpu.rpu_data_mapping.curves) { | |
if ($curve.num_pivots_minus2) { | |
Write-Warning "File may contain luma/chroma mapping." | |
} | |
} | |
if ($rpu.vdr_dm_data.cmv29_metadata) { | |
Write-Output "File contains CMv2.9 metadata." | |
} | |
if ($rpu.vdr_dm_data.cmv40_metadata) { | |
Write-Warning "File contains CMv4.0 metadata." | |
} | |
} | |
else { | |
Write-Warning "Profile not supported by Infuse." | |
} | |
} | |
else { | |
Write-Warning "Error extracting RPU details." | |
} | |
Remove-Item -Force "$($fn).RPU.bin" | |
Remove-Item -Force "$($fn).RPU.json" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this! Comes in handy.
Rather than using the ffmpeg
-t 1
option to read 1 second, I've found it works to use the-frames:v 1
option on the output side (after the-i
option, e.g.,-i `"$fn`" -c:v copy -frames:v 1
) to only output the first frame, since that's all dovi_tool needs to read.So it can process a file faster by only processing a single frame.