Skip to content

Instantly share code, notes, and snippets.

@moriwaka
Last active March 12, 2022 11:39
Show Gist options
  • Save moriwaka/8215795c91d58a1b8f517c1a57a4ffb8 to your computer and use it in GitHub Desktop.
Save moriwaka/8215795c91d58a1b8f517c1a57a4ffb8 to your computer and use it in GitHub Desktop.
#!/bin/bash -x
# usage
# pngwav2mp4 foobar.png foobar.wav
IMG=$1
shift
AUDIO=$1
VIDEO=$(basename $AUDIO .wav).mp4
ffmpeg -loop 1 -i $IMG -i $AUDIO -r 10 -tune stillimage -pix_fmt yuv420p -shortest $VIDEO
@moriwaka
Copy link
Author

twitterに音声だけ投稿できないので画像+音声を雑にmp4にするスクリプト。ファイル名はpngwav2mp4にしてるけどffmpegに渡すだけなので対応してれば画像も音声もフォーマットは自由。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment