resjson = response.json() print_phase_message("GET Status..............................: " + str(response.status_code)) for mp in resjson['d']['results']: if(str(mp['Name']) == PROCESSOR_NAME): processor_id = str(mp['Id']) print_phase_message("MEDIA Processor Id......................: " + processor_id) print_phase_message("MEDIA Processor Name....................: " + PROCESSOR_NAME) else: print_phase_message("GET Status: " + str(response.status_code) + " - Media Processors Listing ERROR." + str(response.content)) ## create a media encoding job print_phase_header("Creating a Media Job to encode the mezzanine") with open(JSON_ENCODE_PROFILE_PATH, mode='r') as file: profile_content = file.read() response = azurerm.encode_mezzanine_asset(access_token, processor_id, asset_id, ASSET_FINAL_NAME, profile_content) if (response.status_code == 201): resjson = response.json() job_id = str(resjson['d']['Id']); print_phase_message("POST Status.............................: " + str(response.status_code)) print_phase_message("Media Job Id............................: " + job_id) else: print_phase_message("POST Status.............................: " + str(response.status_code) + " - Media Job Creation ERROR." + str(response.content)) ### list a media job print_phase_header("Getting the Media Job Status") flag = 1 while (flag): response = azurerm.list_media_job(access_token, job_id) if (response.status_code == 200): resjson = response.json()
for mp in resjson['d']['results']: if(str(mp['Name']) == PROCESSOR_NAME): processor_id = str(mp['Id']) print_phase_message("MEDIA Processor Id......................: " + processor_id) print_phase_message("MEDIA Processor Name....................: " + PROCESSOR_NAME) else: print_phase_message("GET Status: " + str(response.status_code) + " - Media Processors Listing ERROR." + str(response.content)) ## create a Video Thumbnail Job print_phase_header("Creating a Video Thumbnail job to process the content") with open(THUMBNAIL_CONFIG, mode='r') as file: configuration = file.read() response = azurerm.encode_mezzanine_asset(access_token, processor_id, asset_id, ASSET_FINAL_NAME, configuration) if (response.status_code == 201): resjson = response.json() job_id = str(resjson['d']['Id']) print_phase_message("POST Status.............................: " + str(response.status_code)) print_phase_message("Media Job Id............................: " + job_id) else: print_phase_message("POST Status.............................: " + str(response.status_code) + " - Media Job Creation ERROR." + str(response.content)) ### list a media job print_phase_header("Getting the Media Job Status") flag = 1 while (flag): response = azurerm.list_media_job(access_token, job_id) if (response.status_code == 200): resjson = response.json()
processor_id = str(mp['Id']) print_phase_message("MEDIA Processor Id......................: " + processor_id) print_phase_message("MEDIA Processor Name....................: " + PROCESSOR_NAME) else: print_phase_message("GET Status: " + str(response.status_code) + " - Media Processors Listing ERROR." + str(response.content)) ## create an Indexer v1 job print_phase_header("Creating a Media Job to index the content") with open(INDEXER_V1_XML_PRESET, mode='r') as file: indexer_preset = file.read() response = azurerm.encode_mezzanine_asset(access_token, processor_id, asset_id, ASSET_FINAL_NAME, indexer_preset) if (response.status_code == 201): resjson = response.json() job_id = str(resjson['d']['Id']) print_phase_message("POST Status.............................: " + str(response.status_code)) print_phase_message("Media Job Id............................: " + job_id) else: print_phase_message("POST Status.............................: " + str(response.status_code) + " - Media Job Creation ERROR." + str(response.content)) ### list a media job print_phase_header("Getting the Media Job Status") flag = 1 while (flag):