add segtime and bitrate parameters into commands
and clean some code