npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

photo-to-video-ai

v1773739.408.185

Published

Professional integration for https://pvid.app/

Readme

Photo to Video AI

A JavaScript library to seamlessly transform static images into engaging videos using AI-powered transitions and effects. Enhance your visual storytelling with minimal effort.

Installation

Install the package using npm: bash npm install photo-to-video-ai

Usage Examples

Here are a few examples demonstrating how to use photo-to-video-ai in your JavaScript/Node.js projects:

1. Basic Image to Video Conversion:

This example demonstrates the simplest way to create a video from a single image. javascript const photoToVideoAI = require('photo-to-video-ai');

async function createVideo() { try { const videoPath = await photoToVideoAI.createVideo({ imagePath: 'path/to/your/image.jpg', outputPath: 'path/to/your/output/video.mp4', }); console.log(Video created successfully at: ${videoPath}); } catch (error) { console.error('Error creating video:', error); } }

createVideo();

2. Creating a Video from Multiple Images with Custom Transitions:

This example shows how to create a video from an array of images, specifying transition types and durations. javascript const photoToVideoAI = require('photo-to-video-ai');

async function createVideoWithTransitions() { try { const videoPath = await photoToVideoAI.createVideo({ imagePaths: [ 'path/to/image1.jpg', 'path/to/image2.jpg', 'path/to/image3.jpg', ], outputPath: 'path/to/your/output/video_with_transitions.mp4', transition: { type: 'fade', // Example transition: fade, slide, zoom duration: 1, // Transition duration in seconds }, imageDuration: 3, // Duration each image is displayed in seconds }); console.log(Video with transitions created at: ${videoPath}); } catch (error) { console.error('Error creating video with transitions:', error); } }

createVideoWithTransitions();

3. Adding Background Music to Your Video:

This example demonstrates how to add background music to your generated video. javascript const photoToVideoAI = require('photo-to-video-ai');

async function createVideoWithMusic() { try { const videoPath = await photoToVideoAI.createVideo({ imagePath: 'path/to/your/image.jpg', outputPath: 'path/to/your/output/video_with_music.mp4', musicPath: 'path/to/your/music.mp3', musicVolume: 0.5, // Adjust music volume (0.0 to 1.0) }); console.log(Video with music created at: ${videoPath}); } catch (error) { console.error('Error creating video with music:', error); } }

createVideoWithMusic();

4. Advanced Configuration: Custom Video Resolution and Frame Rate:

This example shows how to configure the video resolution and frame rate. javascript const photoToVideoAI = require('photo-to-video-ai');

async function createCustomVideo() { try { const videoPath = await photoToVideoAI.createVideo({ imagePath: 'path/to/your/image.jpg', outputPath: 'path/to/your/output/custom_video.mp4', videoWidth: 1280, // Desired video width videoHeight: 720, // Desired video height frameRate: 30, // Desired frames per second }); console.log(Custom video created at: ${videoPath}); } catch (error) { console.error('Error creating custom video:', error); } }

createCustomVideo();

API Summary

The photo-to-video-ai library provides a single function:

  • createVideo(options): Creates a video from images based on the provided options. Returns a Promise that resolves with the path to the generated video file.

    • options: An object containing the following properties:

      • imagePath (string, optional): Path to a single image file. Required if imagePaths is not provided.
      • imagePaths (array of strings, optional): An array of paths to image files. Required if imagePath is not provided.
      • outputPath (string, required): Path where the generated video will be saved.
      • transition (object, optional): Transition configuration.
        • type (string, optional): Transition type (e.g., 'fade', 'slide', 'zoom'). Defaults to 'fade'.
        • duration (number, optional): Transition duration in seconds. Defaults to 1.
      • imageDuration (number, optional): Duration each image is displayed in seconds when using imagePaths. Defaults to 3.
      • musicPath (string, optional): Path to a background music file.
      • musicVolume (number, optional): Music volume (0.0 to 1.0). Defaults to 0.5.
      • videoWidth (number, optional): Desired video width in pixels. Defaults to 640.
      • videoHeight (number, optional): Desired video height in pixels. Defaults to 480.
      • frameRate (number, optional): Desired frames per second. Defaults to 24.

License

MIT

Official site links: