mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
feat(ps): audio main to version 1 only and fixing 0.5 frame offset
This commit is contained in:
parent
68f72aa4a9
commit
059a0c6ae0
2 changed files with 25 additions and 8 deletions
|
|
@ -25,7 +25,8 @@ class CollectClipInstances(pyblish.api.InstancePlugin):
|
|||
"family": "audio",
|
||||
"families": ["ftrack"],
|
||||
"ftrackFamily": "audio",
|
||||
"extension": ".wav"
|
||||
"extension": ".wav",
|
||||
"version": 1
|
||||
},
|
||||
"shotMain": {
|
||||
"family": "shot",
|
||||
|
|
@ -109,7 +110,7 @@ class CollectClipInstances(pyblish.api.InstancePlugin):
|
|||
clip_in += self.timeline_frame_offset
|
||||
clip_out += self.timeline_frame_offset
|
||||
|
||||
clip_duration = clip.duration().value - 1
|
||||
clip_duration = clip.duration().value
|
||||
self.log.info(f"clip duration: {clip_duration}")
|
||||
|
||||
source_in = clip.trimmed_range().start_time.value
|
||||
|
|
@ -126,7 +127,7 @@ class CollectClipInstances(pyblish.api.InstancePlugin):
|
|||
else:
|
||||
frame_start = clip_in
|
||||
|
||||
frame_end = frame_start + clip_duration
|
||||
frame_end = frame_start + (clip_duration - 1)
|
||||
|
||||
# create shared new instance data
|
||||
instance_data = {
|
||||
|
|
|
|||
|
|
@ -42,15 +42,31 @@ class ExtractShotData(pype.api.Extractor):
|
|||
# input_data = plib.ffprobe_streams(video_file_path)[0]
|
||||
# self.log.debug(f"__ input_data: `{input_data}`")
|
||||
|
||||
start = float(instance.data["clipInH"])
|
||||
dur = float(instance.data["clipDurationH"])
|
||||
|
||||
if ext in ".wav":
|
||||
start += 0.5
|
||||
dur += 0.5
|
||||
|
||||
args = [
|
||||
ffmpeg_path,
|
||||
"-ss", str(instance.data["clipInH"] / fps),
|
||||
"-ss", str(start / fps),
|
||||
"-i", video_file_path,
|
||||
"-t", str(instance.data["clipDurationH"] / fps),
|
||||
"-crf", "18",
|
||||
"-pix_fmt", "yuv420p",
|
||||
clip_trimed_path
|
||||
"-t", str(dur / fps)
|
||||
]
|
||||
if ext in [".mov", ".mp4"]:
|
||||
args.extend([
|
||||
"-crf", "18",
|
||||
"-pix_fmt", "yuv420p"])
|
||||
elif ext in ".wav":
|
||||
args.extend([
|
||||
"-vn -acodec pcm_s16le",
|
||||
"-ar 44100 -ac 2"])
|
||||
|
||||
# add output path
|
||||
args.append(clip_trimed_path)
|
||||
|
||||
self.log.info(f"Processing: {args}")
|
||||
ffmpeg_args = " ".join(args)
|
||||
output = pype.api.subprocess(ffmpeg_args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue