Fix bug with record video
Refactoring and improving Smallve