GithubHelp home page GithubHelp logo

isabella232 / media-services-v3-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azure-samples/media-services-v3-python

0.0 0.0 0.0 89.79 MB

Python samples for Media Services v3

License: MIT License

Shell 39.24% Python 60.76%

media-services-v3-python's Introduction

Azure Media Services v3 Python Samples

Use this set of samples to get started with Azure Media Service v3 and Python.

NOTE Owned and maintained by Microsoft. Please do not push changes directly to this repo. Please fork the repo and set it as upstream and your own fork as origin. See the CONTRIBUTING.md file for more details.

Samples

Sample Description
Basic encoding Basic example for uploading a local file or encoding from a source URL. Sample shows how to use storage SDK to download content, and shows how to stream to a player
Encoding with Overlay Example for adding Overlay image (watermark) to a video. Sample shows how to encode a local video file adding local overlay image to it using custom transform
Face Redaction using events and functions This is an example of an event-based approach that triggers an Azure Media Services Face Redactor job on a video as soon as it lands on an Azure Storage Account. It leverages Azure Media Services, Azure Function, Event Grid and Azure Storage for the solution. For the full description of the solution, see the README.md

Getting Started

Prerequisites

  • If you don't have an Azure subscription, create a free account before you begin.
  • Create a resource group to use with these samples.
  • Install Python 3.x

Use Python virtual environments

For every sample, we recommend that you always create and activate a virtual environment using the following steps:

  1. Open the sample folder in VSCode or other editor
  2. Create the virtual environment
# py -3 uses the global python interpreter. You can also use python -m venv .venv.
py -3 -m venv .venv

This command runs the Python venv module and creates a virtual environment in a folder named .venv.

  1. Activate the virtual environment:
.venv\scripts\activate

A virtual environment is a folder within a project that isolates a copy of a specific Python interpreter. Once you activate that environment (which Visual Studio Code does automatically), running pip install installs a library into that environment only. When you then run your Python code, it runs in the environment's exact context with specific versions of every library. And when you run pip freeze, you get the exact list of the those libraries. (In many of the samples, you create a requirements.txt file for the libraries you need, then use pip install -r requirements.txt. A requirements file is generally needed when you deploy code to Azure.)

Installation

Set up and configure your local Python dev environment for Azure

Install the azure-identity library for Python. This module is needed for Azure Active Directory authentication. See the details at Azure Identity client library for Python

pip install azure-identity

Install the Python SDK for Azure Media Services

The Pypi page for the Media Services Python SDK with latest version details is located at - azure-mgmt-media

pip install azure-mgmt-media

Install the Azure Storage SDK for Python

pip install azure-storage-blob

You can optionally install ALL of the requirements for a given samples by using the "requirements.txt" file in the samples folder

pip install -r requirements.txt

You can also use pip to uninstall libraries and install specific versions, including preview versions. For more information, see How to install Azure library packages for Python.

Create the .env file

Copy the contents from the sample.env file that is in your forked repo in the root folder. Then, create your own .env file by clicking on Add file -> Create new file. Name the file .env and fill in the variables.

Do not allow this .env file to be checked into your fork of the GitHub repository! This is disallowed in the .gitignore file, but be extra careful not to allow the credentials to leak into your source control for this file.

All samples will load the root ".env" file first, and some of the samples add additional .env variables needed for the samples to work inside each sample folder. Make sure to check each sample for additional environment settings that are required.

Resources

media-services-v3-python's People

Contributors

dedvds avatar harmke avatar haroldasai avatar hyoshioka0128 avatar ingridatmicrosoft avatar microsoft-github-operations[bot] avatar microsoftopensource avatar nikkiconley avatar sanjayprajapatims 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.