Skip to content

Commit

Permalink
[doc] add link to EncodingAndPackaging sample
Browse files Browse the repository at this point in the history
  • Loading branch information
pohhsu committed Nov 28, 2023
1 parent c20fa15 commit f6b2cdb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 25 deletions.
54 changes: 30 additions & 24 deletions EncodingAndPackagingExample/README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
Encoding and Packaging Samples
Encoding and Packaging Sample
==

This folder contains sample code about how to encode an MP4 video file into multiple resolution streams and pacakge these streams
to DASH format which is suitable for playback in browser.
## Overview

There are three projects:
This folder contains sample code that demonstrates how to use FFMpeg to encode and package a MP4 video file into multi-stream MPEG-DASH format that's suitable for playback in the browser. The functionality is built into a .NET library, and two sample applications are shown that demonstrates the use the library in a command line tool and in an Azure Function.

* `EncodingAndPackagingTool.Core` contains the code of core functionality.
* `EncodingAndPackagingTool.Cli` contains a standalone command line executable application which will invoke `EncodingAndPackagingTool.Core`.
* `EncodingAndPackagingTool.AzureFunction` contains an Azure Function which can be triggered by a message from azure message queue.
Three projects:

In order to run these samples, user need install [FFmpeg](https://ffmpeg.org/download.html) on the machine. Please follow info in this
[link](https://ffmpeg.org/download.html) to install FFmpeg on yours system and add it to the path of your system.
* `EncodingAndPackagingTool.Core`: library project containing the core functionality of encoding and packaging using FFmpeg.
* `EncodingAndPackagingTool.Cli`: command line executable project that demonstrates how to use the library.
* `EncodingAndPackagingTool.AzureFunction`: Azure Function project that demonstrates how to use the library where the Azure function is triggered by a message from an Azure message queue.

Some installation examples:

- For Ubuntu, you can use the package manager 'apt' which will install and add ffmpeg to your path.
## Prerequisites

```
sudo apt install -y ffmpeg
```
- FFmpeg:

- For Windows 11, you can use 'winget' to install from [gyan.dev](https://www.gyan.dev/ffmpeg/builds/) which will install and add ffmpeg to your path (Note that for windows, after you install, you need to recycle the command prompt windows to get the updated PATH.)
In order to run these samples, user need install [FFmpeg](https://ffmpeg.org/download.html) on the machine. Please follow info in this [link](https://ffmpeg.org/download.html) to install FFmpeg on yours system and add it to the path of your system.

```
winget install ffmpeg
```
Some installation examples:

These samples also Azure Identity library for authentication.
See [here](https://learn.microsoft.com/en-us/dotnet/api/overview/azure/identity-readme?view=azure-dotnet) for various ways to authenticate and the settings needed.
- For Ubuntu, you can use the package manager 'apt' which will install and add ffmpeg to your path.

You'll need to have the following permissions:
```
sudo apt install -y ffmpeg
```

- The identity must have `Reader` role on the MP4 file input container blob.
- The identity must have `Contributor` role on the output container.
- For Windows 11, you can use 'winget' to install from [gyan.dev](https://www.gyan.dev/ffmpeg/builds/) which will install and add ffmpeg to your path (Note that for windows, after you install, you need to recycle the command prompt windows to get the updated PATH.)

If you want to deploy `EncodingAndPackagingTool.AzureFunction` sample in an Azure Function, please following info in this [link](https://learn.microsoft.com/en-us/azure/azure-functions/functions-how-to-custom-container?tabs=core-tools%2Cacr%2Cazure-cli&pivots=azure-functions).
```
winget install ffmpeg
```
- Azure Identity / Permission (for Azure Function)
The sample code uses Azure Identity library for authentication. See [here](https://learn.microsoft.com/en-us/dotnet/api/overview/azure/identity-readme?view=azure-dotnet) for various ways to authenticate and the settings needed.
You'll need to have the following permissions:
- The identity must have `Reader` role on the MP4 file input container blob.
- The identity must have `Contributor` role on the output container.
Please follow the information in this [link](https://learn.microsoft.com/en-us/azure/azure-functions/functions-how-to-custom-container?tabs=core-tools%2Cacr%2Cazure-cli&pivots=azure-functions) for instructions on how to deploy `EncodingAndPackagingTool.AzureFunction` sample to an Azure Function
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ If you encounter any issues or bugs that you'd like to report, please feel free
## List of Samples

- [Azure Media Migration Tool](migrationTool/README.md)
- [Azure Media Services Playback Proxy & ClearKey Delivery Server](PlaybackService/README.md)
- [Azure Media Services Playback Proxy & ClearKey Delivery Server](PlaybackService/README.md)
- [Encoding and Packaging Sample](EncodingAndPackagingExample/README.md)

0 comments on commit f6b2cdb

Please sign in to comment.