From bed2ef86946887a60ef2ec64e17c795310c12e80 Mon Sep 17 00:00:00 2001 From: Tony Qian Date: Thu, 23 Jun 2022 10:18:31 -0600 Subject: [PATCH] Revert "prepare: effectiveProfile to avoid dimensions shorter than 145 pixels (#29)" This reverts commit 364297c96244f4d250642c3ae4c233e167613438. --- task/prepare.go | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/task/prepare.go b/task/prepare.go index 75c90b75..6858e15a 100644 --- a/task/prepare.go +++ b/task/prepare.go @@ -15,8 +15,6 @@ import ( const ( minVideoBitrate = 100_000 absoluteMinVideoBitrate = 5_000 - // NVIDIA cards with Turing architecture enforce a minimum width/height of 145 pixels on transcoded videos - minVideoDimensionPixels = 145 ) var allProfiles = []api.Profile{ @@ -134,11 +132,8 @@ func getPlaybackProfiles(assetVideoSpec *api.AssetVideoSpec) ([]api.Profile, err return nil, fmt.Errorf("no video track found in asset spec") } filtered := make([]api.Profile, 0, len(allProfiles)) - for _, baseProfile := range allProfiles { - profile := effectiveProfile(baseProfile, video) - lowerQualityThanSrc := profile.Height <= video.Height && profile.Bitrate < int(video.Bitrate) - compliesToMinSize := profile.Height >= minVideoDimensionPixels && profile.Width >= minVideoDimensionPixels - if lowerQualityThanSrc && compliesToMinSize { + for _, profile := range allProfiles { + if profile.Height <= video.Height && profile.Bitrate < int(video.Bitrate) { filtered = append(filtered, profile) } } @@ -148,15 +143,6 @@ func getPlaybackProfiles(assetVideoSpec *api.AssetVideoSpec) ([]api.Profile, err return filtered, nil } -func effectiveProfile(profile api.Profile, video *api.AssetTrack) api.Profile { - if video.Width >= video.Height { - profile.Height = profile.Width * video.Height / video.Width - } else { - profile.Width = profile.Height * video.Width / video.Height - } - return profile -} - func lowBitrateProfile(video *api.AssetTrack) api.Profile { bitrate := int(video.Bitrate / 3) if bitrate < minVideoBitrate && video.Bitrate > minVideoBitrate {