VIDEO-17: Improve log and close input stream after using