FastPix C# SDK

Learn how to use FastPix C# SDK to build video apps with media upload, live stream, and playback.

Add secure, scalable video to your .NET project

The FastPix C# SDK gives you everything you need to manage video from your backend. Upload files from a public URL, attach metadata, and retrieve playback links, all without building encoding pipelines or managing storage. With this SDK, you can:

  • Upload and organize video assets
  • Define access control and metadata
  • Generate HLS playback URLs
  • Streamline video delivery from your .NET server

Find more in the SDK reference

To explore more examples, API methods, and advanced usage, see the FastPix C# SDK on GitHub.


Prerequisites

Before you start using the SDK, make sure you have the following:

  • .NET 8.0 or later: This SDK is compatible with .NET 8.0 or higher
  • Visual Studio 2022 or VS Code: Recommended IDE for C# development
  • NuGet Package Manager: Required for package management
  • FastPix API credentials: You’ll need an Access Token and a Secret Key. You can generate these credentials by following the steps in the Authentication guide
  • Basic understanding of C# and REST APIs: Familiarity with C# development and API integration concepts

Installation

Install the SDK using NuGet Package Manager Console:

$Install-Package Fastpix

Or using .NET CLI:

$dotnet add package Fastpix

Local Reference

To add a reference to a local instance of the SDK in a .NET project:

$dotnet add reference src/Fastpix/Fastpix.csproj

Import the SDK

1using Fastpix;
2using Fastpix.Models.Components;
3using Fastpix.Models.Requests;
4using System.Collections.Generic;

Example

Let’s create a file named Program.cs

This example shows how to upload a video from a public URL with metadata and public access:

NOTE
In the following example, replace your-access-token and your-secret-key with the Access Token ID and Secret Key values from the .env file you downloaded.

1using Fastpix;
2using Fastpix.Models.Components;
3using System.Collections.Generic;
4
5var sdk = new FastpixSDK(security: new Security() {
6 Username = "your-access-token",
7 Password = "your-secret-key",
8});
9
10var req = new CreateMediaRequest() {
11 Inputs = new List<Fastpix.Models.Components.Input>() {
12 Fastpix.Models.Components.Input.CreatePullVideoInput(
13 new PullVideoInput() {}
14 ),
15 },
16 Metadata = new Dictionary<string, string>() {
17 { "<key>", "<value>" },
18 },
19};
20
21var res = await sdk.InputVideo.CreateMediaAsync(req);
22
23// handle response

After the video is processed, you can use the media ID to fetch playback info, monitor status, or transform content through the API.


Run the example

To execute the C# program, use the following command. Make sure to replace Program.cs with your actual file name if it’s different:

$dotnet run

NOTE
Some methods might throw errors when you are on a trial plan.


Release notes

For a complete history of releases, improvements, and fixes, see the FastPix C# SDK CHANGELOG on GitHub.