Skip to content

Commit

Permalink
initial files of project in version 0.0.1
Browse files Browse the repository at this point in the history
Signed-off-by: Nabi <nabikaz@gmail.com>
  • Loading branch information
NabiKAZ committed Apr 23, 2017
1 parent 848e4a0 commit 6e332e6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.idea
sample.mp4
sample.gif
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
# video2gif
A batch script for convert video to GIF files by FFmpeg.exe on Windows
A batch script for convert video to GIF files by FFmpeg.exe on Windows

## Installation
* Clone the repo
* Install [FFmpeg](http://ffmpeg.zeranoe.com/builds/) for Windows.
* Make sure the `ffmpeg.exe` and `video2gif.bat` are on your systems path.

## Usage
Anywhere you can use it be like this example:
```
video2gif myvideo.mp4
```
Then you have `myvideo.gif` in current directory.
If `myvideo.gif` there is existed, question from you for overwrite it.

## Tips
Special thanks to [this article](http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html).
10 changes: 10 additions & 0 deletions video2gif.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@echo off
rem by: nabi karamalizadeh <nabikaz@gmail.com>
rem description: video to gif converter
rem version: 0.0.1
rem license: The MIT License (MIT)
set arg1=%1
set arg2=%arg1:~0,-4%
ffmpeg -y -i %arg1% -vf fps=15,scale=-1:-1:flags=lanczos,palettegen %TEMP%\palette.png
ffmpeg -i %arg1% -i %TEMP%\palette.png -filter_complex "fps=10,scale=-1:-1:flags=lanczos[x];[x][1:v]paletteuse" %arg2%.gif
del /f %TEMP%\palette.png

0 comments on commit 6e332e6

Please sign in to comment.