#!/bin/sh echo "Media to convert to h.264" echo "--------------------" for i in `ls` do OUTPUTh264=`ffmpeg -i $i 2>&1 | egrep 'h264'` OUTPUTh265=`ffmpeg -i $i 2>&1 | egrep 'hevc'` if [[ ( -z "$OUTPUTh264" ) && ( -z "$OUTPUTh265" ) ]]; then echo " " if [[ -f $i ]]; then echo "Moving $i" mkdir -p to_mp4 mv $i to_mp4 fi fi done