Programmatically generate animated GIF from video in Python(convert video to gif)
Programmatically generate animated GIF from video in Python
With this video2gif converter you can upload any format of video and rich media files to turn them into high quality animated GIFs.
Python 3.6+, pysimplegui,opencv-python and other common packages listed in requirements.txt
.
pip install vgif -U
python3 setup.py install
vgif-gui
The options includes: * Video Sample Rate:Set sample rate for the source video (default sample every 10 frame) * Output GIF FPS: Set output GIF fps(default 10 fps) * Video Resize Rate: Shrink video n times smaller (default 2 times smaller)
Usage:
vgif [OPTIONS]
Converts video to GIF.
Options:
-i, --input PATH input video file
-o, --output TEXT output gif file path and name.
-s, --scale INTEGER Scale the factor for frame_x and frame_y.
-r, --resolution TEXT The resolution factor for factor ( For Compress ),
like 1920x1080.
-fps, --gif-fps INTEGER The fps of the GIF.
--help Show this message and exit.
Just Give the Input:
vgif -i /myLocalDir/myVideo.mov
This will generate the GIF with the same name to the same directory as the original file.
Give the file path for out.:
vgif -i /myLocalDir/myVideo.mov -o /some_dir/out.gif
pip3 install -r requirements.txt
Use this bibtex to cite this repository:
@misc{ouzheng1993,
title={video2gif},
author={ou zheng},
year={2020},
publisher={Github},
journal={GitHub repository},
howpublished={\url{https://github.com/ozheng1993/video2gif}},
}
Contributions to this repository are welcome. Examples of things you can contribute: