Skip to content

Commit

Permalink
update prepend
Browse files Browse the repository at this point in the history
  • Loading branch information
bturkus committed Feb 7, 2024
1 parent 65133b1 commit af57b17
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ami_scripts/prepend_title_cards.py
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit af57b17

Please sign in to comment.