This Node.js script converts .mov
files to .gif
format using the ffmpeg
command-line tool. You can provide the .mov
file path from the terminal, and the script will output a .gif
in the same directory.
Make sure you have Node.js installed on your machine. You can check by running:
node -v
If Node.js is installed, it will return the version number. If not, follow the installation instructions at nodejs.org.
The script uses ffmpeg
to perform the video conversion. You need to install ffmpeg
on your system:
brew install ffmpeg
-
Download
ffmpeg
from the official website: ffmpeg.org ffmpeg. -
Follow the installation instructions for Windows.
-
Add
ffmpeg
to your system's PATH so you can use it in the command line. -
To verify that ffmpeg is installed, run:
ffmpeg -version
sudo apt update
sudo apt install ffmpeg
- Clone this repository or copy the script.
- Save the script as
convertMovToGif.js
. - Open a terminal in the same directory where the script is saved.
- Run the following command, replacing
path/to/your/video.mov
with the actual path to your .mov file:
node convertMovToGif.js path/to/your/video.mov
Example:
node convertMovToGif.js ./example.mov
- The output
.gif
will be saved in the same directory as the.mov
file with the same name (but.gif
extension). - You can modify the
fps
(frames per second) andscale
options inside the script to adjust the quality of the GIF.