diff --git a/ami_scripts/prepend_title_cards.py b/ami_scripts/prepend_title_cards.py index 560df04c..1fa57a67 100755 --- a/ami_scripts/prepend_title_cards.py +++ b/ami_scripts/prepend_title_cards.py @@ -180,6 +180,13 @@ def process_video(video_path, asset_flag): f"scale={width}:{height}", "setsar=10/11", ]) + elif width == 654 and height == 480 and video_stream.get('display_aspect_ratio') == '94:69': + # Check if the video is oddball Telestream DAR video + filters.extend([ + f"scale={width}:{height}", + "setsar=7520/7521", + "setdar=94/69" + ]) else: # For other resolutions, scale as usual filters.extend([ @@ -234,8 +241,8 @@ def process_video(video_path, asset_flag): ffmpeg_concat_cmd = ['ffmpeg', '-y', '-f', 'concat', '-safe', '0', '-i', concat_list, '-c', 'copy', temp_output_path] returncode, stdout, stderr = run_ffmpeg_command(ffmpeg_concat_cmd) - if "Non-monotonous DTS in output stream 0:1" in stderr: - print("Non-monotonous DTS error detected. Attempting alternative concatenation method.") + if "Non-monotonic DTS in output stream 0:1" in stderr or "Non-monotonous DTS in output stream 0:1" in stderr: + print("Non-monotonic DTS error detected. Attempting alternative concatenation method.") # Remove the possibly corrupted file if os.path.exists(temp_output_path):