Fix VDR Recordings (MPEG-PS)

I am using the following script to copy a VDR recording into a MPEG-PS container using a robust input decoder, so there is a good chance, that any errors in the recording are fixed:

#!/bin/bash

for f in "$@"; do
  [ -r "$f" ] || continue
  g="$(basename "$f" .vdr).mps"
  [ -e "$g" ] && continue
  mencoder -forceidx -lavdopts er=4 -vc ffmpeg12 -of mpeg -oac copy -ovc copy "$f" -o "$g"
done

Since audio and video is just copied to the destination, this step should be fairly loss-less and fast (I/O bound).