\documentclass[beamer,multi]{standalone}
---PREAMBLE---
\begin{document}
\setlength\fboxsep{0pt}
\pgfmathsetmacro\framerate{---FRAMERATE---}
\pgfmathsetmacro\T{---DURATION---}
\pgfmathsetmacro\N{\T*\framerate}
\begin{standaloneframe}%
\fbox{%
\foreach \n in {---SLICESTART---,...,---SLICESTOP---} {%
\pgfmathsetmacro\progress{(\n-1+---NSTART---)/\N}%
\only<\n> {%
---ANIMATION---%
}%
}%
}%
\end{standaloneframe}%
\end{document}

