title: Azure Media Services Strange Behaviour (ApplyIntelligenceCommand.)
body: <p>Yesterday, I had setup Azure Media Services to upload an asset from stream.</p>
  <p>It was working the day before and today. However now it stopped working it is giving me weird errors, that I cannot find answers for online.</p>
  <p>Could it be that <code>Upload(Stream stream)</code> from the <code>IAssetFile</code> class is down?</p>
  <p>Here is my code:</p>
  <pre><code>foreach (var content in provider.Contents) 
  {
      // Upload as an asset to Azure Media services
      IAsset asset = await _service.CreateAssetAndUploadSingleFile(content, &quot;Input Asset&quot;);
  }
  </code></pre>
  <p>Here is my <code>CreateAssetAndUploadSingleFile</code> function:</p>
  <pre><code>public async Task&lt;IAsset&gt; CreateAssetAndUploadSingleFile(HttpContent content, string assetName, AssetCreationOptions options = AssetCreationOptions.None)
  {
          IAsset asset = _context.Assets.Create(assetName, options);
          Console.WriteLine(content.Headers.ContentDisposition.FileName);
  
          IAssetFile assetFile = await asset.AssetFiles.CreateAsync(&quot;love.mp4&quot;, CancellationToken.None);
  
          if (content != null)
          {
              Console.WriteLine(&quot;creating stream&quot;);
  
              using (Stream stream = await content.ReadAsStreamAsync())
              {
                  Console.WriteLine(&quot;Uploading to blob storage&quot;);
                  assetFile.Upload(stream);
                  return asset;
              }
          }
          return asset;
  }
  </code></pre>
  <p>Here are the errors that I am getting</p>
  <blockquote>
  <p>Error: ErrorProcessingTask. An error has occurred.<br />
  Stage: ApplyIntelligenceCommand.<br />
  Code: 0xBEBBB1B7</p>
  <p>System.IO.InvalidDataException: Invalid data found when processing input<br />
  Microsoft.Media.Encoding.Common.Commands.CommandLineException: An error has occurred while executing a command.</p>
  </blockquote>
  <p>What I am thinking is that the <code>Upload(Stream stream)</code> stopped working for some reason.</p>
  <p>When I upload a video locally and then run face redactor everything works perfectly fine.</p>
  <p>But when I upload through the stream it doesn't work anymore.</p>
  <p>Additionally, when I check my blob storage to verify if the image or video is there and that it works, it is actually uploaded correctly.</p>
  <p>So I am confused why Media services is giving the above errors.</p>
  <p>Any help would be appreciated</p>