Skip to content

Instantly share code, notes, and snippets.

@sharapeco
Created June 20, 2020 14:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sharapeco/4c72e6b912024d602ce60e100aa54587 to your computer and use it in GitHub Desktop.
Save sharapeco/4c72e6b912024d602ce60e100aa54587 to your computer and use it in GitHub Desktop.
画像と音声からMP4動画を作る
#!/bin/sh
### 画像と音声からMP4動画を作る
# なんでかわからんけどこれで順番に引数が入る
image=$1
shift
audio=$*
# shift
# dai_3_no_hikisuu=$*
if [ -z "$audio" ]; then
echo 'Usage: imageaudio2mp4 image.jpg audio.m4a'
exit 1
fi
ffmpeg \
-loop 1 \
-r 30000/1001 \
-i "$image" \
-i "$audio" \
-c:v libx264 \
-c:a copy \
-pix_fmt yuv420p \
-shortest \
"$audio.mp4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment