Welcome to vcgif’s documentation!

Getting Started

This document will show you how to get up and running with vcgif.

Requirement

Python3 and pip3 are required for install vcgif.

# update system package
$ sudo apt-get update

# install python3 and pip3
$ sudo apt-get install python3 python3-pip

FFmpeg is required for process video.

$ sudo add-apt-repository ppa:mc3man/trusty-media
$ sudo apt-get update
$ sudo apt-get install ffmpeg

Install

After you match the requirements, you can install vcgif directly from PyPI.

$ sudo pip3 install vcgif

Usage

There is a simple example for vcgif.

$ vcgif -v /vagrant/SampleVideo_1280x720_2mb.mp4 -dest . -n test

Note

-v option is indicate your video path, -dest option is indicate the path where you want to put the gif, -n option is your gif file name.

Options

Open your command and running the following code, you will see a list of helps from vcgif.

$ vcgif -h

Command Option Lists

This docs is aim to describe all existing options in the vcgif.

Video path

The option -v or --video is used for indicate the video path.

Note

vcgif -v /var/www/video.mp4

Picture path

The option -p or --picture is used for indicate your picture path, you can have multiple pictures path exist.

Note

vcgif -p /var/www/pic1.png /var/www/pic2.png

Gif start time

The option -st or --start-timestamp is mark the start time from the video. picture is not require use this option.

default value is 0

Note

vcgif -st 10

Gif duration time

The option -gd or --gif-duration is the display time for your gif.

default value is 5

Note

vcgif -gd 10

Frames per second

The option -fps or --fps is for the frames per second of output gif.

default value is 15

Note

vcgif -fps 20

Gif quality

The option -q or --quality is indicate your gif quality.

default value is ``low``, you can use ``high`` to generate high quality gif

Note

vcgif -q high

Gif file destination

The option -dest or --destination is indicate your output file path.

default value is ``.``

Note

vcgif -dest /var/www/gif

Gif file name

The option -n or --name is your gif file name.

default value is uuid random string (do not need add file extension at the end)

Note

vcgif -n my_gif

API Reference

Gif Abstract Class

class vcgif.GifAbstract.GifAbstract[source]

Gif Abstract Class

This class is gif abstract class, all convert class(video or picture) should inherit from this class.

Args:
  • video (string): video path.
  • start_timestamp (int): set the start timestamp of the video.
  • gif_duration (int): set the gif duration length.
  • fps (int): set the gif file frame rate.
  • quality (string:high, string:low): set the gif file quality.
  • destination (string): set the gif file output path.
  • gif_name (string): set the gif filename.
destination

string: return gif output file path.

Parameters:path – string
fps

int: return gif fps number.

Parameters:number – integer
generate_gif()[source]

Abstract method for generate gif

All class should implement this method, even using pass.

gif_duration

int: return gif duration length.

Parameters:length – integer
name

string: return gif output filename.

Parameters:name – string
quality

string: return gif file quality.

Parameters:quality – string
start_timestamp

int: return start timestamp length.

Parameters:time – integer
video

string: return video path.

Parameters:path – string

Indices and tables