cannot get onvif GetStreamUri from media2 - linux

I want to get the media stream url from onvif,but it shows that "Method 'GetStreamUri' not implemented: method name or namespace not recognized"Detail: [no detail] .
I don't know the reason why the method GetStreamUri not implemented?
I download wsdl "http://www.onvif.org/ver20/media/wsdl" and generate the code by using the gsoap.
console ouput
I find the TEST.log.It shows that it cannot find ns3:GetStreamUri and ns1:GetStreamUri
debug information

Is your camera Profile T compliant or does it at least implement Media Service 2?
In not, then you should use Media Service 1.

Related

How to automatically associate a device with a device template?

I want to automatically associate my device with its template. There is an article about this here:
https://learn.microsoft.com/en-us/azure/iot-central/core/concepts-get-connected#automatically-associate-with-a-device-template
the sample code for this is in JS and says to include iotcModelId: '< this is the URN for the capability model>'; OR '__iot:interfaces': { CapabilityModelId: <this is the URN for the capability model> }
I can see in the python device SDK documentation on keyword args available during client creation.
https://github.com/Azure/azure-iot-sdk-python/wiki/key-word-arguments-during-client-creations
But I don't see anything in those keywords about the device template. I've tried a couple of permutations on my own, but nothing seems to work as I'm registering my device using ProvisioningDeviceClient.create_from_x509_certificate.
Anyone know the correct way to include the device template in the registration?
Once you have created your ProvisioningDeviceClient you need to set the provisioning_payload property to the JSON string that contains your model-id per documentation you have linked above.
There's a tutorial and sample on Microsoft Docs that illustrates this using Python: Tutorial: Create and connect a client application to your Azure IoT Central application.

XSLT got the exception in logic apps

When I use the XSLT to transform XML source file then got the below exception in Logic APP. This below URL is avail in the XSLT file.
How to resolve this issue in logic apps?
XSD schema is valid and working fine. At TransformXML place got this issue.
"Code": "InvalidXsltContent", "Message": "An error occurred while
processing map. 'Cannot find a script or an extension object
associated with namespace
'http://schemas.microsoft.com/BizTalk/2003/ScriptNS0'.'",
According to the error message, it seems the logic app can't find the external assembly from the integration account. So could you please check if you have upload the assembly to your integration account ? You can refer to this tutorial to know how to upload the assembly.
By the way, it seems you want to use custom extension in your xslt map. Here I provide two links for your reference:
https://learn.microsoft.com/en-us/biztalk/core/technical-reference/custom-extension-xml-grid-property?redirectedfrom=MSDN
https://blog.vertica.dk/2013/03/20/using-custom-xslt-in-biztalk/

Azure Media Services DRM Integration With 3rd Party Unified Streaming Server

Overview
We are building a music streaming application that will be primarily targeted at Android devices. The main aim is to sell music subscriptions while protecting the media assets we are providing our end-users, thus A DRM solution is core to our infrastructure. The setup we have is as below:
Core Components:
Android Mobile Application with Exoplayer
Unified Streaming Server as streaming server
Azure Media Services for DRM services
Key generation utilities from Azure Media Services Sdk
These are the steps we take:
Step 1: Encoding
We use ffmpeg to encode our various media assets to different mp4 bit rate outputs:
256 KBPS
192 KBPS
128 KBPS
96 KBPS
64 KBPS
Step 2: Encryption
Once we have converted our media assets, we run a two-step encoding process on the converted media assets.
First, we run the AZURE .NET SDK for key generation with the following sample output:
key:nb:kid:UUID:fae1ab22-cd13-44f8-a746-0d7dd3a31645
key value:MVEp833L3jmUaNvTy3JUuQ==
PlayReady URL:
https://music.keydelivery.mediaservices.windows.net/PlayReady/
Widevine URL:
https://music.keydelivery.mediaservices.windows.net/Widevine/?KID=fae1ab22-cd13-44f8-a746-0d7dd3a31645
Auth policy: nb:ckpid:UUID:15ec2f3f-4ad9-49be-9f89-b5431bc3dec1
That generates for us the following items: KEY_ID, CONTENT_KEY,AUTH_POLICY and LICENSE_URL.
We have noted when using the Azure .NET SDK that there is a token restriction policy option which is responsible for generating token protection for licenses via SWT or JWT tokens with a bunch of options. Since we do not want token protection, we set the SDK to issue the license with open authorization policy. We have highlighted the lines of code we modified to achieve this below for reference:
Azure Media Services .NET SDK
Line 49:
bool tokenRestriction = false; - main change
Line 81:
if (tokenRestriction)
tokenTemplateString = AddTokenRestrictedAuthorizationPolicy(key);
else
AddOpenAuthorizationPolicy(key);
Console.WriteLine("Auth policy: {0}",
key.AuthorizationPolicyId, System.Convert.ToBase64String(key.GetClearKeyValue()));
Since ExoPlayer is only able to play PlayReady on Android TV, we are restricted to requesting Widevine licences.
We then use the Unified Streaming mp4split tool to encrypt our media assets with the information we highlighted above from the Azure .NET SDK. The command to encrypt assets for Widevine licences is shown below with more details on the command here.
Notes on the command:
We need to convert our KEY_ID and CONTENT_KEY to hexadecimal values before we can use them in the mp4split command:
KEY_ID of UUID:fae1ab22-cd13-44f8-a746-0d7dd3a31645 becomes
22ABE1FA13CDF844A7460D7DD3A31645
CONTENT_KEY of MVEp833L3jmUaNvTy3JUuQ== becomes
315129F37DCBDE399468DBD3CB7254B9
We still don't know what the PSSH value is from the response we get from the Azure .NET SDK. The Unified Streaming documentation says the following:
The DRM specific data provided by the license server (the Widevine PSSH data).
Can either be a Base64 string or a file with the decoded Base64 data. The file name must include a '.'
Note that the LA_URL (license acquisition URL) is not signaled in the "pssh" box and is often hard-coded in a DASH player supporting Winevine Modular itself. The recommended setting is to use the correct URL.
We are looking for assistance in figuring out what the PSSH Data is from the Azure .NET SDK output that we receive. In the meantime we have been using the AUTH_POLICY_ID (converted to Base64) as the PSSH in the mp4split command.
When we put all the above together, the mp4split script we use becomes:
#!/bin/bash
KID=22ABE1FA13CDF844A7460D7DD3A31645
CEK=315129F37DCBDE399468DBD3CB7254B9
LAURL="https://music.keydelivery.mediaservices.windows.net/Widevine/? KID=fae1ab22-cd13-44f8-a746-0d7dd3a31645"
PSSH="Py/sFdlKvkmfibVDG8PewQ=="
mp4split --license-key=usp/license.key -o musicfile.ism \
--mpd.inline_drm \
--widevine.key=${KID}:${CEK} \
--widevine.license_server_url=${LAURL} \
--widevine.drm_specific_data=${PSSH} \
musicfile-64kbps.mp4
aws s3 cp musicfiles.ism s3://output-bucket/
aws s3 cp musicfiles-64kbps.mp4 s3://output-bucket/
NOTES:
For the above command we are generating an ism manifest file with Widevine licence encryption for a 64kps bitrate mp4 music file.
The --license-key is for the unified streaming premium product.
The AWS S3 commands are for uploading our generated ism and associated mp4 64kps bitrate file to our aws s3 storage buckets.
Once this process is done, the next step is integration with ExoPlayer.
Step 3: Streaming
Once we upload our .ism and its associated mp4 file to our S3 bucket, the mobile app uses the following details to access the stream and play it back:
{
"name": "Music Tests",
"uri": "http://mozart.musicfiles.com/auth/media/musicfiles.ism/.mpd",
"drm_scheme": "widevine",
"drm_license_url": "https://music.keydelivery.mediaservices.windows.net/Widevine/?KID=fae1ab22-cd13-44f8-a746-0d7dd3a31645"
}
Where:
URI - is our Unified Streaming server endpoint
DRM_LICENSE_URI - is widevine server url we are given by our Azure .NET SDK
We get errors at this stage after we have uploaded, encoded and encrypted the media assets. The error in the Android app is the following:
02-07 12:58:58.458 16454-5913/com.google.android.exoplayer2.demo E/OMXMaster: A component of name 'OMX.qcom.audio.decoder.aac' already exists, ignoring this one.
02-07 12:59:02.892 16454-5811/com.google.android.exoplayer2.demo E/ExoPlayerImplInternal: Renderer error.
com.google.android.exoplayer2.ExoPlaybackException
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.shouldWaitForKeys(MediaCodecRenderer.java:709)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:650)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:490)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:464)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:300)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:168)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.google.android.exoplayer2.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
Caused by: com.google.android.exoplayer2.drm.DrmSession$DrmSessionException: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 400
at com.google.android.exoplayer2.drm.DefaultDrmSessionManager.onError(DefaultDrmSessionManager.java:594)
at com.google.android.exoplayer2.drm.DefaultDrmSessionManager.onKeysError(DefaultDrmSessionManager.java:589)
at com.google.android.exoplayer2.drm.DefaultDrmSessionManager.onKeyResponse(DefaultDrmSessionManager.java:549)
at com.google.android.exoplayer2.drm.DefaultDrmSessionManager.access$900(DefaultDrmSessionManager.java:49)
at com.google.android.exoplayer2.drm.DefaultDrmSessionManager$PostResponseHandler.handleMessage(DefaultDrmSessionManager.java:669)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:168)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.google.android.exoplayer2.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 400
at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:212)
at com.google.android.exoplayer2.upstream.DataSourceInputStream.checkOpened(DataSourceInputStream.java:101)
at com.google.android.exoplayer2.upstream.DataSourceInputStream.read(DataSourceInputStream.java:81)
at com.google.android.exoplayer2.upstream.DataSourceInputStream.read(DataSourceInputStream.java:75)
at com.google.android.exoplayer2.util.Util.toByteArray(Util.java:118)
at com.google.android.exoplayer2.drm.HttpMediaDrmCallback.executePost(HttpMediaDrmCallback.java:106)
at com.google.android.exoplayer2.drm.HttpMediaDrmCallback.executeKeyRequest(HttpMediaDrmCallback.java:91)
at com.google.android.exoplayer2.drm.DefaultDrmSessionManager$PostRequestHandler.handleMessage(DefaultDrmSessionManager.java:692)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:168)
at android.os.HandlerThread.run(HandlerThread.java:61)
02-07 12:59:02.896 16454-16454/com.google.android.exoplayer2.demo E/EventLogger: playerFailed [7.76]
com.google.android.exoplayer2.ExoPlaybackException
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.shouldWaitForKeys(MediaCodecRenderer.java:709)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:650)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:490)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:464)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:300)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:168)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.google.android.exoplayer2.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
Caused by: com.google.android.exoplayer2.drm.DrmSession$DrmSessionException: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 400
at com.google.android.exoplayer2.drm.DefaultDrmSessionManager.onError(DefaultDrmSessionManager.java:594)
at com.google.android.exoplayer2.drm.DefaultDrmSessionManager.onKeysError(DefaultDrmSessionManager.java:589)
at com.google.android.exoplayer2.drm.DefaultDrmSessionManager.onKeyResponse(DefaultDrmSessionManager.java:549)
at com.google.android.exoplayer2.drm.DefaultDrmSessionManager.access$900(DefaultDrmSessionManager.java:49)
at com.google.android.exoplayer2.drm.DefaultDrmSessionManager$PostResponseHandler.handleMessage(DefaultDrmSessionManager.java:669)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:168)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.google.android.exoplayer2.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 400
at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:212)
at com.google.android.exoplayer2.upstream.DataSourceInputStream.checkOpened(DataSourceInputStream.java:101)
at com.google.android.exoplayer2.upstream.DataSourceInputStream.read(DataSourceInputStream.java:81)
at com.google.android.exoplayer2.upstream.DataSourceInputStream.read(DataSourceInputStream.java:75)
at com.google.android.exoplayer2.util.Util.toByteArray(Util.java:118)
at com.google.android.exoplayer2.drm.HttpMediaDrmCallback.executePost(HttpMediaDrmCallback.java:106)
at com.google.android.exoplayer2.drm.HttpMediaDrmCallback.executeKeyRequest(HttpMediaDrmCallback.java:91)
at com.google.android.exoplayer2.drm.DefaultDrmSessionManager$PostRequestHandler.handleMessage(DefaultDrmSessionManager.java:692)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:168)
at android.os.HandlerThread.run(HandlerThread.java:61)
The Error Codes from the Azure Media Services here states the following for response code 400:
Azure Error Codes
400 Bad Request The request contains invalid information and is
rejected due to one of the following reasons:
-An unsupported API version is specified. For the most current
version, see Setup for Media Services REST API Development. -The API
version of Media Services is not specified. For information on how to
specify the API version, see Connecting to Media Services with the
Media Services REST API. Note
If you are using the .NET or Java SDKs to connect to Media Services,
the API version is specified for you whenever you try and perform some
action against Media Services.
An undefined property has been specified. The property name is in the error message. Only those properties that are members of a given
entity can be specified. See Azure Media Services REST API Reference
for a list of entities and their properties.
An invalid property value has been specified. The property name is in the error message. See the previous link for valid property types
and their values.
A property value is missing and is required.
Part of the URL specified contains a bad value.
An attempt was made to update a WriteOnce property.
An attempt was made to create a Job that has an input Asset with a primary AssetFile that was not specified or could not be determined.
An attempt was made to update a SAS Locator. SAS locators can only be created or deleted. Streaming locators can be updated. For more
information, see Locators.
An unsupported operation or query was submitted.
Also in addition to that when we run a GET Request on the widevine server url
GET https://music.keydelivery.mediaservices.windows.net/Widevine/?KID=fae1ab22-cd13-44f8-a746-0d7dd3a31645
We get the following response:
<?xml version="1.0" encoding="utf-8"?>
<Error>
<Message>License challenge is missing from the request body.</Message>
<Code>NoLicenseChallenge</Code>
</Error>
What does the above error message mean?
We have been reading the Azure Documentation but we have not been able to figure out how to resolve the error.
We are trying to integrate our third party streaming server unified streaming with azure media services DRM solution.

how to transfer user from one MIDLET to another MIDLET

I have created an menu in which there are different operation. When the user click's on the item's it should invoke another midlet respectively.
Or is there any other way of doing it?
I tried this code: previous = PushRegistry.registerAlarm("m", 0); to transfer to another midlet but it gives an exception:
java.lang.ClassNotFoundException: No MIDLet-<n> registration
m is the midlet present in the same package.
API documentation for the method PushRegistry.registerAlarm explains why you are getting the error:
Throws:
...ClassNotFoundException - if the MIDlet class name can not be found in the current MIDlet suite or if this class is not included in any of the MIDlet-<n> records in the descriptor file or the jar file manifest or if the midlet argument is null...
Given the error message about No MIDLet-<n> registration, one of the possible error reasons listed above appears to fit your case: "class is not included in any of the MIDlet-<n> records".
If you are interested in how to properly use PushRegistry functionality, consider studying introductory tutorial, like eg one recommended at Learning Path: Getting Started with MIDP 2.0:
The MIDP 2.0 Push Registry is a comprehensive article that shows you how to get your MIDP 2.0 application to respond to incoming network connections...

Launch Documents To Go app from third party Blackberry App

I was wondering if it's possible to open doc, xls, pdf, etc files using the "Documents To Go" app from a third party blackberry app.
If you want to open a specific document, since Docs ToGo registers to handle these extensions, you can use the Registry invocation and it will be handled for you. Take a look at the Registry and Invocation classes, the following code will open the document in the given path, Docs ToGo will take over through the Registry:
Invocation invocation = new Invocation(path);
Ragistry reg = = Registry.getRegistry("<your app namespace.class>");
reg.invoke(invocation);
If there is no registered handler for the file content type a ContentHandlerException will be thrown with error code ContentHandlerException.NO_REGISTERED_HANDLER.
Note: there's a small bug in Docs ToGo - closing the document or clicking the back button might not lead the user back to your application.
EDIT: The getRegistry function takes a class fully qualified name e.g. com.softartisans.SilverDust, where SilverDust is the class mane. You can find more info about the use of the Registry in this online book starting page 291 - Client use of Registry. I originally linked to the javax Registry, but it is more useful to look at the BlackBerry Registry docs.
You can use the ApplicationManager class to launch other applications, for example by looking up its descriptor and using runApplication(). You can also pass arguments in the descriptor and if the application looks at arguments passed into it, it may actually open the specified file.

Resources