Skip to content

Commit a07d532

Browse files
committed
Gif-generater
1 parent a6644c4 commit a07d532

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

GIF-generater/converter.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import imageio
2+
import os
3+
4+
clip = os.path.abspath('vdo.mp4')
5+
6+
print(clip)
7+
8+
def gifMaker(inputPath, targetFormat):
9+
outputPath = os.path.splitext(inputPath)[0]+ targetFormat
10+
11+
print(f'converting {inputPath} \n to {outputPath}')
12+
13+
reader = imageio.get_reader(inputPath)
14+
fps = reader.get_meta_data()['fps']
15+
16+
writer = imageio.get_writer(outputPath, fps=fps)
17+
18+
for frames in reader:
19+
writer.append_data(frames)
20+
print(f'Frame {frames}')
21+
print('Done')
22+
writer.close()
23+
24+
gifMaker(clip, '.gif')

GIF-generater/vdo.mp4

45.7 MB
Binary file not shown.

0 commit comments

Comments
 (0)