├── .gitignore ├── .prettierrc ├── README.md ├── package.json ├── poi.config.js ├── src ├── components │ └── App.vue ├── css │ └── global.css └── index.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "singleQuote": true 4 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # video2gif 2 | 3 | > Convert Video (MP4/OGG/WEBM) to GIF. 4 | 5 | You known that GIF is saved as Video on Twitter, I made this tool to convert those tiny videos to GIFs by using HTML Canvas. Due to performance issue this is not suited for any video that's longer than 10 seconds. 6 | 7 | https://video2gif.egoist.sh 8 | 9 | Example: https://video2gif.egoist.sh?video=https://video.twimg.com/tweet_video/D2aI3aFUkAE84AW.mp4 (Remote video doesn't work on FireFox because of CORS Policy) 10 | 11 | ## Prior Art 12 | 13 | [tweet2gif](https://github.com/idiotWu/tweet2gif/). 14 | 15 | ## Browser Support 16 | 17 | Doesn't seem to work on Safari. 18 | 19 | ## License 20 | 21 | MIT. 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "video2gif", 3 | "description": "Convert Video to GIF", 4 | "private": true, 5 | "scripts": { 6 | "build": "poi --prod", 7 | "dev": "poi --serve" 8 | }, 9 | "devDependencies": { 10 | "gif.js": "^0.2.0", 11 | "poi": "^12.4.2", 12 | "vue": "^2.6.10", 13 | "vue-router": "^3.0.2", 14 | "vue-template-compiler": "^2.6.10" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /poi.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | entry: 'src/index.js' 3 | } -------------------------------------------------------------------------------- /src/components/App.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 185 | 186 | 220 | -------------------------------------------------------------------------------- /src/css/global.css: -------------------------------------------------------------------------------- 1 | body { 2 | font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; 3 | margin: 0; 4 | text-rendering: optimizeLegibility; 5 | -webkit-font-smoothing: antialiased; 6 | } 7 | 8 | * { 9 | box-sizing: border-box; 10 | } 11 | 12 | a { 13 | text-decoration: none; 14 | color: blue; 15 | } 16 | 17 | a:hover { 18 | text-decoration: underline; 19 | } -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import './css/global.css' 2 | import Vue from 'vue' 3 | import Router from 'vue-router' 4 | import App from './components/App.vue' 5 | 6 | Vue.use(Router) 7 | 8 | const router = new Router({ 9 | mode: 'history', 10 | routes: [ 11 | { 12 | path: '/', 13 | component: App 14 | } 15 | ] 16 | }) 17 | 18 | new Vue({ 19 | el: '#app', 20 | router, 21 | render: h => h('router-view') 22 | }) 23 | --------------------------------------------------------------------------------