#-------------------------------- # filename: /zsh/ffmpeg #-------------------------------- # ffmpeg-recontainer # source: https://yohanes.gultom.me/2016/05/21/bash-script-to-batch-convert-mkv-to-mp4-linux/ function ff-mp4() { findpath=$1 : "${findpath:="."}" find "$findpath" \( -iname '*.mkv' -o -iname '*.flv' -o -iname '*.mov' \) | while read -r f ; do dir=$(dirname "$f"); file=$(basename "$f"); # ext="${filename##*.}"; name="${file%.*}"; ffmpeg -i "$f" -map 0 -c copy -movflags faststart "$dir/$name.mp4"