From abc70685fa05bacf6c51ed5593041ecfa40f2616 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 22 Oct 2020 14:54:16 +0200 Subject: [PATCH] fix(hiero): cutup source audio video clip differently then nonaudio one frame difference issue --- pype/plugins/hiero/publish/extract_review_cutup.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pype/plugins/hiero/publish/extract_review_cutup.py b/pype/plugins/hiero/publish/extract_review_cutup.py index 57ec6c1107..88b19b7ec8 100644 --- a/pype/plugins/hiero/publish/extract_review_cutup.py +++ b/pype/plugins/hiero/publish/extract_review_cutup.py @@ -133,14 +133,24 @@ class ExtractReviewCutUp(pype.api.Extractor): "{ffprobe_path} -i \"{full_input_path}\" -show_streams " "-select_streams a -loglevel error" ).format(**locals()) + self.log.debug("ffprob_cmd: {}".format(ffprob_cmd)) audio_check_output = pype.api.subprocess(ffprob_cmd) self.log.debug( "audio_check_output: {}".format(audio_check_output)) + # Fix one frame difference + """ TODO: this is just work-around for issue: + https://github.com/pypeclub/pype/issues/659 + """ + frame_duration_extend = 1 + if audio_check_output: + frame_duration_extend = 0 + # translate frame to sec start_sec = float(frame_start) / fps - duration_sec = float(frame_end - frame_start + 1) / fps + duration_sec = float( + (frame_end - frame_start) + frame_duration_extend) / fps empty_add = None