Giter Site home page Giter Site logo

shotstack / coronavirus-data-video-demo Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 5.0 76 KB

A demo to show how data can be used to generate videos using the Shotstack API

Home Page: https://bit.ly/3bAJkZe

License: MIT License

JavaScript 100.00%
video coronavirus coronavirus-video generative-design video-editing video-edit-sdk

coronavirus-data-video-demo's Introduction

Coronavirus (COVID-19) Data Generated Videos

This is a demo to showcase using a data source to generate videos using the Shotstack API.

covid-data-video-opt

A NodeJS script loops through a data set of Coronavirus (Covid-19) global pandemic cases and deaths sourced from Our World In Data and generates a video for a selected country.


Requirements

This project was developed using Node v10.15.3 and NPM 6.4.1.

API Key

To run the project you will need a Shotstack API key. If you do not have a key you can sign up via the Shotstack website.

Once you have a key, copy the .env.dist file and name it .env. Then add your staging API key next to the SHOTSTACK_KEY= parameter.

Your .env file should look something like:

SHOTSTACK_ENDPOINT=https://api.shotstack.io/stage
SHOTSTACK_KEY=KnYTD1jak82B83hwvL8kT5jlT66MMVqI2zE4dPPs

Installation

Install dependencies using the following:

npm install

Usage

Fetch/Update Data

Fetch the latest Coronavirus dataset:

npm run dataset

A CSV file full_data.csv is downloaded and saved in the project root directory.

List Countries

Display the list of countries available in the CSV file:

npm run list

Generate Video

Run the following command with the country you wish to generate a video for:

npm run generate -- --country [Country]

Replace [Country] with the country you want to generate a video for, i.e.

npm run generate -- --country 'Australia'

Note: the country value is case sensitive and must be entered exactly as it is stored in the Location column in the CSV file. Use the npm run list command to see a list of countries.

The edit request will be sent to the Shotstack API to be queued for rendering. After approximately 20 seconds the video will be ready and the URL will be output to the terminal.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.