Added codec parameter and tests