Fix encoding parameters and unify flash and hls