ffmpeg: factorize process_input() out