Changed extractCodecData to work with piped input.