Skip to content

ffmpeg

Installation

mkdir -p ~/bin && bash
wget -qO ~/ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz
tar xf ~/ffmpeg.tar.xz && cd && rm -rf ffmpeg-*-amd64-static/{manpages,presets,readme.txt}
cp ~/ffmpeg-*-amd64-static/* ~/bin
chmod 700 ~/bin/{ffmpeg,ffprobe,ffmpeg-10bit,qt-faststart}
cd && rm -rf ffmpeg{.tar.xz,-*-amd64-static}

Cut mp3 file from 30 seconds to 70

ffmpeg -ss 30 -t 70 -i inputfile.mp3 -acodec copy outputfile.mp3

Extract sound from movie file (-vn = no video)

ffmpeg -i input-video.mkv -vn -acodec copy output-audio.mp3

Cut mp3 file from 30 seconds to 70 only audio

ffmpeg -i Molle_Musikvideo_Jobba,_Jobba,_Jobba-26tzRuurdgo.mkv \
    -ss 56 -t 61 -q:a 0 -map a molle_-_jobba.jobba.mp3

Convert mp3 to ogg

ffmpeg -i input.mp3 -c:a libvorbis -q:a 4 output.ogg

Convert all mp3 fifles in current dir to ogg

for f in ./*.mp3; 
    do ffmpeg -i "$f" -c:a libvorbis -q:a 4 "${f/%mp3/ogg}"; 
done

Convert all mp3 fifles in current dir to ogg recursive

find . -type f -name '*.mp3' -exec bash -c 'ffmpeg -i "$0"  \
    -c:a libvorbis -q:a 4 "${0/%mp3/ogg}"' '{}' \;

Reference(s)


  • Comments are closed on this article!

Last update: December 6, 2022 16:13:32