⭐ Manipulate Audio/Video with FFmpeg
brew install ffmpeg
Simply copy the following aliases to your .zshrc and use the commands marked with CLI ! Enjoy :)
# CLI : audio_edit test.m4a 00:00:36 00:08:19
audio_edit() {
OUTPUT='new_'$1;
rm $OUTPUT;
ffmpeg -i $1 -ss $2 -to $3 -c copy $OUTPUT;
}
# CLI : audio_mix 10 new_test.m4a test-1H.m4a
audio_mix() {
LIST=list.txt;
max=$1;for i in `seq 1 $max`; do echo "file '$2'" >> $LIST; done;
ffmpeg -f concat -safe 0 -i $LIST -c copy $3;
rm $LIST;
}
# CLI : video_make cover.jpg test-1H.m4a test-1H.mp4
video_make() {
ffmpeg -loop 1 -i $1 -i $2 -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -shortest $3;
}