Skip to content

Extracting frames from a video and save them as images using PHP.

Notifications You must be signed in to change notification settings

Preshy/video-frames-extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Video Frames Extractor Script

A command-line tool to extract video frames to photos (video previews).

Prerequisites

  • PHP 8 or later
  • Composer
  • FFmpeg installed on your system
  • PHP-FFmpeg
  • A video file and an output directory for the frames

Installation

  • Clone or download the repository to your local machine
  • In the terminal, navigate to the root directory of the repository
  • Run the following command to install the dependencies:
$ composer install

Usage

The tool takes two arguments: the input video file, the output directory. To run the tool, open the terminal, navigate to the root directory of the repository, and run the following command:

Execute code

$ php index.php demo/input.mp4 demo/frames

The tool will add the watermark image to the center of the input video file and save the result as the output video file. The output file will have the same format as the input file.

Note

If the arguments are not passed, you will get an error message:

Error: missing required argument(s). Usage: php index.php inputFile outputPath

Demo

Open the demo folder to view a demo video and its generated frames

Contributions

PR's / Reviews are welcome here. I'm always open to learning!

About

Extracting frames from a video and save them as images using PHP.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages