GithubHelp home page GithubHelp logo

shotstack / pexels-slideshow-demo Goto Github PK

View Code? Open in Web Editor NEW
27.0 3.0 2.0 132 KB

A Node JS Express/Serverless demo application that creates a slideshow video using the Pexels image library and Shotstack video editing API.

Home Page: https://shotstack.io/demo/pexels-slideshow/

License: MIT License

JavaScript 66.89% HTML 29.07% CSS 4.04%
video slideshow-maker slideshow videoeditor-sdk videoediting pexels shotstack-api serverless aws-lambda serverless-framework

pexels-slideshow-demo's Introduction

Shotstack Pexels Slideshow Video Demo

This project demonstrates how to use the Shotstack cloud video editing API to create a video using an HTML form and images sourced from the Pexels image library.

An HTML web form allows the user to search the Pexels library via the Pexels API, choose a soundtrack and add a title. Luma matte transitions are also used to create a more engaging video effect. The final video is the created by the Shotstack API using the images returned by the Pexels search and the soundtrack and title entered by the user.

View the live demo at: https://shotstack.io/demo/pexels-slideshow/

The demo is built using Node JS and can be used with either Express Framework or deployed as a serverless projects using AWS Lambda and API Gateway.

Requirements

Project Structure

The project is divided in to a two components:

Backend API

The backend API with an endpoint which searches the Pexels API, prepares the edit and posts the data to the Shotstack API. A status endpoint is also available which can be polled to return the status of the video as it renders.

The backend API source code is in the api directory.

Frontend Web Form & Player

The frontend is a simple HTML form that allows the user to enter a search term and basic options to create a video. The form uses jQuery to submit the data to the backend API and poll the status of the current render. There is also a video player that is loaded with the final rendered video when ready.

The front end API source code is in the web directory.

Installation

Install node module dependencies:

cd api
npm install

Configuration

Copy the .env.dist file and rename it .env:

cp .env.dist .env

Replace the environment variables below with your Pexels and Shotstack API key (staging key):

PEXELS_API_KEY=replace_with_your_pexels_key
SHOTSTACK_API_KEY=replace_with_your_shotstack_key

Run Locally

To start the API and serve the front end form (from the api directory):

npm run start

The visit http://localhost:3000

Deploy Serverless Application (optional)

The project has been built as a serverless application using the Serverless Framework and AWS Lambda. To understand more about the Serverless Framework and how to set everything up consult the documentation: https://serverless.com/framework/docs/providers/aws/

To deploy to AWS Lambda (from the api directory):

cd api
npm run serverless

Once the API is deployed set the var apiEndpoint variable in web/app.js to the returned API Gateway URL.

Run the web/index.html file locally or use AWS S3 static hosting to serve the web page.

pexels-slideshow-demo's People

Contributors

jeffski avatar mykoleg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.