Giter VIP home page Giter VIP logo

durable-function-video-to-images-py's Introduction

Azure Durable Functions : Extract frames/images from Video

This application uses Azure Durable functions, Blob Storage, Event Grid and OpenCV-Python

Create Storage Account

Open Azure Cloud Shell and run below commands

az storage account create \
  --name <account-name> \
  --resource-group <resource-group-name> \
  --location westus \
  --sku Standard_RAGRS \
  --kind StorageV2

Crate Blob Containers

# Create container named "uploads", this is where you will post your video files

az storage container create --name uploads --accountname <storage account name from above step>

# Create container named "images", this is where Functions app will extract and uploads images 
az storage container create --name images --accountname <storage account name from above step>

Deploy Function App

To deploy the functions application code please follow these steps Or use VS Code to deploy the application.

Once the app is deployed, add ACCOUNT_NAME and ACCOUNT_KEY in application settings in Configuration for your storage account created above

Create Event Grid Subscription

In this application Event Grid is used to trigger the functions app when a new Video is added to videos blob containers. Before we create event grid subscription we need to get system key. Replace code= with your master key. https://<function-app-name>.azurewebsites.net/admin/host/systemkeys/eventgrid_extension?code=<master-key>

This should result in something like below.

{"name": "eventgrid_extension",
"value": "2aSighjJgTUxhaOaCBN91QA0y5celLfFP1WOKzTasdfdf2THig==",
"links": [{
"rel": "self",
"href": "https://<function-app-name>.azurewebsites.net/admin/host/systemkeys/eventgrid_extension"}]}

Use the value from above as the code=system-key in below set of commands. Open Azure Cloud Shell and execute below commands.

storageName= <storage-account-name>
endpoint='https://<function-app-name>.azurewebsites.net/runtime/webhooks/eventgrid?functionName=blobEGTrigger&code=<system-key>'
resourceGroup=resource-group-name
storageid=$(az storage account show --name $storageName --resource-group $resourceGroup --query id --output tsv)
az eventgrid event-subscription create \
  --source-resource-id $storageid \
  --name vid-to-gif-function-app \
  --endpoint $endpoint \
  --subject-begins-with '/blobServices/default/containers/uploads'

Upload the Videos

Upload a video to "uploads" container in your blob storage account.Wait for couple seconds and you should have a images extracted in "images" blob container.

durable-function-video-to-images-py's People

Watchers

Shrikrishna Khose avatar

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.