https://github.com/nstevens1040/mp42gif
Python script to convert an MP4 file into an animated GIF.
https://github.com/nstevens1040/mp42gif
blend convert cross-platform ffmpeg-python gif linux macos minterpolate mp4 playback-rate python python3 slice to windows
Last synced: about 1 month ago
JSON representation
Python script to convert an MP4 file into an animated GIF.
- Host: GitHub
- URL: https://github.com/nstevens1040/mp42gif
- Owner: nstevens1040
- License: mit
- Created: 2021-10-19T08:37:12.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-28T21:50:57.000Z (over 4 years ago)
- Last Synced: 2025-10-19T16:50:40.089Z (8 months ago)
- Topics: blend, convert, cross-platform, ffmpeg-python, gif, linux, macos, minterpolate, mp4, playback-rate, python, python3, slice, to, windows
- Language: Python
- Homepage:
- Size: 32.2 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mp42gif
Python script that uses [ffmpeg-python](https://github.com/kkroening/ffmpeg-python) to convert an MP4 file into an animated GIF.
# Quick Start
Download the executable
- **Windows**
```ps1
# in Windows PowerShell
[System.Net.WebClient]::New().DownloadFile(
"https://github.com/nstevens1040/mp42gif/releases/download/v1.0.0/mp42gif.exe",
"$($PWD.Path)\mp42gif.exe"
)
Unblock-File .\mp42gif.exe
```
- **macOS / nix**
```ps1
curl "https://github.com/nstevens1040/mp42gif/releases/download/v1.0.0/mp42gif" --output "mp42gif"
chmod +x ./mp42gif
```
or use the script
- **cross-platform**
```sh
git clone https://github.com/nstevens1040/mp42gif.git
cd mp42gif
pip3 install -r requirements.txt
```
# Usage
```sh
usage: mp42gif.exe [-h] [--input VIDIN] [--slice] [--starttime SLICE_TIME] [--stoptime SLICE_TIME] [--playbackrate PBRATE] [--blend]
Specify how your video gets converted into a GIF
optional arguments:
-h, --help show this help message and exit
--input VIDIN --input (file path to your mp4 file)
--slice --slice --starttime (start time in seconds) --stoptime (end time in seconds) :: both arguments reflect the amount of seconds from the beginning of the video
--starttime SLICE_TIME --starttime (start time in seconds from the beginning of the video)
--stoptime SLICE_TIME --stoptime (stop time in seconds from the beginning of the video)
--playbackrate PBRATE --playbackrate (integer or decimal that is non-negative, non-zero, & not 1) :: numbers greater than 1 speed the video up and numbers between 0 and 1 slow the video down
--blend --blend (true or false) :: Determines whether the video gets "minterpolated"
```