Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aljazceru/twitter-video-convert
https://github.com/aljazceru/twitter-video-convert
Last synced: about 5 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/aljazceru/twitter-video-convert
- Owner: aljazceru
- Created: 2024-10-21T07:56:36.000Z (30 days ago)
- Default Branch: main
- Last Pushed: 2024-10-21T09:22:37.000Z (30 days ago)
- Last Synced: 2024-10-21T13:21:22.355Z (30 days ago)
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Convert videos for twitter/X
Uploading videos to X tends to be prone to errors since they are very picky about what formats they accept. This bash one-liner helps you convert to a format that works.
```
ffmpeg -i "$1" -c:v libx264 -crf 20 -preset slow -vf format=yuv420p -c:a aac -movflags +faststart "${1%.*}_twitter.mp4"
```To use this one-liner, save it to a file (e.g. `convert_videos`) and make it executable with `chmod +x convert_videos`.
Then, you can run it by passing the input filename as an argument:
```bash
./convert_video video_clip.mp4
# output
video_clip_twitter.mp4
```
This will produce a new video file with the `_twitter` extension.What is does:
- uses input video file ($1 in the command)
- strips out the file extension from the filename and attaches _twitter to it
- converts video to X acceptable format