Repository navigation
Added
Video.diagnose() reports, before rendering, what will make an export differ from what the composition seems to ask for, each with a fix:
for diagnostic in await video.diagnose() {
print(diagnostic)
}
// warning [frameRateDowngrade] clip [0]: beach.mov is 59.94 fps and the export is 30 fps, so frames are dropped and motion is less smooth. Fix: Export at its rate with .preset(.custom(width: 1080, height: 1920, frameRate: 60, codec: .hevc)).| Kind | Severity |
|---|---|
unreadableSource: a missing file, not a file URL, no video track, or unreadable |
error |
overlaysOnSimulator |
error |
frameRateDowngrade: counted after speed, so a 60 fps clip at half speed fits 30 fps |
warning |
variableFrameRate |
warning |
hdrToSDR |
warning |
ignoredCompositor: a Video compositor on a single-track composition, which never runs |
warning |
aspectFillCrop |
info |
filterPreRender |
info |
It reads only metadata (nothing is decoded) and never throws. Results come worst first, then in builder order. Match on kind and severity, which are stable. Diagnostic.Kind is a struct, so new checks can arrive in minor releases.
There's a new article, Checking a Composition Before Export. Designed in RFC #232.
.package(url: "https://github.com/SteliyanH/kadr.git", from: "1.4.0")