Fix the bug of deleting trailing frames

Fix the bug of deleting trailing frames in all videos, whatever type of model is used.