https://github.com/fxembed/fastgif
A service to quickly turn X/Twitter mp4s into GIFs
https://github.com/fxembed/fastgif
Last synced: 9 months ago
JSON representation
A service to quickly turn X/Twitter mp4s into GIFs
- Host: GitHub
- URL: https://github.com/fxembed/fastgif
- Owner: FxEmbed
- License: mit
- Created: 2025-03-31T03:42:30.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-01T10:06:45.000Z (about 1 year ago)
- Last Synced: 2025-06-27T01:38:45.053Z (12 months ago)
- Language: Rust
- Size: 48.8 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FxEmbed FastGIF
A Rust-based service to quickly convert X/Twitter mp4s to GIFs on the fly
Basically, how this works is:
- You pass along video.twimg.com URLs
- Your video is downloaded and converted into raw yuv4mpegpipe using FFmpeg
- [gifski](https://github.com/ImageOptim/gifski) takes the video piped into it and converts it into a GIF
- The resulting GIF is transferred back to the client as soon as it's done
## Installation (easy mode)
[just use the docker image :D](https://github.com/FxEmbed/fastgif/pkgs/container/fastgif)
## Installation (hard mode)
## Dependencies
- Rust (latest stable version)
- FFmpeg (must be installed and available in PATH)
- gifski (must be installed and available in PATH)
#### FFmpeg
**macOS:**
```bash
brew install ffmpeg
```
**Ubuntu/Debian:**
```bash
sudo apt update
sudo apt install ffmpeg
```
#### gifski
**macOS:**
```bash
brew install gifski
```
**Ubuntu/Debian:**
```bash
cargo install gifski
```
### Build and Run
1. Clone the repository
2. Build the project:
```bash
cargo build --release
```
3. Run the server:
```bash
cargo run --release
```
The server will start on http://localhost:3000
## Usage
To convert a Twitter video to GIF, make a GET request to:
```
http://localhost:3000/{twitter_video_path}
```
For example, if the original Twitter video URL is:
```
https://video.twimg.com/tweet_video/FfyEjQ_WIAAd7rg.mp4
```
You would request:
```
http://localhost:3000/tweet_video/FfyEjQ_WIAAd7rg.mp4
```
The server will respond with a GIF of the video.
## Configuration
The server runs on port 3000 by default. You can customize it using the PORT environment variable.