#! /bin/zsh # # this file: # https://dataswamp.org/~incal/conf/.zsh/audio rm-audio () { local src=$1 local name=${src:r} local ext=${src:e} local dst=${name}-mute.${ext} ffmpeg -i $src -an $dst } audio-in-video () { local aud=$1 local vid=$2 local aud_nom=${aud:r} local vid_nom=${vid:r} local vid_ext=${vid:e} local dst=${vid_nom}-${aud_nom}.${vid_ext} ffmpeg -i $vid \ -i $aud \ -c:v copy \ -map 0:v \ -map 1:a \ $dst }