The responseFormat parameter is a string value that defines the format in which the rendered output is generated. Depending on the template selected, available format options may differ. However, Orshot generally supports the following formats:
pngwebpjpgjpegpdfmp4 - Standard video format with H.264 encodingwebm - Web-optimized video format with VP9 encodinggif - Animated GIF (no audio support)Video formats are only available for templates that contain video elements. The output duration is determined by the video element's duration and trim settings.
const response = await Orshot.renderFromTemplate({
templateId: "website-screenshot",
responseType: "url",
responseFormat: "webp", // [!code highlight]
modifications: {
testimonialText:
"Pika has converted me from any other screenshot tool I used before (happily)",
testimonialFontSize: 42,
rating: 3,
authorPhoto: "https://cdn.pika.style/headshots/caleb.png",
authorName: "Caleb Leigh",
authorDescription: "Head of Marketplace, Elgato",
authorMetaFontSize: 40,
width: 800,
},
});