Skip to content

Instantly share code, notes, and snippets.

@dallaylaen
Last active December 22, 2016 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dallaylaen/46e29d748b2815937fd32846a998b9bc to your computer and use it in GitHub Desktop.
Save dallaylaen/46e29d748b2815937fd32846a998b9bc to your computer and use it in GitHub Desktop.
Convert audio file + cover image into youtubable video file with avconv (as ffmpeg has been removed from Ubuntu 14.04)
#!/bin/sh
PIC=$1
SND=$2
OUT=$3
if [ -z "$SND" ]; then
echo "Usage: $0 <image> <audio> [<video>]"
echo "Default for video is audio renamed to *.mp4"
exit 1
fi
[ -z "$OUT" ] && OUT=`echo "$SND" | sed s/\.[a-z0-9]*$/.mp4/`
avconv -loop 1 -f image2 -i "$PIC" -i "$SND" -acodec copy -shortest "$OUT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment