refactoring to use ffmpeg