Skip to content
This repository was archived by the owner on Dec 20, 2022. It is now read-only.

Commit 193571d

Browse files
added video to gif
Converts any video to gif
1 parent 156dd89 commit 193571d

File tree

1 file changed

+118
-0
lines changed

1 file changed

+118
-0
lines changed

OTHERS/Video To Gif/VIDTOGIF.ipynb

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 1,
6+
"id": "33546b0f",
7+
"metadata": {},
8+
"outputs": [
9+
{
10+
"name": "stdout",
11+
"output_type": "stream",
12+
"text": [
13+
"Requirement already satisfied: moviepy in c:\\users\\lucy22\\anaconda3\\lib\\site-packages (1.0.3)\n",
14+
"Requirement already satisfied: decorator<5.0,>=4.0.2 in c:\\users\\lucy22\\anaconda3\\lib\\site-packages (from moviepy) (4.4.2)\n",
15+
"Requirement already satisfied: imageio<3.0,>=2.5 in c:\\users\\lucy22\\anaconda3\\lib\\site-packages (from moviepy) (2.9.0)\n",
16+
"Requirement already satisfied: tqdm<5.0,>=4.11.2 in c:\\users\\lucy22\\anaconda3\\lib\\site-packages (from moviepy) (4.59.0)\n",
17+
"Requirement already satisfied: proglog<=1.0.0 in c:\\users\\lucy22\\anaconda3\\lib\\site-packages (from moviepy) (0.1.9)\n",
18+
"Requirement already satisfied: numpy>=1.17.3 in c:\\users\\lucy22\\anaconda3\\lib\\site-packages (from moviepy) (1.20.1)\n",
19+
"Requirement already satisfied: imageio-ffmpeg>=0.2.0 in c:\\users\\lucy22\\anaconda3\\lib\\site-packages (from moviepy) (0.4.5)\n",
20+
"Requirement already satisfied: requests<3.0,>=2.8.1 in c:\\users\\lucy22\\anaconda3\\lib\\site-packages (from moviepy) (2.25.1)\n",
21+
"Requirement already satisfied: pillow in c:\\users\\lucy22\\anaconda3\\lib\\site-packages (from imageio<3.0,>=2.5->moviepy) (8.2.0)\n",
22+
"Requirement already satisfied: certifi>=2017.4.17 in c:\\users\\lucy22\\anaconda3\\lib\\site-packages (from requests<3.0,>=2.8.1->moviepy) (2020.12.5)\n",
23+
"Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\\users\\lucy22\\anaconda3\\lib\\site-packages (from requests<3.0,>=2.8.1->moviepy) (1.26.4)\n",
24+
"Requirement already satisfied: idna<3,>=2.5 in c:\\users\\lucy22\\anaconda3\\lib\\site-packages (from requests<3.0,>=2.8.1->moviepy) (2.10)\n",
25+
"Requirement already satisfied: chardet<5,>=3.0.2 in c:\\users\\lucy22\\anaconda3\\lib\\site-packages (from requests<3.0,>=2.8.1->moviepy) (4.0.0)\n",
26+
"Note: you may need to restart the kernel to use updated packages.\n"
27+
]
28+
}
29+
],
30+
"source": [
31+
"pip install moviepy"
32+
]
33+
},
34+
{
35+
"cell_type": "code",
36+
"execution_count": 2,
37+
"id": "8706dbab",
38+
"metadata": {},
39+
"outputs": [],
40+
"source": [
41+
"from moviepy.editor import VideoFileClip"
42+
]
43+
},
44+
{
45+
"cell_type": "code",
46+
"execution_count": 3,
47+
"id": "d5c72756",
48+
"metadata": {},
49+
"outputs": [],
50+
"source": [
51+
"from tkinter.filedialog import *"
52+
]
53+
},
54+
{
55+
"cell_type": "code",
56+
"execution_count": 4,
57+
"id": "f0a59372",
58+
"metadata": {},
59+
"outputs": [
60+
{
61+
"name": "stderr",
62+
"output_type": "stream",
63+
"text": [
64+
"t: 1%|▎ | 2/385 [00:00<00:35, 10.79it/s, now=None]"
65+
]
66+
},
67+
{
68+
"name": "stdout",
69+
"output_type": "stream",
70+
"text": [
71+
"MoviePy - Building file mygif.gif with imageio.\n"
72+
]
73+
},
74+
{
75+
"name": "stderr",
76+
"output_type": "stream",
77+
"text": [
78+
" \r"
79+
]
80+
}
81+
],
82+
"source": [
83+
"video = askopenfilename()\n",
84+
"clip = VideoFileClip(video)\n",
85+
"clip.write_gif(\"mygif.gif\",fps = 10)"
86+
]
87+
},
88+
{
89+
"cell_type": "code",
90+
"execution_count": null,
91+
"id": "c314fe52",
92+
"metadata": {},
93+
"outputs": [],
94+
"source": []
95+
}
96+
],
97+
"metadata": {
98+
"kernelspec": {
99+
"display_name": "Python 3",
100+
"language": "python",
101+
"name": "python3"
102+
},
103+
"language_info": {
104+
"codemirror_mode": {
105+
"name": "ipython",
106+
"version": 3
107+
},
108+
"file_extension": ".py",
109+
"mimetype": "text/x-python",
110+
"name": "python",
111+
"nbconvert_exporter": "python",
112+
"pygments_lexer": "ipython3",
113+
"version": "3.8.8"
114+
}
115+
},
116+
"nbformat": 4,
117+
"nbformat_minor": 5
118+
}

0 commit comments

Comments
 (0)