Skip to content
Apexify.jsDocs
Apexify.js version v5.4.5

Node / Video Ffmpeg · guide

Discovery & metadata options

Current Apexify.js 6.0.0 documentation for Discovery & metadata options.

apexify.jsRuntime: nodeCURRENTSince 6.0.0

getInfo

What it does: Reads container + primary video stream via ffprobe (duration, size, fps, bitrate, format name). Does not write a file.

When to use: Before cropping/scaling, choosing trim points, or sizing thumbnails.

Effect of the flag

InputBehaviour
getInfo: trueReturns { duration, width, height, fps, bitrate, format }. duration is seconds; fps from r_frame_rate (fallback 30).

No other fields on VideoCreationOptions matter for this branch besides source.

Example

SOURCEtypescript
typescript
Studio
const painter = new ApexPainter(); const info = await painter.createVideo({  source: './episode.mp4',  getInfo: true,}); console.log(  `Duration ${info.duration}s, ${info.width}x${info.height} @ ${info.fps}fps`);

detectFormat

What it does: Same metadata as getInfo, plus a video codec tag (h264, vp9, …) from ffprobe stream codec_name.

When to use: Logging, conditional pipelines (“if HEVC, transcode first”), or debugging uploads.

Options

There are no sub-options — only detectFormat: true.

Return shape

FieldMeaning
codecVideo codec short name or unknown.
format, containerContainer format_name from getInfo.
width, height, fps, bitrate, durationSame as getInfo.

Example

SOURCEtypescript
typescript
Studio
const probe = await painter.createVideo({  source: './upload.bin', // buffer or path  detectFormat: true,}); if (probe.codec === 'hevc') {  console.warn('HEVC — consider converting for web');}

Next steps