Reputation: 85
I did a successful coping of an existing blob into a media service asset and was able to do an encoding task.
Things changed when I copied the asset with storage encryption enabled.The encoding task for this asset fails with message "Azure Media Encoding of storageencrypted with H264 Adaptive Bitrate MP4 Set 720p UserInput : File type or codec not supported."
IAsset asset = mediaContext.Assets.Create("NewAsset_" + Guid.NewGuid(), AssetCreationOptions.StorageEncrypted);
Upvotes: 0
Views: 166
Reputation: 1105
Here is a working sample of what you are trying to do:
string mediaservicename = "your_media_service_name";
string mediaservicekey = "your_media_service_key";
// create the cloud media context
var mediaServiceContext = new CloudMediaContext(mediaservicename, mediaservicekey);
// create an encrypted asset
var asset = mediaServiceContext.Assets.Create("MyAsset_" + Guid.NewGuid(), AssetCreationOptions.StorageEncrypted);
// create the asset file and upload it from a local path
var assetFile = asset.AssetFiles.Create("BigBuckBunny_320x180.mp4");
assetFile.Upload(@"C:\Users\jucoriol\Desktop\BigBuckBunny_320x180.mp4");
// create the encoding job with a single task
var encodingJob = mediaServiceContext.Jobs.CreateWithSingleTask(
"Azure Media Encoder",
"H264 Adaptive Bitrate MP4 Set 720p",
asset,
"Big Bunny Adaptive 720p",
AssetCreationOptions.StorageEncrypted);
// submit the job
encodingJob.Submit();
Console.ReadLine();
I think that the problem is not about storage encryption but could be :
Hope this helps to resolve your problem.
Julien
Upvotes: 2