Giter Club home page Giter Club logo

mk.io's People

Contributors

xpouyat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mk.io's Issues

Cannot retrieve SAS token

I'm trying to construct a SAS URI to use in a BlobContainerClient instance:

            var storages = _mediaKindClient.StorageAccounts.List();
            var credentials = _mediaKindClient.StorageAccounts.ListCredentials(
                (Guid)storages.First().Metadata.Id
            );
            var credential = _mediaKindClient.StorageAccounts.GetCredential(
                (Guid)storages.First().Metadata.Id,
                (Guid)credentials.First().Metadata.Id
            );

            string storageAccountUrl = $"https://{_storageAccountName}.blob.core.windows.net";
            string containerName = data.DestinationContainer;
            string sasToken = credential.Spec.AzureCredential.SasToken;

            string sasUriString = $"{storageAccountUrl}/{containerName}/{sasToken}";
            BlobContainerClient destinationBlobContainer = new BlobContainerClient(sasUri);

In this case, the SasToken is null and the blob container lacks the proper auth, but I do see a value in the SasTokenSanitized (with the redacted portion). Why is SasToken NULL but SasTokenSanitized not?

What is the pattern with this MK.IO library to use to achieve the goal here of having a SAS URI constructed?

I also noticed that the library has no way to retrieve the MK.IO Storage Account name and URL which would also be super useful in constructing such URIs.

Job Name is limited to 250 characters, not 63

This assertion is wrong:

https://github.com/xpouyat/MK.IO/blob/77a16e5118ec2f6a274dd9e9c4ef0af56ae91861/MK.IO/Job/JobsOperations.cs#L189C1-L189C76

Below is an actual response from the API that describes the limit, and it is consistent with Azure Media Services API.

{
  "error": {
    "code": "1000.2000.5500.1020",
    "detail": "Job Validation failed. Field name:'A123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789' is invalid: ['Length must be between 1 and 260.']"
  },
  "ref": "9bb8f482-cba1-4204-a61d-fcc5545ad4df",
  "status": 400
}

Error SSL Connection

Hello,

I am getting the following error occasionally on my server. I have no information about it. It has failed me for different methods, but always the same error. Is there something I should control on my server? Can you tell me more about it?

