For Gridwalk I am often generating videos of the music for Youtube. (Here is our channel) Instead of making these on a timeline in Premiere I use this command line script to combine audio and a still image.

ffmpeg -loop 1 -i image.jpg -i audio.wav -c:v libx264 -tune stillimage -c:a aac -strict experimental -b:a 320k -shortest out.mp4

This code works as of 2016, using ffmpeg version 3.1.3.

Some more options and information at this stack exchange.

====================

This can be further automated by running this script automatically on every MP3 in the folder.

This first finds the image, which must be named image.png or image.jpg in the folder. Then prompts you for the artist name, which is added to the resulting video file name. Then it runs the script above for each MP3.

You can copy this script into your shell startup file, ~/.bashrc or ~/.zshrc.

  function make_static_videos {
    
    image="./image.jpg"
    if [ -f "$image" ]
    then
      echo "Album Cover Found"
    else
      image="./image.png"
      if [ -f "$image" ]
      then
        echo "Album Cover Found"
      else
        tput setaf 1; echo "Album Cover Missing! Include image.jpg or image.png in this directory."
        return
      fi
    fi

    tput setaf 2; echo "Enter Artist Name:"
    read artist_name

    for file in *.mp3
    do
      video_filename="${file%.mp3} [$artist_name].mp4"
      
      ffmpeg -loop 1 -i $image -i $file -c:v libx264 -tune stillimage -c:a aac -strict experimental -b:a 320k -shortest $video_filename

      echo "$video_filename created"
    done
  }
Updated on September 14, 2016
Pages Updated Recently: