Ffmpeg

From CleanPosts

Jump to: navigation, search

Contents

Batch convert all the avi files in a directory to mp4

(Assumes the files have no spaces in their names, but I have another script for that)

#!/bin/bash 
for i in *.avi; 
do ffmpeg -i "$i" "${i%%.*}.mp4" 
done

Convert .avi video files to smaller .mp4 format

ffmpeg -i 'U2 - New Years Day.avi' 'U2 - New Years Day.mp4'

Convert GIFs from Twitter that download as MP4s back into uploadable GIFs again

ffmpeg -y -i input.mp4 -filter_complex "scale=320:-1:flags=lanczos[x];[x]split[x1][x2]; [x1]palettegen[p];[x2][p]paletteuse" output.gif

Extract audio from any video file

ffmpeg -i Black-Sabbath-Iron-Man.vob Black-Sabbath-Iron-Man.mp3

Personal tools
Strangers In Paradise