Skip to content

This is a library of scripts that come in handy when working with media files

License

Notifications You must be signed in to change notification settings

golivecosmos/pluto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pluto 🪄

License Cosmos Cosmos

What is Pluto?

Pluto is a library of scripts for working with media files. This library provides various functionalities such as resizing images, creating video from images or documents, and encoding files into differnt formats.

Why is Pluto helpful?

Sometimes you need a quick way to work with media files. For example:

  • Creating a slideshow video from a set of images
  • Converting image and video file into browser-friendly formats
  • Generating responsive images for a website scaled to various sizes

If you find yourself working with media files often, it may be helpful to have a library to automate your workflows.

To use the library, follow the prerequisites below and run from your terminal.

Prerequisites

Before using this library, make sure you have the following software installed on your machine:

  • FFmpeg: FFmpeg is a command-line tool used for handling multimedia data. It can be downloaded from the official FFmpeg website: https://ffmpeg.org/
  • ImageMagick: ImageMagick is a software suite used to create, edit, and compose bitmap images. You can download ImageMagick from the official website: https://imagemagick.org/

Getting Started

To get started, check out the table of contents below and follow these steps:

  1. Decide which 🪄 command 💫 you'd like to apply to your media files

  2. Store your media files in the assets directory in this repo

  3. Run the name of the command from your terminal like so:

    sh index.sh <command> <file1> <file2> <option1>
  4. Check the assets directory for the created file


Table of Contents

Convert Multiple Images to Video

This command can encode multiple image files into an MP4 video file. Pass in the desired transition (you can find all the available options in the FFmpeg documentation), duration, and files you'd like to join.

Usage:

sh index.sh multiple-images-to-video hblur 12 assets/image1.png assets/image2.png assets/image3.png assets/image4.png 

Convert Image to Video

This command can encode an image file into an MP4 video file. Pass in the desired frame rate and duration. Frame rate will default to 24 frames per second and duration will default to 10 seconds.

Usage:

sh index.sh image-to-video assets/image.png 24 10

Convert Image to WebP

This command can encode image files into a WebP file format.

Usage:

sh index.sh webp assets/image.png

Convert PDF to MP4

This command allows you to turn a PDF with multiple pages into a slideshow video with an audio track.

Usage:

sh index.sh pdf-to-mp4 assets/document.pd4 audio.mp3

Convert Video to GIF

This command will convert a video file into a GIF file format.

Usage:

sh index.sh gif assets/video.mp4

Convert Video to MP4

This command can encode GIF or other video files into an MP4 file format.

Usage:

sh index.sh mp4 assets/example.gif

Convert Video to OGG

This command can encode GIF or other video files into an OGG file format.

Usage:

sh index.sh ogg assets/example.gif

Convert Video to WebM

This command can encode GIF or other video files into a WebM file format.

Usage:

sh index.sh webm assets/example.gif

Create a Horizontal Stack

This command will stack two images or videos next to each other, horizontally.

Usage:

sh index.sh hstack assets/image.png assets/image2.png

Resize an image

This command will resize an image to a desired scale. Pass in a file and the scale you want to resize the image into as a decimal, e.g. 0.5 for for 50%.

Usage:

sh index.sh resize assets/image.png 0.5

Extract clip from a video

This command will extract a clip from the video using timestamps. The command requires a start and end timestamp following this format: HH:MM:SS.

Usage:

sh index.sh extract-clip assets/video.mp4 00:00:05 00:00:20 

Extract frames from a video

This command will extract N number of frames from a video. Pass in a video file and the frames per second as a decimal, e.g. 1 for an image every 1 second, 2 for 2 images every 1 second, 0.25 for an image every 4 seconds.

Usage:

sh index.sh video-to-image assets/video.mp4 0.5

Modify video speed

This command will speed up or slow down a video. Pass in a video file and the speed as a decimal, e.g. 2 to slow down the video, 0.5 to double the speed of the video.

Usage:

sh index.sh modify-video-speed assets/video.mp4 0.5

How to Contribute

Feel free to explore these scripts and open any issues if there's something you'd like to see added, or open a pull request to add new scripts.

Thank you to ⭐star gazers⭐ supporting the project

Stargazers repo roster for @golivecosmos/pluto