#!/bin/bash # Basic bash script to use ffmpeg to convert videos to m4a. # Script usage: ./conv-video-to-audio.sh input.mp4 output.m4a INPUT=$1 OUTPUT=$2 if ! command -v ffmpeg -version > /dev/null 2>&1; then echo "Ffmpeg is not available! You will need to install it to use this script." exit 1 fi if [[ -z $INPUT ]] || [[ -z $OUTPUT ]]; then echo "Video to audio converter usage: input.webm output.m4a" exit 1 fi if [ ! -f $INPUT ]; then echo "File $INPUT doesn't exist!" exit 1 fi ffmpeg -i "$INPUT" -vn -acodec aac "$OUTPUT"