Skip to content

Instantly share code, notes, and snippets.

@Wikinaut
Last active May 6, 2021 00:16
Show Gist options
  • Save Wikinaut/fa5145684e6943a4fd7eecc5ac271957 to your computer and use it in GitHub Desktop.
Save Wikinaut/fa5145684e6943a4fd7eecc5ac271957 to your computer and use it in GitHub Desktop.
Create a video for Twitter from an audio and a dummy image file - transcode audio into a video for twitter
#!/bin/bash
if [[ $# -ne 2 ]]; then
echo "audio2video: create a video for Twitter from audio and a dummy image."
echo "Usage:"
echo "audio2video audio.mp3 dummyimage.png"
echo
echo "Remark: width and height need to be divisible by 2."
exit
fi
ffmpeg -loop 1 -i "$2" -i "$1" -filter_complex "loop=-1:1:0" -c:v libx264 -x264-params keyint=1 -shortest -pix_fmt yuv420p -c:a aac ${1%.*}.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment