예제 #1
0
def submitJob(jobData):
    """Submit the job using the PyOutline API."""
    outline = Outline(jobData['name'],
                      shot=jobData['shot'],
                      show=jobData['show'],
                      user=jobData['username'])
    lastLayer = None
    for layerData in jobData['layers']:
        if layerData.layerType == JobTypes.JobTypes.MAYA:
            layer = buildMayaLayer(layerData, lastLayer)
        elif layerData.layerType == JobTypes.JobTypes.SHELL:
            layer = buildShellLayer(layerData, lastLayer)
        elif layerData.layerType == JobTypes.JobTypes.NUKE:
            layer = buildNukeLayer(layerData, lastLayer)
        elif layerData.layerType == JobTypes.JobTypes.BLENDER:
            layer = buildBlenderLayer(layerData, lastLayer)
        else:
            raise ValueError('unrecognized layer type %s' %
                             layerData.layerType)
        outline.add_layer(layer)
        lastLayer = layer

    if 'facility' in jobData:
        outline.set_facility(jobData['facility'])

    return cuerun.launch(outline, use_pycuerun=False)
예제 #2
0
def main(input_path, fps, crf, chunk, output_path):
    """
    Sends a job to opencue that will compress an image sequence to
    an H.264 file using multiple render nodes in parallel
    :input_path: str - path to the first frame of the image sequence
    :fps: float - framerate of the desired encoded file
    :crf: int - quality of the desired encoded file

    """
    input_path = os.path.abspath(input_path)
    shot_name = os.path.basename(input_path)
    job_name = "dpx_to_mov"
    show_name = "testing"
    user = getpass.getuser()
    outline = Outline(job_name, shot=shot_name, show=show_name, user=user)

    # Create the MakeMov Layer
    layer_name = "seq_to_mov"
    threads = 1.0
    threadable = False
    frame_start, frame_end = get_imgseq_framerange(input_path)
    range_len = int(frame_end) - int(frame_start)
    frame_range = frame_start + "-" + frame_end
    input_path_ffmpeg = translate_imgseq_ffmpeg(input_path)
    output_chunk_path_template = create_chunk_path_template(input_path)

    seqtomov_layer = SeqToMov(layer_name,
                              chunk=chunk,
                              threads=threads,
                              range=frame_range,
                              threadable=threadable,
                              crf=crf,
                              fps=fps)
    seqtomov_layer.add_input("main", input_path_ffmpeg)
    seqtomov_layer.add_output("main", output_chunk_path_template)

    outline.add_layer(seqtomov_layer)

    # Create the ConcatMov Layer
    layer_name = "concat_mov"
    concatmov_layer = ConcatMov(layer_name,
                                chunk=1,
                                threads=threads,
                                range=1,
                                threadable=threadable)
    chunk_paths = get_chunk_paths(output_chunk_path_template, chunk,
                                  frame_start, frame_end)
    for chunk_path in enumerate(chunk_paths):
        concatmov_layer.add_input("", chunk_path)
    concatmov_layer.add_output("main", output_path)
    concatmov_layer.depend_all(seqtomov_layer)

    outline.add_layer(concatmov_layer)

    # Submit job
    cuerun.launch(outline, use_pycuerun=False)
예제 #3
0
def submitJob(jobData):
    """Submit the job using the PyOutline API."""
    outline = Outline(jobData['name'],
                      shot=jobData['shot'],
                      show=jobData['show'],
                      user=jobData['username'])
    for layerData in jobData['layers']:
        if layerData.layerType == JobTypes.JobTypes.MAYA:
            layer = buildMayaLayer(layerData)
        elif layerData.layerType == JobTypes.JobTypes.SHELL:
            layer = buildShellLayer(layerData)
        elif layerData.layerType == JobTypes.JobTypes.NUKE:
            layer = buildNukeLayer(layerData)
        outline.add_layer(layer)
    return cuerun.launch(outline, use_pycuerun=False)
예제 #4
0
from outline import Outline, cuerun

# Create an outline for the job
job_name = "debug_job"
shot_name = "debug_shot"
show_name = "testing"
user = getpass.getuser()

outline = Outline(job_name, shot=shot_name, show=show_name, user=user)

# Create the debug Layer
layer_name = "debug_layer"
chunk_size = 1
threads = 1.0
threadable = False
frame_range = "1"

debug_layer = DebugLayer(layer_name,
                         input="input_path",
                         output="output_path",
                         chunk=chunk_size,
                         threads=threads,
                         range=frame_range,
                         threadable=threadable,
                         crf=25)

outline.add_layer(debug_layer)

# Submit job
cuerun.launch(outline, use_pycuerun=False)
# SUBMIT ############################################################
outline = Outline(jobData['name'],
                  shot=jobData['shot'],
                  show=jobData['show'],
                  user=jobData['username'])
layers = []
for layerData in jobData['layers']:
    layer = Shell(layerData.name,
                  command=layerData.cmd.split(),
                  chunk='1',
                  threads=float(layerData.cores),
                  range=str(layerData.layerRange),
                  threadable=True)
    layer.set_service(layerData.services[0])
    layers.append(layer)

layer_count = 0
for layer in layers:
    if layer_count > 0:
        layer.depend_all(layers[layer_count - 1])
    layer_count += 1
    outline.add_layer(layer)

jobs = cuerun.launch(outline, use_pycuerun=False, pause=True)
for job in jobs:
    print(job.name())
    job.setPriority(10)
    job.setMaxCores(1500)
    job.setMaxRetries(3)
예제 #6
0
input_file = sys.argv[1]
input_path = os.path.abspath(input_file)
shot_name = os.path.basename(input_path)
job_name = "simple_compress"
show_name = "testing"
user = getpass.getuser()

outline = Outline(job_name, shot=shot_name, show=show_name, user=user)

# Create the MakeMov Layer
layer_name = "makemov"
chunk_size = 1
threads = 1.0
threadable = False
frame_range = "1"
output_path = os.path.splitext(input_path)[0] + "_H264.mp4"

makemov_layer = MakeMov(layer_name,
                        chunk=chunk_size,
                        threads=threads,
                        range=frame_range,
                        threadable=threadable,
                        crf=25)
makemov_layer.add_input("main", input_path)
makemov_layer.add_output("main", output_path)

outline.add_layer(makemov_layer)

# Submit job
cuerun.launch(outline, use_pycuerun=False)
예제 #7
0
#!/bin/env python2.5

#  Copyright (c) 2018 Sony Pictures Imageworks Inc.
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.



from outline import Outline, cuerun
from outline.modules.tutorial import HelloModule

ol = Outline("my_job")
ol.add_layer(HelloModule("my_layer"))

cuerun.launch(ol, range="1-10", pause=True)
예제 #8
0
input_file = sys.argv[1]
input_path = os.path.abspath(input_file)
shot_name = os.path.basename(input_path)
ref_file = sys.argv[2]
ref_path = os.path.abspath(ref_file)
job_name = "check_compress"
show_name = "testing"
user = getpass.getuser()

outline = Outline(job_name, shot=shot_name, show=show_name, user=user)

# Create the CheckMov Layer
layer_name = "checkmov"
chunk_size = 1
threads = 1.0
threadable = False
frame_range = "1"

checkmov_layer = CheckMov(layer_name,
                          chunk=chunk_size,
                          threads=threads,
                          range=frame_range,
                          threadable=threadable)
checkmov_layer.add_input("main", input_path)
checkmov_layer.add_input("ref", ref_path)

outline.add_layer(checkmov_layer)

# Submit job
cuerun.launch(outline, use_pycuerun=False)