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 🙏

© 2024 – Pkg Stats / Ryan Hefner

json2video-sdk

v2.0.4

Published

SDK for creating videos programmatically using JSON2Video API

Downloads

334

Readme

Note: Updated for API v2.0

Create videos programmatically in Node JS

Create and edit videos: add watermarks, resize videos, create slideshows, add soundtrack, automate the creation of videos in multiple languages, add voice-over, add text animations.

JSON2Video is a video editing API that simplifies creating, editing and customising videos programmatically. Its dead simple approach, close to the web development mindset, makes it the ultimate solution for developers that want to create or customise videos in an automated way.

Additionally, the simple integration of real HTML5+CSS elements, the already built-in text animations and voice generation (TTS) converts JSON2Video in the best solution in its category.

Use cases

  • Automate the production of promotional videos for your e-commerce products
  • Automate publication of social media videos created directly from your news feed
  • Customize your advertising campaigns with different images, videos, texts and create tens or hundreds of different options
  • From weather forecasts to traffic bulletins or financial reports, if you have a data source you can create an audiovisual experience
  • Convert your text, pictures and information into engaging videos of your real estate properties
  • Add watermarks, bumpers, titles; Concatenate different videos into one; Add voice-over or music; Create photo slideshows; …

Get your FREE API Key

JSON2Video is free to use. Get your API Key at JSON2Video.com

Documentation

The API Specification will provide you with all the details of the JSON payload and the endpoints.

For a step by step guide, read the Tutorial that will introduce you through all features with code examples.

NodeJS SDK installation

The SDK has no external dependencies on other packages.

  1. Open the terminal and cd to your project directory
  2. Use npm:
npm install json2video-sdk

Hello world

JSON2Video makes video creation easy as a piece of cake:

    const {Movie, Scene} = require("json2video-sdk");
        
    async function main() {
        // Create a new movie
        let movie = new Movie;

        // Set your API key
        // Get your free API key at https://json2video.com
        movie.setAPIKey(YOUR_API_KEY);

        // Set movie quality: low, medium, high
        movie.set("quality", "high");

        // Generate a video draft 
        movie.set("draft", true);

        // Create a new scene
        let scene = new Scene;

        // Set the scene background color
        scene.set("background-color",  "#4392F1");

        // Add a text element printing "Hello world" in a fancy way (style 003)
        // The element is 10 seconds long and starts 2 seconds from the scene start
        scene.addElement({
            type: "text",
            style: "003",
            text: "Hello world",
            duration: 10,
            start: 2
        });

        // Add the scene to the movie
        movie.addScene(scene);

        // Call the API and render the movie
        let render = await movie.render();
        console.log(render);

        // Wait for the movie to finish rendering
        await movie
            .waitToFinish((status) => {
                console.log("Rendering: ", status.movie.status, " / ", status.movie.message);
            })
            .then((status) => {
                console.log("Response: ", status);
                console.log("Movie is ready: ", status.movie.url);
            })
            .catch((err) => {
                console.log("Error: ", err);
            });
    }

    main();

This is the resulting video:

https://assets.json2video.com/sites/github/hello-world.mp4