almost work generate frame from file