3

I have been using Video Indexer API to upload video from my application for some time now, and since yesterday I start encountering the INVALID_INPUT error.

Here's how I am calling the POST upload API in Python:

vi_location = 'southeastasia'
vi_account_id = 'some-account-id'  # replaced with actual account ID
video_language = 'en-US'
name = 'test-video-name'
access_token = 'some-access-token'  # replaced with actual access token generated with AccessToken endpoint

params = {
    'streamingPreset': 'Default',
    'indexingPreset': 'DefaultWithNoiseReduction',
    'language': video_language,
    'name': video_name,
    'accessToken': access_token
}

files = {
    'file': open('some-file-name.mp4', 'rb')
}

upload_video_req = requests.post('https://api.videoindexer.ai/{loc}/Accounts/{acc_id}/Videos'.format(
        loc=vi_location,
        acc_id=vi_account_id
    ),
    params=params,
    files=files
)  # here's where it generates the error message

Here's the message generated from the API response.

{"ErrorType":"INVALID_INPUT","Message":"Indexing preset \'DefaultWithNoiseReduction\' is invalid. Trace id: \'5086aa05-14d3-4f9a-928e-c2159a14705e"}

Based on the documentation, the allowed values for indexing preset is as followed:

The indexing preset to use. Allowed values: DefaultWithNoiseReduction/Default/AudioOnly/VideoOnly/Basic/BasicAudio/BasicVideo/Advanced/AdvancedAudio/AdvancedVideo

I have tried 2 things:

  1. Add the Ocp-Apim-Subscription-Key in the request headers, previously doesn't seems to require if I were to pass in the access token
  2. Switching DefaultWithNoiseReduction to Default and that seems to allow the API call to go through, however, it then shows an error in indexing the video after.

Problem Indexing Video

Manually uploading the video via the console/dashboard seems to work, so it could be just the API endpoints that are having some issues.

Any help will be greatly appreciated!


Update 2021-02-01: Seems like changing the indexing preset to Default works now. However, the issue with DefaultWithNoiseReduction still persists.

Jason Pan
  • 15,263
  • 1
  • 14
  • 29
Bk Lim
  • 1,436
  • 1
  • 10
  • 7
  • You can find that using Default to skip/solve this problem is really clever. The official documents should not be updated, you can raise a support ticket on portal to confirm. – Jason Pan Feb 02 '21 at 08:42
  • If my solution inspires or helps you, you mark my answer as [accepted](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) , Tks~ – Jason Pan Feb 03 '21 at 08:21

1 Answers1

1

I think DefaultWithNoiseReduction may have been deprecated or merged with Default.

If you are interested, you can rasie a support ticket to confirm. Below are my test results.

Test Steps:

I use offical sample code and test it, I set indexingPreset=DefaultWithNoiseReduction as below.

queryParams = CreateQueryString(
    new Dictionary<string, string>()
    {
        {"accessToken", accountInfo.AccessToken},
        {"language", "English"},
        { "indexingPreset","DefaultWithNoiseReduction"}
    }
);

When I debug videoGetIndexResult, I get "indexingPreset":"Default",.

enter image description here

According to the test, in C# code, DefaultWithNoiseReduction has been deprecated or ignored, and may be replaced by Default.

The Python SDK code may not be updated in time. So it led to your previous problem.

In order to further verify my guess, I found in the Video Indexer Portal that in the advanced options, there are only 3 types of indexingPreset left.

enter image description here

Jason Pan
  • 15,263
  • 1
  • 14
  • 29
  • Thanks for testing it out. As updated in the opening thread I also fallback to using `Default` as a workaround, though the official doc still highlight `DefaultWithNoiseReduction` as a potential option. https://learn.microsoft.com/en-us/azure/media-services/video-indexer/upload-index-videos#indexingpreset – Bk Lim Feb 03 '21 at 10:19