<s> from onvif import ONVIFCamera <EOL> def media_profile_configuration ( ) : <EOL> '''<STR_LIT>''' <EOL> mycam = ONVIFCamera ( '<STR_LIT>' , <NUM_LIT> , '<STR_LIT>' , '<STR_LIT>' ) <EOL> media_service = mycam . create_media_service ( ) <EOL> profiles = media_service . GetProfiles ( ) <EOL> token = profiles [ <NUM_LIT:0> ] . _token <EOL> configurations_list = media_service . GetVideoEncoderConfigurations ( ) <EOL> video_encoder_configuration = configurations_list [ <NUM_LIT:0> ] <EOL> options = media_service . GetVideoEncoderConfigurationOptions ( { '<STR_LIT>' : token } ) <EOL> video_encoder_configuration . Encoding = '<STR_LIT>' <EOL> video_encoder_configuration . Resolution . Width = options . H264 . ResolutionsAvailable [ <NUM_LIT:0> ] . Width <EOL> video_encoder_configuration . Resolution . Height = options . H264 . ResolutionsAvailable [ <NUM_LIT:0> ] . Height <EOL> video_encoder_configuration . Quality = options . QualityRange . Min <EOL> video_encoder_configuration . RateControl . FrameRateLimit = options . H264 . FrameRateRange . Min <EOL> video_encoder_configuration . RateControl . EncodingInterval = options . H264 . EncodingIntervalRange . Min <EOL> video_encoder_configuration . RateControl . BitrateLimit = options . Extension . H264 [ <NUM_LIT:0> ] . BitrateRange [ <NUM_LIT:0> ] . Min [ <NUM_LIT:0> ] <EOL> request = media_service . create_type ( '<STR_LIT>' ) <EOL> request . Configuration = video_encoder_configuration <EOL> request . ForcePersistence = True <EOL> media_service . SetVideoEncoderConfiguration ( request ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> media_profile_configuration ( ) </s>
