From c44d0ab339074e61f5b6da48fa0cb8f39bbcda4d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 13 Oct 2020 23:26:07 +0200 Subject: [PATCH] setting offset and duration by seconds is based only on handles --- pype/plugins/global/publish/extract_review.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pype/plugins/global/publish/extract_review.py b/pype/plugins/global/publish/extract_review.py index 4295842f48..c76d205284 100644 --- a/pype/plugins/global/publish/extract_review.py +++ b/pype/plugins/global/publish/extract_review.py @@ -338,10 +338,16 @@ class ExtractReview(pyblish.api.InstancePlugin): "-framerate {}".format(temp_data["fps"]) ) - elif temp_data["without_handles"]: - start_sec = float(temp_data["handle_start"]) / temp_data["fps"] - ffmpeg_input_args.append("-ss {:0.2f}".format(start_sec)) + # Change output's duration and start point if should not contain + # handles + if temp_data["without_handles"] and temp_data["handles_are_set"]: + # Set start time without handles + # - check if handle_start is bigger than 0 to avoid zero division + if temp_data["handle_start"] > 0: + start_sec = float(temp_data["handle_start"]) / temp_data["fps"] + ffmpeg_input_args.append("-ss {:0.2f}".format(start_sec)) + # Set output duration inn seconds duration_sec = float(output_frames_len / temp_data["fps"]) ffmpeg_output_args.append("-t {:0.2f}".format(duration_sec))