xpouyat / mk.io Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
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.
Hello!
Is it necessary to put [JsonProperty("@odata.type")] attribute on OdataType property in ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader class?
I mean here
Thank you
Is there not a present for EncoderNamedPreset.ContentAwareEncoding? We were using that preset.
This assertion is wrong:
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
}
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.TaskFactory
1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action
1 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(Task
1 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)`
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";
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?
I am using Azure Media Services with a .NET Core 3.1 solution.
I would really like to use this library for migration, but it is not available due to a dependency error.
Can you please make it available?
Thank you.
Trying to create a locator for an asset with a endtime set 2 hours ahead (Utc.Now + 2 Hours) and the Api fails with:
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!
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
code example
var properties = new StreamingEndpointProperties
{
Description = "my description",
ScaleUnits = 0,
Sku = new StreamingEndpointsCurrentSku
{
Name = "Standard",
Capacity = 600
}
};
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):
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.
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
I was wondering what you think of using .NET's standard JSON (de)serializer, System.Text.Json
, instead of NewtonSoft.Json
?
This isn't too much of a big deal. However, the library could reduce the number of dependencies and possible security issues from it
Here's docs from Microsoft to migrate: https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/migrate-from-newtonsoft?pivots=dotnet-8-0
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"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.