System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.IO.IOException: Unable to read data from the transport connection: Se produjo un error durante el intento de conexión ya que la parte conectada no respondió adecuadamente tras un periodo de tiempo, o bien se produjo un error en la conexión establecida ya que el host conectado no ha podido responder.. ---> System.Net.Sockets.SocketException (10060): Se produjo un error durante el intento de conexión ya que la parte conectada no respondió adecuadamente tras un periodo de tiempo, o bien se produjo un error en la conexión establecida ya que el host conectado no ha podido responder. --- End of inner exception stack trace --- at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token) at System.Net.FixedSizeReader.ReadPacketAsync(Stream transport, AsyncProtocolRequest request) at System.Net.Security.SslStream.EndProcessAuthentication(IAsyncResult result) at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at MK.IO.MKIOClient.ObjectContentAsync(String url, HttpMethod httpMethod)
at MK.IO.MKIOClient.GetObjectContentAsync(String url)
at MK.IO.Asset.AssetsOperations.GetAsync(String assetName)`

Job Validation failed

We create a JobInputHttp with given start and end times based on Timespans:

var jobInput = new MK.IO.Models.JobInputHttp(null, new List<string> { sourceURL });
if (timeStart != null)
    jobInput.Start = new MK.IO.Models.AbsoluteClipTime(timeStart.Value);
if (timeEnd != null)
    jobInput.End = new MK.IO.Models.AbsoluteClipTime(timeEnd.Value);

But when we're creating the job, we get the following error:
Bad Request : Job Validation failed. Unsupported @odata.type #Microsoft.Media.AbsoluteClipTime

And looking into "MK.IO.Models.AbsoluteClipTime" I can see the following definition:

[JsonProperty("@odata.type")]
internal override string OdataType => "#Microsoft.Media.AbsoluteClipTime";

Support AlternateId for Assets

I'm currently testing MediaKind as a replacement for AMS.

For backwards compatibility reasons it would be much appreciated to have support in the Assets.CreateOrUpdateAsync to provide an AltenateId so it can be set in the AssetProperties.

Do you think this is a reasonable improvement to the library?

Create locator for asset fails when EndTime is set - Error from MKIO API "Streaming Locator load failed."

Trying to create a locator for an asset with a endtime set 2 hours ahead (Utc.Now + 2 Hours) and the Api fails with:
image

Code used to create locator is as follows:
var newLocatorProps = new MK.IO.Models.StreamingLocatorProperties { AssetName = assetname, StartTime = DateTime.UtcNow, EndTime = DateTime.UtcNow.AddHours(2), StreamingPolicyName = "Predefined_ClearStreamingOnly" }; var newLocator = await client.StreamingLocators.CreateAsync(Guid.NewGuid().ToString(), newLocatorProps);

If endtime is removed then to operation completes successfully.

Version used 1.2.1 with Asp.Net 8 website. Based in UK so dd/mm/yyyy date format, shouldn't matter but you never know!

Error from MKIO API "Streaming Endpoint load failed. 'cdnProvider' field only valid if CDN is enabled" in new 1.2.0 package.

If you try to create the streaming endpoint with the new package 1.2.0 with the model provided below you can get an error from mediakind api

Streaming Endpoint load failed. 'cdnProvider' field only valid if CDN is enabled.

I believe it is because in the StreamingEndpointProperties class has CdnProvider property of StreamingEndpointCdnProvider type (enum) and it isn't nullable and by default has StandardAkamai value

image

code example

var properties = new StreamingEndpointProperties
{
	Description = "my description",
	ScaleUnits = 0,
	Sku = new StreamingEndpointsCurrentSku
	{
		Name = "Standard",
		Capacity = 600
	}
};

image
image
Thank you!

Programmatically-created jobs never finish

Hi,

I know this probably isn't an issue with this package, but I thought I may as well ask.

I am testing MKIO as a replacement for AMS, and am trying to encode some content. While the jobs do create correctly, they never complete (one has been in the "processing" state for three days):

screenshot of jobs stuck in "processing" state

My code is quite simple - it is trying to do a video encode (or an audio transcribe, neither one works) against files in existing assets (migrated from AMS using the commandline tool) - this is the essence of it:

var contentAwareEncodingPreset =
    new BuiltInStandardEncoderPreset(EncoderNamedPreset.H264MultipleBitrate1080pWithCVQ);

var outputs = new List<TransformOutput> {
    new TransformOutput {Preset = contentAwareEncodingPreset},
};

var properties = new TransformProperties{Description = "Video transform", Outputs = outputs};
var transform = await client.Transforms.CreateOrUpdateAsync("Video transform", properties);

// ...


await client.Jobs.CreateAsync(
    transform.Name,
    "Job name",
    new JobProperties
    {
        Input = new JobInputAsset(inputAssetName, filenames),
        Outputs = new List<JobOutputAsset> {new JobOutputAsset {AssetName = outputAssetName}}
    });           

Is there anything obvious I'm missing? I assume that there must be some problem in the platform too, if the jobs never complete or return errors.

Jobs.Create with JobInputHttp cuts of url parameters

I'm trying to encode a video from url like:
https://somedomain.com/somepath?someparameter=somevalue

But when I check the job, it reports only the first part of the url:
https://somedomain.com/somepath

And the status of the job is error:
file not found

I don't know if this is the SDK issue or the API issue, but these urls were encoded properly with AMS

Configuring ContentKeyPolicy for FairPlay DRM fails with error "Unsupported @odata.type #Microsoft.Media.ContentKeyPolicyConfigurationFairPlay"

Attempting to create our content key policy with FairPlay DRM results in a request error when attempting to create.

Bad Request : Failed to process payload. Unsupported @odata.type #Microsoft.Media.ContentKeyPolicyConfigurationFairPlay

Status: 400
Response: 
{
  "error": {
    "code": "1000.2000.2000.1040",
    "detail": "Failed to process payload. Unsupported @odata.type #Microsoft.Media.ContentKeyPolicyConfigurationFairPlay"
  },
  "ref": "90db1892-0a84-45b6-be88-6828f2dad49b",
  "status": 400
}

with StackTrace:

 at MK.IO.MKIOClient.AnalyzeResponseAndThrowIfNeeded(HttpResponseMessage amsRequestResult, String responseContent)
  at MK.IO.MKIOClient.<CreateObjectInternalAsync>d__75.MoveNext()
  at MK.IO.MKIOClient.<CreateObjectPutAsync>d__72.MoveNext()
  at MK.IO.ContentKeyPoliciesOperations.<CreateAsync>d__14.MoveNext()

It appears that the odata.type for FairPlay may need to be changed to "#Microsoft.Media.ContentKeyPolicyFairPlayConfiguration" (as seen when viewing an existing configured content key policy on MK.io portal) instead of "#Microsoft.Media.ContentKeyPolicyConfigurationFairPlay"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.