Refactor transcoding.py to fix sample aspect ratio parsing

The code change fixes an issue in the transcoding.py file where the sample aspect ratio was not being parsed correctly. The fix involves modifying the way the sample aspect ratio is accessed from the stream object.
This commit is contained in:
Jakub Jezek 2023-12-06 15:24:19 +01:00
parent 8cf109340b
commit 54205db222
No known key found for this signature in database
GPG key ID: 730D7C02726179A7

View file

@ -1262,7 +1262,7 @@ def get_rescaled_command_arguments(
stream = input_file_metadata["streams"][0]
input_width = int(stream["width"])
input_height = int(stream["height"])
stream_input_par = stream[0].get("sample_aspect_ratio")
stream_input_par = stream.get("sample_aspect_ratio")
if stream_input_par:
input_par = (
float(stream_input_par.split(":")[0])