Skip to main content

Stream Manipulator

The Stream Manipulator is a powerful tool for modifying video files, such as .m3u8 files. It allows you to filter video qualities, create custom playlists, and easily manage your streaming content.

How It Works​

The Stream Manipulator works by downloading a video file and modifying it based on your preferences. Here's what it can do:

  • Include specific qualities: Keep only the video qualities you choose (e.g., 360p, 720p).

  • Keep qualities above a certain resolution: Retain only video qualities at or above a specified resolution (e.g., 480p and higher).

  • Keep qualities below a certain resolution: Retain only video qualities at or below a specified resolution (e.g., 480p and lower).

  • Keeping Only Audio Qualities Optionally retain only audio qualities by setting audioOnly=true

Once the file is manipulated, the service saves it to a temporary location and provides the path to the updated file.

Manipulate a File​

This feature allows you to adjust a video file according to your desired preferences.

How to use it?​

  • To manipulate a file, follow these steps:
  1. Provide the projectId: This is your project’s unique identifier.
  2. Provide the videoId: This is the unique ID of the video you’re working with.
  3. Choose the type of manipulation:
  • SpecificQualities: Keep only the qualities you specify.
  • Above: Keep qualities that are at or above a specific resolution.
  • Below: Keep qualities that are at or below a specific resolution.
  • AudioOnly: Set to true or false to determine whether to retrieve audio qualities only.

Examples​

1. Keeping Specific Qualities

  • Let’s say you only want qualities like 360 and 720, you can specify them in the request.
  • After providing the necessary parameters,the resulting file path will look like this:
https://cdn.vpplayer.tech/{projectId}/encode/{videoId}/hls/master_file_transformed
.m3u8?qualities=360,720

2. Keeping Qualities Above

  • If you want to keep qualities above 480p, you can define this in the request.
  • After providing the necessary parameters, the resulting file path will look like this
https://cdn.vpplayer.tech/{projectId}/encode/{videoId}/hls/master_file_transformed
.m3u8?above=720

3. Keeping Qualities Below

  • If you want to keep qualities below 720p, you can define this in the request.
  • After providing the necessary parameters, the resulting file path will look like this
https://cdn.vpplayer.tech/{projectId}/encode/{videoId}/hls/master_file_transformed
.m3u8?below=720

4. Keeping Only Audio Qualities

  • If you want to retrieve only the audio qualities, you can set the audioOnly property to true.
  • After providing the necessary parameters, the resulting file path will look like this
https://cdn.vpplayer.tech/{projectId}/encode/{videoId}/hls/master_file_transformed
.m3u8?audioOnly=true
Token Authentication

If your project uses token authentication, the base URL changes slightly to include the token:

https://cdn.vpplayer.tech/{projectId}/{token}/encode/{videoId}/hls/master_file_transformed.m3u8

Here, {token} refers to the same token generated for video asset access.

For more information on how to generate the token, refer to the secure token documentation here.