Skip to content

Instantly share code, notes, and snippets.

@yurrriq
Created March 25, 2014 22:38
Show Gist options
  • Save yurrriq/9773027 to your computer and use it in GitHub Desktop.
Save yurrriq/9773027 to your computer and use it in GitHub Desktop.
Creates a QuickTime-friendly MP4 ($3) from an image ($1) and an audio file ($2).
#!/bin/bash
if [ "$#" -eq 3 ]; then
IMAGE="$1"
AUDIO="$2"
OUTPUT="$3"
ffmpeg -loglevel panic \
-f image2 -loop 1 \
-i "$IMAGE" \
-i "$AUDIO" \
-c:v libx264 -tune stillimage \
-c:a aac -strict experimental -b:a 320k \
-pix_fmt yuv420p \
-shortest "$OUTPUT" && \
open "$3"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment