GithubHelp home page GithubHelp logo

azure-samples / azure-video-indexer-samples Goto Github PK

View Code? Open in Web Editor NEW
120.0 41.0 85.0 59.25 MB

Contains the Azure Media Services Video Indexer samples

License: MIT License

HTML 28.74% C# 22.05% CSS 0.49% JavaScript 3.55% PowerShell 1.43% TypeScript 8.38% SCSS 0.14% Shell 7.15% Bicep 6.49% Java 12.93% Python 6.58% Jupyter Notebook 2.08%

azure-video-indexer-samples's Introduction

page_type languages products description urlFragment
sample
csharp
javascript
html
dotnet
azure
azure-media-services
azure-video-indexer
Video Indexer Official Samples

Official Video Indexer Samples

Welcome to the official Video Indexer (VI) Samples repo. Video indexer builds upon media AI technologies to make it easier to extract insights from videos. Here you can find some great code snippets that you can use to work with Video Indexer API and integrate Video Indexer widgets into your website.

IMPORTANT: REPO NAME CHANGE

Due to the retirement of Azure Media Services, this repository's name is going to change to "azure-video-indexer-samples" as early as January 24th and no later than January 26th, 2024. Plan accordingly.

Contents

Here you can find code samples and project examples of how to use Video Indexer, integrated it with your product, and expand our out-of-the-box offering by integrating with other products.

File/folder Description Owner
Deploy-Samples Quick-Start tutorial to create Azure Video Indexer and all its resource dependencies with ARM, or bicep Video Indexer
API Samples Sample code of uploading and indexing video using API Video Indexer
VideoIndexerEnabledByArc Video Indexer Enabled By Arc Sample And deploy tutorials Video Indexer
Embedding widgets How to add Video Indexer widgets to your app Video Indexer
media media used for md files
.gitignore Define what to ignore at commit time
CHANGELOG.md List of changes to the sample
CONTRIBUTING.md Guidelines for contributing to the sample
README.md This README file
LICENSE The license for the sample

We highly recommend you will follow our blog posts to get deeper insights and the most updated news.

Prerequisites

You should have an active user to Video Indexer.

Start by Signing-up to Video Indexer API and get your API key.

We also recommend to start with our short and basic introduction to Video Indexer, if you are not familiar with VI.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Authors

For each folder you will find a README file which will specify the relevant author for the sample code you are looking at.

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

azure-video-indexer-samples's People

Contributors

tshaiman avatar shemers avatar dependabot[bot] avatar tshoham avatar itayar avatar itnorman avatar dupuyjs avatar nofaredanoren avatar martinkearn avatar xpouyat avatar juliako avatar ingridatmicrosoft avatar shanepeckham avatar microsoftopensource avatar macel94 avatar uratzmon avatar fvneerden avatar karolzak avatar benbakhar avatar fbridger avatar ignaciofls avatar itayarb avatar martinpeck avatar motikad avatar oriziv avatar microsoft-github-operations[bot] avatar nikkiconley avatar

Stargazers

Joseph Azar avatar Kshitiz Mahajan avatar  avatar Shatong Zhu avatar  avatar Carly  avatar Lukasz Miroslaw avatar Filipe Oliveira avatar Josh G avatar Eli Boyarski avatar Hendrik Hein avatar  Vivek Rp avatar  avatar jason_1i avatar Renan Noronha avatar Edward Burns avatar Hao Wu avatar hly990 avatar AI MATT avatar  avatar  avatar  avatar Dumilde Matos avatar Matt avatar  avatar  avatar Andy Chow avatar  avatar  avatar  avatar  avatar Brenden Durham avatar John Freier avatar  avatar Samil Yalciner avatar Akash Talole avatar  avatar Rodrigo Ratan avatar  avatar Raj avatar Rick Lopez avatar Junwoo Jeong avatar The MadMan Laboratory Chronicles avatar Chris Posada avatar Aleksandra Łucja Jaworska avatar Zvan avatar  avatar Sina Fathi-Kazerooni avatar  avatar Ryan_Agatep avatar Michael Wolfenden avatar Om Kumar Panda avatar Chris Thompson avatar Christian Dehaeseleer avatar David Payne avatar Ben Coughlan avatar  avatar Drew H avatar Whit Waldo avatar Brad Pillow avatar  avatar Nico Jahn avatar Nayanexx.py  avatar Douglas Mendes avatar Marcelo Zambrana Villarroel avatar  avatar Martin Rodriguez Duque avatar  avatar Łukasz Sztukiewicz avatar kalpesh  borse avatar João Pedro Martins avatar  avatar Sébastien Moreno avatar Thomas Conté avatar Sid avatar Xiaoyong Zhu avatar Drew Marsh avatar Avi Avidan avatar  avatar  avatar Rabeeh Abla avatar Americanmemes avatar Andy Potanin avatar  avatar Ajinkya Puar avatar  avatar April Edwards avatar ChenQuan avatar Jamie Hurley avatar Dave avatar  avatar  avatar Kristian Spurling avatar Yönet avatar Niruddya Samarasinghe avatar Micheleen Harris avatar José Morales avatar  avatar insagiv avatar  avatar

Watchers

Erik St. Martin avatar James Cloos avatar  avatar  avatar Asir Vedamuthu Selvasingh avatar  avatar  avatar yuanliang avatar  avatar Azure Compliance 3 avatar  avatar  avatar  avatar Amit Rajput avatar  avatar  avatar Hyuk Jun Kim avatar Anil Murching avatar Vatsal Shah avatar Brady Mathieson avatar  avatar Sanjid avatar  avatar Azure Compliance 5 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar Kristian Spurling avatar  avatar  avatar  avatar  avatar James Truitt avatar  avatar  avatar  avatar

azure-video-indexer-samples's Issues

Logic App infrastructure and workload provisioning separation

I am considering to separate out the infrastructure part of a logic app from the workload part of a logic app. Comparable to how one would separate out app service infrastructure from workload.

But after some exploration, in particular the key is found in this example file:
https://github.com/Azure-Samples/media-services-video-indexer/blob/master/AIEnrichmentPipeline/infra/logicapp/logicapp.tf

It seems that there is very little separate infrastructure:

resource "azurerm_logic_app_workflow" "logicapp" {
  location            = var.shared_env.rg.location
  resource_group_name = var.shared_env.rg.name
  tags                = var.shared_env.tags

  name = var.workflow_name
  lifecycle {
    ignore_changes = [
      # Ignore changes to parameters as otherwise we will break the $connections
      parameters,
      tags
    ]
  }
}

The workload seems to contain all infrastructure details as well. I.e.
https://github.com/Azure-Samples/media-services-video-indexer/blob/master/AIEnrichmentPipeline/logicapp/digitaltextfileworkflow/armtemplate.json
specifies the full set of logic app resources.

Why would you keep this terraform resource declaration?
At least one reason I see, is that terraform provisions the tags towards the logic app resource.

And what about your app lifecycle. Will you run terraform to deploy an updated version of your logic app workload? Is there any suggestion you can make on versioning? Analogous to how one would separate out app service infrastructure from workload package versioning through e.g. Azure Artifacts.

In the past I was involved in a setup where we provide building blocks to use case teams. I.e. we provide a logic app building block and a connection bulding block and the use case team applies these building blocks in their pipelines.
Analogous, you could separate out from the arm template:

  • the workload json; reference it from the logic app resource inside terraform
  • the connection declaration into terraform

Are there any considerations here?

Custom Insights Example incorrect.

The linked sample does not work correctly. When looking at the custom insights the Insights tab bar graph does not show correctly as times are showing as "NaN:NaN:NaN". Following through the examples the duration is expected as number as seconds. (ie 634)

https://github.com/Azure-Samples/media-services-video-indexer/blob/eea7f3fe72bf21e5fbda55800dc93361bb3d0b1f/Embedding%20widgets/widget-customization/custom-insight-widget/custom-insights-widget-with-raw-insight-data-and-controls.html

Digging through the minified js the method 'generateBasicIndexObject' is actually passing in the duration as seconds and then try to generate a string of "hh:mm:ss". However the function implementation is then returning a string formatted as "634:undefined:undefined". This is then being passed to the graph which is failing to parse.

Is there a work around for this?

AIEnrichmentPipeline: SAS URL Expiry Date is Set in the Past

Within the AIEnrichmentPipeline sample there is a SAS URL set up to allow the function apps to access their zipped code deployments from storage.

Within the Terraform there is a SAS token expiry date set to limit the scope of SAS URL, however the expiry date for this token has since passed. The result is that the functions fail to start up, and report that they are unable to connect to the Azure Functions runtime.

This is the line of code that causes the issue. The simple fix is to push this Expiry Date out into the future:

https://github.com/Azure-Samples/media-services-video-indexer/blob/master/AIEnrichmentPipeline/infra/core/storage.tf#L61

What should be the required API permissions for ClientSecretCredential to obtain arm access token for Video Indexer

I'm currently working on integrating Video Indexer into my application using Azure services. I'm using the ClientSecretCredential method for authentication, and I'm encountering some difficulties in determining the required API permissions for the application to obtain a token for Video Indexer.
Below is the code that am trying to get arm access token

def get_arm_access_token(consts:Consts) -> str:
'''
Get an access token for the Azure Resource Manager
Make sure you're logged in with az first

:param consts: Consts object
:return: Access token for the Azure Resource Manager
'''
credential = ClientSecretCredential(tenant_id, client_id, client_secret)
scope = f"{consts.AzureResourceManager}/.default" 
token = credential.get_token(scope)
return token.token

I am getting below error with above token

The client 'xxxx' with object id 'xxxxx' does not have authorization to perform action 'Microsoft.VideoIndexer/accounts/generateAccessToken/action' over scope '/subscriptions/xxxxxx-xxxx-xxxx-xxxx-xxxxxx/resourceGroups/xxxx/providers/Microsoft.VideoIndexer/accounts/XXXXVideoIndexer' or the scope is invalid.

What are the API Permissions that are required for my App to connect to Azure Video Indexer?

Could someone please guide me on the specific API permissions that need to be assigned to the Azure AD App Registration associated with my application in order to successfully obtain a token for Video Indexer using ClientSecretCredential?

Any insights or documentation pointers regarding the necessary permissions would be greatly appreciated.

Runtime Exception while invoking VideoUpload in Java APISample

Hi Team,
We are following the Java APISample present in the Repo. We are getting the below runtime issue when invoking the VideoUplaod method. Please find the exception below:

Exception in thread "main" java.lang.RuntimeException: (POST https://api.videoindexer.ai/accounts/remix-video-indexer/videos?api-version=2022-08-01&videoUrl=https%3A%2F%2Fremixstoargeaccount.blob.core.windows.net%2Fremixblobstorage%2FVideo+Indexer%2FSampleRemix-1.mp4&name=video-345-sample&description=video_description&privacy=private&callbackUrl=&accessToken=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJWZXJzaW9uIjoiMi4wLjAuMCIsIktleVZlcnNpb24iOiIxNGU0M2M5NDFlOWI0OTg1OWU0NDkzNDFhZjgxZjNiNiIsIkFjY291bnRJZCI6ImQ4YTYzNDFmLTg3N2QtNGYzMi1iNWVhLTViYzQ0NTJhNzA2ZCIsIkFjY291bnRUeXBlIjoiQXJtIiwiUGVybWlzc2lvbiI6IkNvbnRyaWJ1dG9yIiwiRXh0ZXJuYWxVc2VySWQiOiI3OTE4NUMxRDY4NjI0RkFEODQwRTZBNjU1MzRCRURFOCIsIlVzZXJUeXBlIjoiTWljcm9zb2Z0Q29ycEFhZCIsIklzc3VlckxvY2F0aW9uIjoiY2VudHJhbGluZGlhIiwibmJmIjoxNjg2NjU1NTc0LCJleHAiOjE2ODY2NTk0NzQsImlzcyI6Imh0dHBzOi8vYXBpLnZpZGVvaW5kZXhlci5haS8iLCJhdWQiOiJodHRwczovL2FwaS52aWRlb2luZGV4ZXIuYWkvIn0.MBTlJFb9b4RK2d05anfeYZCGlKwooiy5DghI_ORY2A0EWCpnSlIvuujfA_F2mcooWFGbEtSNNPVTp5XWu6dF2dbAewgLyb22ziHzSvky2p4hVURUYoW-OO8zKWpxehM0QR2mwcqroW4b9Op_PTyw7M5Zd8nVfqi6CWaM-WNoFGsaQX9ePlvrkE_GuiiKOVT1-cJkg7aRqpy_NtOSG-xoGlD30Eb7iNC7xm4gkDCJPcItiuk4sOE9iwINLNnDIMVgY5802H5rsiIisOnx6aaFuaZwSgRanWAvgpTeczRGBYJeS-zunyoLZtWhGhp6NPwhpQdenriD34oleYfwlaObwg) 411
at apisamples.HttpUtils.Utils.VerifyStatus(Utils.java:54)
at apisamples.HttpUtils.Utils.httpStringResponse(Utils.java:48)
at apisamples.VideoIndexerClient.uploadVideo(VideoIndexerClient.java:127)
at apisamples.App.main(App.java:33)

Update player demo

Foundation.Models.and.Tooling_.Satya.Nadella.at.Microsoft.Ignite.2023.mp4

problem with video name max length

Hi,

I'm facing a problem related to Video Indexer v2 connector on Logic Apps. It seems that it's limiting the video name length to around 40 chars however blobs allow up to 256 chars for a blob name (or maybe even more). Is there a way to update / fix this limitation?

Please fix broken links in API Sample Readme [Python]

The readme for Python Sample Projects (aka: https://github.com/Azure-Samples/azure-video-indexer-samples/blob/master/API-Samples/Python/README.md)

Has the following links which lead to 404:
In the first paragraph -
"It is highly recommend to first read the more detailed documentation which can be found [here](https://aka.ms/avam-arm-docs)."

This, found at the end of the page of the same Readme:
For more information visit [here](https://docs.microsoft.com/en-us/azure/media-services/video-indexer/video-indexer-use-apis)

Which is found here on the ReadMe page for

Does the embedding-widgets/azure-media-player still work?

I am looking to build a new front end for some data that is stored in Video Indexer. I would love to do this in the simplest way possible ( ideally without amp )
I tried copying the code from embedding-widgets/azure-media-player and it doesn't work for me. Also the videos on this site: here don't load.

Is there an up to date example that takes a publishedUrl and viewToken and renders the video correctly?

This is what the relevant part of my code looks like

            let myPlayer = amp(videoRef.current, {
                "nativeControlsForTouch": false,
                autoplay: true,
                controls: true,
                width: "640",
                height: "360",
                poster: ""
            }, function () {

                myPlayer.src([{
                    src: url,
                    type: "video/mp4",
                    protectionInfo: [{
                        type: "AES",
                        authenticationToken: token
                    }]
                },], []
                );
                console.log(myPlayer)

            });

and this is the url: https://api.videoindexer.ai/internals/Trial/Accounts/52558e48-2fc8-445c-98f8-6c699cad1092/Videos/e3b5ac413b/streaming-manifest/manifest.m3u8

The error message I see begins like this:
The video playback was aborted due to a corruption problem...

Thanks!

leading silence, project mode, widget starts at 0 instead of first transcript mark.

When a recording has alot of leading silence, the first transcript starts at the start of speaking. My sample recording starts at 50 seconds in. The insights widget starts at 0 for the first transcript entry. So the transcript and video are out of sync by 50 seconds when I select a transcript entry or a part in the video. This is in project scope. The insights widget should start at the first transcript start time, not always 0.

iframe frameBorder

Can you expose the iframe frameBorder property into the IWidgetOptions? Id like to hide the border thats displayed in the widget.

Azure regions not up to date - Embedding widgets from Azure Video Analyzer

I have been trying to use the @azure/video-analyzer-for-media-widgets npm package to render the insights widget in a Web UI, but it hasn't been working.

After a long debugging session, This was the problem. Our AVAM is in westus region, but the npm package hasn't been updated to allow that region yet, and is not logging errors to the console correctly, but instead replacing invalid values with the default of "trial" it seems. This was the error when we found it.

'[{
  "keyword":"enum",
  "dataPath":"/location",
  "schemaPath":"#/properties/location/enum",
  "params":{"allowedValues":[
    "australiaeast",
    "centralindia",
    "eastasia",
    "eastus",
    "eastus2",
    "japaneast",
    "northeurope",
    "southcentralus",
    "southeastasia",
    "switzerlandnorth",
    "switzerlandwest",
    "trial",
    "uksouth",
    "westeurope",
    "westus2"
  ]},
  "message":"should be equal to one of the allowed values"
}]'

Here's where we found it:
edge-debug-image

The widget package itself doesn't seem to be open source; otherwise, I would make a pull request or at least post this there.

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.