Skip to content

[video] video_quality as a replacement for encoding_tier (#303) #472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 88
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-ecba5336919fc9783537b0901d6822cbcb49e160371c348a404bfcc748d09719.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-603174c84ed6d06302f3843b95c5281fa79df1e7428eb8d475525fb27fa48b38.yml
45 changes: 36 additions & 9 deletions src/resources/video/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,10 @@ export interface Asset {
created_at: string;

/**
* The encoding tier informs the cost, quality, and available platform features for
* the asset. By default the `smart` encoding tier is used.
* [See the guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
* @deprecated: This field is deprecated. Please use `video_quality` instead. The
* encoding tier informs the cost, quality, and available platform features for the
* asset. By default the `smart` encoding tier is used.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
encoding_tier: 'smart' | 'baseline';

Expand Down Expand Up @@ -384,6 +385,14 @@ export interface Asset {
* when the asset is created from a direct upload.
*/
upload_id?: string;

/**
* The video quality controls the cost, quality, and available platform features
* for the asset. By default the `plus` video quality is used. This field replaces
* the deprecated `encoding_tier` value.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
video_quality?: 'basic' | 'plus';
}

export namespace Asset {
Expand Down Expand Up @@ -573,9 +582,10 @@ export interface AssetOptions {
advanced_playback_policies?: Array<AssetOptions.AdvancedPlaybackPolicy>;

/**
* The encoding tier informs the cost, quality, and available platform features for
* the asset. By default the `smart` encoding tier is used.
* [See the guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
* @deprecated: This field is deprecated. Please use `video_quality` instead. The
* encoding tier informs the cost, quality, and available platform features for the
* asset. By default the `smart` encoding tier is used.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
encoding_tier?: 'smart' | 'baseline';

Expand Down Expand Up @@ -667,6 +677,14 @@ export interface AssetOptions {
* limited to 10 seconds, deleted after 24 hrs.
*/
test?: boolean;

/**
* The video quality controls the cost, quality, and available platform features
* for the asset. By default the `plus` video quality is used. This field replaces
* the deprecated `encoding_tier` value.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
video_quality?: 'basic' | 'plus';
}

export namespace AssetOptions {
Expand Down Expand Up @@ -1303,9 +1321,10 @@ export interface AssetCreateParams {
advanced_playback_policies?: Array<AssetCreateParams.AdvancedPlaybackPolicy>;

/**
* The encoding tier informs the cost, quality, and available platform features for
* the asset. By default the `smart` encoding tier is used.
* [See the guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
* This field is deprecated. Please use `video_quality` instead. The encoding tier
* informs the cost, quality, and available platform features for the asset. By
* default the `smart` encoding tier is used.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
encoding_tier?: 'smart' | 'baseline';

Expand Down Expand Up @@ -1387,6 +1406,14 @@ export interface AssetCreateParams {
* limited to 10 seconds, deleted after 24 hrs.
*/
test?: boolean;

/**
* The video quality controls the cost, quality, and available platform features
* for the asset. By default the `plus` video quality is used. This field replaces
* the deprecated `encoding_tier` value.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
video_quality?: 'basic' | 'plus';
}

export namespace AssetCreateParams {
Expand Down
10 changes: 9 additions & 1 deletion src/resources/video/delivery-usage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ export interface DeliveryReport {
asset_duration: number;

/**
* @deprecated: This field is deprecated. Please use `asset_video_quality` instead.
* The encoding tier that the asset was ingested at.
* [See the encoding tiers guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
asset_encoding_tier: 'smart' | 'baseline';

Expand Down Expand Up @@ -76,6 +77,13 @@ export interface DeliveryReport {
*/
delivered_seconds_by_resolution: DeliveryReport.DeliveredSecondsByResolution;

/**
* The video quality that the asset was ingested at. This field replaces
* `asset_encoding_tier`.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
asset_video_quality?: 'basic' | 'plus';

/**
* If exists, time at which the asset was deleted. Measured in seconds since the
* Unix epoch.
Expand Down
10 changes: 9 additions & 1 deletion src/resources/webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,9 @@ export namespace VideoDeliveryHighTrafficWebhookEvent {
asset_duration?: number;

/**
* @deprecated: This field is deprecated. Please use `asset_video_quality` instead.
* The encoding tier that the asset was ingested at.
* [See the encoding tiers guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
asset_encoding_tier?: 'smart' | 'baseline';

Expand All @@ -408,6 +409,13 @@ export namespace VideoDeliveryHighTrafficWebhookEvent {
*/
asset_state?: 'ready' | 'errored' | 'deleted';

/**
* The video quality that the asset was ingested at. This field replaces
* `asset_encoding_tier`.
* [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
*/
asset_video_quality?: 'basic' | 'plus';

/**
* Time at which the asset was created. Measured in seconds since the Unix epoch.
*/
Expand Down
1 change: 1 addition & 0 deletions tests/api-resources/video/assets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ describe('resource assets', () => {
per_title_encode: true,
playback_policy: ['public'],
test: true,
video_quality: 'basic',
});
});

Expand Down
1 change: 1 addition & 0 deletions tests/api-resources/video/uploads.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ describe('resource uploads', () => {
per_title_encode: true,
playback_policy: ['public'],
test: true,
video_quality: 'basic',
},
test: true,
timeout: 60,
Expand Down