Skip to content

Commit 6e332e6

Browse files
committed
initial files of project in version 0.0.1
Signed-off-by: Nabi <[email protected]>
1 parent 848e4a0 commit 6e332e6

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.idea
2+
sample.mp4
3+
sample.gif

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
11
# video2gif
2-
A batch script for convert video to GIF files by FFmpeg.exe on Windows
2+
A batch script for convert video to GIF files by FFmpeg.exe on Windows
3+
4+
## Installation
5+
* Clone the repo
6+
* Install [FFmpeg](http://ffmpeg.zeranoe.com/builds/) for Windows.
7+
* Make sure the `ffmpeg.exe` and `video2gif.bat` are on your systems path.
8+
9+
## Usage
10+
Anywhere you can use it be like this example:
11+
```
12+
video2gif myvideo.mp4
13+
```
14+
Then you have `myvideo.gif` in current directory.
15+
If `myvideo.gif` there is existed, question from you for overwrite it.
16+
17+
## Tips
18+
Special thanks to [this article](http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html).

video2gif.bat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@echo off
2+
rem by: nabi karamalizadeh <[email protected]>
3+
rem description: video to gif converter
4+
rem version: 0.0.1
5+
rem license: The MIT License (MIT)
6+
set arg1=%1
7+
set arg2=%arg1:~0,-4%
8+
ffmpeg -y -i %arg1% -vf fps=15,scale=-1:-1:flags=lanczos,palettegen %TEMP%\palette.png
9+
ffmpeg -i %arg1% -i %TEMP%\palette.png -filter_complex "fps=10,scale=-1:-1:flags=lanczos[x];[x][1:v]paletteuse" %arg2%.gif
10+
del /f %TEMP%\palette.png

0 commit comments

Comments
 (0)