You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sample for transform and job operations with MK/IO SDK
usingMK.IO;usingMK.IO.Models;// **********************// MK/IO Client creation// **********************varclient=newMKIOClient("mkiosubscriptionname","mkiotoken");// *********************// transform operations// *********************// Create a transformvartransform=client.Transforms.CreateOrUpdate("simpletransform",newTransformProperties{Description="Encoding to 720p single bitrate",Outputs=newList<TransformOutput>{newTransformOutput{Preset=newBuiltInStandardEncoderPreset(EncoderNamedPreset.H264SingleBitrate720p),RelativePriority="Normal"}}});// ***************// job operations// ***************// list all jobsvarjobs=client.Jobs.ListAll();// create output assetvaroutputAssetName=MKIOClient.GenerateUniqueName("asset");varoutputAsset=client.Assets.CreateOrUpdate(outputAssetName,outputAssetName,config["StorageName"],"output asset for job");// create a job with the output asset created and with an asset as a sourcevarnewJob=client.Jobs.Create(transform.Name,MKIOClient.GenerateUniqueName("job"),newJobProperties{Description="My job",Priority="Normal",Input=newJobInputAsset("copy-ef2058b692-copy",newList<string>{"switch_1920x1080_AACAudio_3677.mp4"}),Outputs=newList<JobOutputAsset>(){newJobOutputAsset(){AssetName=outputAssetName}}});// job with http source as a sourcevarnewJobH=client.Jobs.Create(transform.Name,MKIOClient.GenerateUniqueName("job"),newJobProperties{Description="My job",Priority="Normal",Input=newJobInputHttp(null,newList<string>{"https://myurltovideofile.mp4"}),Outputs=newList<JobOutputAsset>(){newJobOutputAsset(){AssetName=outputAssetName}}});// wait for the job to completewhile(newJobH.Properties.State==JobState.Queued||newJobH.Properties.State==JobState.Scheduled||newJobH.Properties.State==JobState.Processing){newJobH=client.Jobs.Get(tranform.Name,newJobH.Name);Console.WriteLine(jobHttp.Properties.State);Thread.Sleep(10000);}// Get a jobvarjob2=client.Jobs.Get(tranform.Name,"testjob1");// Cancel a jobclient.Jobs.Cancel(tranform.Name,"testjob2");// Delete a jobclient.Jobs.Delete(tranform.Name,"testjob3");