#!/bin/sh ## ## SCRIPT: 00_ffmpeg_mp4_EXTRACT_AUDIO_to_mp3.sh ## ## PURPOSE: Extract the audio stream of a ('.mp4') movie file ## into a '.mp3' audio-only file. ## ## METHOD OF USE: ## 1) Put this script in the directory of ('.mp4') movie files ## that you want to clip. ## 2) Edit this script to set the input & output filenames and volume level. ## 3) Run the script in a terminal window positioned at the directory ## that holds this script and the movie files. ## ## REFERENCE: ## https://www.stellarinfo.com/article/audio-converter/convert-mp4-to-mp3.php ## (last updated Feb 2021) ## ## Example: ## ## ffmpeg -i video.mp4 -f mp3 -ab 192000 -vn song.mp3 ## where ## 'i' indicates the path to the input file. ## 'f mp3' tells FFmpeg the output file is in MP3 format. ## 'ab 192000' tells FFmpeg to encode output at 192kbps. ## '-vn' tells FFmpeg that video is not required, extract only audio. ## ## Script started: 2021jul16 ## ffmpeg \ -i input.mp4 \ -f mp3 -ab 192000 -vn \ output.mp3 ## 00_temp.mp3 # totem 00_temp.mp3 # ffplay 00_temp.mp3 exit