Modified the "check" script in package.json to reference the correct "examples" directory. Updated the README to replace "video editor" with "media compositor" for improved accuracy and restructured some sentences for better readability. Removed outdated documentation files related to assets, CLI, composition, distribution, and getting started, streamlining the documentation for a more focused user experience.
2.3 KiB
2.3 KiB
dapi media grab <id|path>
Decodes one or more frames of a video asset at the given times and writes each to a PNG file; like node capture, but grabs the asset's own pixels at full resolution (unlike node capture, which captures the composited canvas). Renders locally; no credits.
Input
<id|path>: a video asset id, or a local video file to grab frames from in place without adding it to the library (required).-t, --time <time...>: one or more timestamps to grab,Timevalues in source/content time (optional; default0). A negative value is an offset back from the end of the clip, so-1is one second before the end and-1fone frame before it. Order is preserved in the output regardless of the order given. Mutually exclusive with--count.-c, --count <n>: instead of--time, grabnframes evenly spaced across the clip at a fixed interval ofwindow / n, starting at the window start (optional; positive integer).-s, --start <time>: with--count, the start of the window to sample (optional;Timevalue; default0).-e, --end <time>: with--count, the end of the window to sample (optional;Timevalue; default the asset duration).-q, --quality <preset>: per-frame resolution preset (optional; defaultsmall). One ofsmall(384x384),medium(768x768),large(1536x1536), orfullres(native). Each caps the total pixel count while preserving aspect ratio.--no-timestamp: don't stamp each frame with itsHH:MM:SS:FFtimestamp label (optional; the label is drawn by default).--uncapped: lift the 100-frame safety cap (optional). Without it, requesting more than 100 frames (via--countor--time) is rejected.-o, --output <dir>: directory to write the PNGs into (optional; default the system temp directory). Each frame is written as a uuid-named.png.
Output
JSON Lines, one object per requested timestamp, in the requested order:
{ time: number; path: string } // time = the requested timestamp in seconds; path = the written PNG
Errors
Exits non-zero if the id is unknown, the asset is not a video, any --time is past the asset's duration, the --count window is empty, --time and --count are combined, --start/--end are given without --count, more than 100 frames are requested without --uncapped, or a PNG can't be written.