http://www.crimulus.com/2010/01/21/linux-bash-script-convert-mp3-to-avi-with-static-image-command-line/
Torej, ustvariti moramo programsko datoteko mp32avi.sh:
gedit mp32avi.shvanjo pa prilepimo sledečo kodo:
#!/bin/bash FFMPEG=`which ffmpeg` if [ "$FFMPEG" = "" ] ; then echo "Please install ffmpeg."; exit 0; fi if [ $# != 3 ] ; then echo "Usage: $0"; exit 0; fi if [ ! -f $1 ] ; then echo "Source image '$1' not found."; exit 0; fi if [ ! -f $2 ] ; then echo "Source mp3 '$2' not found."; exit 0; fi if [ -f $3 ] ; then echo "Output file '$3' exists. Overwrite? (y/n)"; read CONFIRM if [ "$CONFIRM" == "y" ] ; then echo "Overwriting '$3'" else if [ "$CONFIRM" == "Y" ] ; then echo "Overwriting '$3'" else echo "Operation canceled."; exit 0; fi fi fi TIME=`$FFMPEG -i $2 |& grep 'Duration' | awk '{ print $2; }' | sed -e 's/,//g'` $FFMPEG -loop_input -i $1 -i $2 -acodec copy -y -t $TIME $3 ... in shranimo.Program zaženemo tako, da vpišemo:
bash mp32avi.sh slika.jpg pesem.mp3 video.avi