From 9ba4c8ef666e26a477ad84270bbc601f38819bb2 Mon Sep 17 00:00:00 2001 From: Jeong Arm Date: Tue, 10 Dec 2024 23:47:42 -0500 Subject: [PATCH] Handle rotation is not present in the video metadata (#33261) --- app/lib/video_metadata_extractor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/video_metadata_extractor.rb b/app/lib/video_metadata_extractor.rb index fda6405121..6e544486d6 100644 --- a/app/lib/video_metadata_extractor.rb +++ b/app/lib/video_metadata_extractor.rb @@ -48,7 +48,7 @@ class VideoMetadataExtractor @frame_rate ||= @r_frame_rate # If the video has not been re-encoded by ffmpeg, it may contain rotation information, # and we need to simulate applying it to the dimensions - @width, @height = @height, @width if video_stream[:side_data_list]&.any? { |x| x[:rotation].abs == 90 } + @width, @height = @height, @width if video_stream[:side_data_list]&.any? { |x| x[:rotation]&.abs == 90 } end if (audio_stream = audio_streams.first)