Resource based open() and FFmpeg fixes