Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Update openpype/lib/transcoding.py
Browse files Browse the repository at this point in the history
Co-authored-by: Jakub Trllo <[email protected]>
  • Loading branch information
kalisp and iLLiCiTiT authored Feb 2, 2024
1 parent 76bc191 commit a0f945c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions openpype/lib/transcoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -1355,9 +1355,17 @@ def _get_image_dimensions(application, input_path, log):
"""
# ffmpeg command
input_file_metadata = get_ffprobe_data(input_path, logger=log)
stream = input_file_metadata["streams"][0]
input_width = int(stream["width"])
input_height = int(stream["height"])
input_width = input_height = 0
stream = next(
(
s for s in input_file_metadata["streams"]
if s.get("codec_type") == "video"
),
{}
)
if stream:
input_width = int(stream["width"])
input_height = int(stream["height"])

# fallback for weird files with width=0, height=0
if (input_width == 0 or input_height == 0) and application == "oiiotool":
Expand Down

0 comments on commit a0f945c

Please sign in to comment.