Function for video procesing added