add timeout for ffmpeg and switch to async stderr reading