#!/bin/sh for fmv in *.wmv; do ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -i "$fmv" -vf 'format=nv12,hwupload,vflip' -c:v h264_vaapi "${fmv%.wmv}.mp4"; rm -rf $fmv; mv -- ${fmv:0:-4}.mp4 $fmv; done