Delete folder with specific condition
If all folders to be removed are directly under the containing folder and all mp4 and avi files are directly under the kept folders:

for d in */;do ls "$d"|grep -Eq '.*\.(mp4|avi)$'||echo rm -r "$d";done

If the mp4 and avi files can be in subfolders of the kept folders:

for d in */;do [[ $(find "$d" -iname \*.mp4 -o -iname \*.avi) ]]||echo rm -r "$d";done

If the folders to be removed can be in subfolders of the containing folder:

find . -type d|while read d;do ls "$d"|grep -Eq '.*\.(mp4|avi)$'||echo rm -r "$d";done