Recording

Create a clip with just video. Viz program output resolution is set to 576i25.

RENDERER*VIDEO*CLIPOUT*1*CONTROL FLUSH
--> wait until the flush has been executed
RENDERER*VIDEO*CLIPOUT*1*CREATE VIDEO_SET 1
RENDERER*VIDEO*CLIPOUT*1*RESOLUTION VIDEO_SET 0 0
RENDERER*VIDEO*CLIPOUT*1*CONTAINER VIDEO_SET AVI
RENDERER*VIDEO*CLIPOUT*1*CODEC VIDEO_SET DvCPro_411
RENDERER*VIDEO*CLIPOUT*1*NAME SET v:/clips/sample
RENDERER*VIDEO*CLIPOUT*1*CONTROL RECORD 100
--> wait until resording has finished 10 RENDERER*VIDEO*CLIPOUT*1*CONTROL FLUSH
  • We start with flushing the channel, CONTROL FLUSH, to have a clean state.

  • Then we tell the clip channel to create the video file, VIDEO_SET 1.

  • The clip resolution should match the output resolution, RESOLUTION VIDEO_SET 0 0.

  • Container is .avi, CONTAINER VIDEO_SET AVI.

  • And codec is dvcpro411, CODEC VIDEO_SET DvCPro_411 the codec requires no further options .

  • Open the clip with NAME SET v:/clips/sample.

  • And record 100 frames, CONTROL RECORD 100 wait until all frames have been recorded.

  • Close the clip, CONTROL FLUSH.

  • The resulting is a clip v:\clips\sample.avi.

Advanced Recording

Create a downscaled clip with video, separate key, audio, VBI and proxy. Viz Engine program output resolution is set to 1080i25.

RENDERER*VIDEO*CLIPOUT*1*CONTROL FLUSH
--> wait until the flush has been executed
RENDERER*VIDEO*CLIPOUT*1*CREATE VIDEO_SET 1
RENDERER*VIDEO*CLIPOUT*1*CREATE KEY_SET 1
RENDERER*VIDEO*CLIPOUT*1*CREATE AUDIO_SET 1
RENDERER*VIDEO*CLIPOUT*1*CREATE VBI_SET 1
RENDERER*VIDEO*CLIPOUT*1*CREATE PROXY_SET 1
RENDERER*VIDEO*CLIPOUT*1*RESOLUTION VIDEO_SET 2 0
RENDERER*VIDEO*CLIPOUT*1*CONTAINER VIDEO_SET XDCAM_MXF
RENDERER*VIDEO*CLIPOUT*1*CODEC VIDEO_SET 27
RENDERER*VIDEO*CLIPOUT*1*CONTAINER AUDIO_SET W64
RENDERER*VIDEO*CLIPOUT*1*CONTAINER VBI_SET AVI
RENDERER*VIDEO*CLIPOUT*1*CODEC VBI_SET YUYV422
RENDERER*VIDEO*CLIPOUT*1*OPTION VIDEO_SET IFRAME bitrate=30 forceDCTFrame=0
RENDERER*VIDEO*CLIPOUT*1*OPTION VIDEO_SET AUDIO ch=8 bits=24/32
RENDERER*VIDEO*CLIPOUT*1*OPTION VIDEO_SET VBI ON
RENDERER*VIDEO*CLIPOUT*1*OPTION VIDEO_SETTCstartTC=11:00:00:00
RENDERER*VIDEO*CLIPOUT*1*RESOLUTION PROXY_SET 0 50
RENDERER*VIDEO*CLIPOUT*1*CONTAINER PROXY_SET QT_MOV
RENDERER*VIDEO*CLIPOUT*1*CODEC PROXY_SET YUYV422
RENDERER*VIDEO*CLIPOUT*1*OPTION PROXY_SET AUDIO ON
RENDERER*VIDEO*CLIPOUT*1*NAME SET v:\clips\advanced
RENDERER*VIDEO*CLIPOUT*1*OPTION PROXY_SET QTCODEC SVQ3
RENDERER*VIDEO*CLIPOUT*1*OPTION PROXY_SET QTVIDEO average_data_rate=0 quality=512
RENDERER*VIDEO*CLIPOUT*1*CONTROL RECORD 1000
--> wait until finished
RENDERER*VIDEO*CLIPOUT*1*CONTROL FLUSH
  • Start with flushing the channel, CONTROL FLUSH, to have a clean state.

  • Tell the clip channel to create the video, key, audio, VBI and proxy files:

    • VIDEO_SET 1

    • KEY_SET 1

    • AUDIO_SET 1

    • VBI_SET 1

    • PROXY_SET 1

  • The resolution should be SD 16:9, RESOLUTION VIDEO_SET 2 0.

  • The video and key files should be D10 files.

    • CONTAINER VIDEO_SET XDCAM_MXF

    • CODEC VIDEO_SET 27

  • Since we want separate audio we need to specify the audio container, CONTAINER AUDIO_SET W64.

  • Same applies for VBI:

    • CONTAINER VBI_SET AVI

    • CODEC VBI_SET YUYV422

  • Set the D10 Iframe options, OPTION VIDEO_SET IFRAME bitrate=30 forceDCTFrame=0.

  • Audio configuration, OPTION VIDEO_SET AUDIO ch=8 bits=24/32.

  • And VBI configuration, OPTION VIDEO_SET VBI ON.

  • The MXF file allows to carry time code information, OPTION VIDEO_SETTCstartTC=11:00:00:00.

This finishes setup of the hires part, next is the proxy configuration.

  • The proxy should be scaled to 50%, RESOLUTION PROXY_SET 0 50.

  • Container is QT mov, CONTAINER PROXY_SET QT_MOV.

  • Codec needs to be set to uncompressed, CODEC PROXY_SET YUYV422.

  • Audio should be included in the proxy, too, OPTION PROXY_SET AUDIO ON.

Before we can setup the proxy QT options we need to open the clips:

  • Open the clip, NAME SET v:/clips/advanced.

  • Then set the proxy QT codec, OPTION PROXY_SET QTCODEC SVQ3.

  • And the proxy QT options, OPTION PROXY_SET QTVIDEO average_data_rate=0 quality=512.

  • Record some frames, CONTROL RECORD 1000 and wait until they are recorded.

  • Close the clip, CONTROL FLUSH.

    The resulting clips are:

    • v:\clips\advanced.d10.mxf (SD 576i with fill)

    • v:\clips\advanced_key.d10.mxf (SD 576i with key)

    • v:\clips\advanced_vbi.avi (HD1080i with VBI)

    • v:\clips\advanced_proxy.mov (proxy with video and audio)

Create Clips with Stage Events Example

This example creates a reference clip and uses stage events to start the recording. It contains various counters and a timecode. It has the capability for audio and video as well. Let’s take a look at each step involved first.

Enable Feedback

FEEDBACK*CLIENT ADD localhost 2001
FEEDBACK*COMMAND ADD localhost 2001 CLIPOUT

At first we enable the feedback channel to send UDP packets to localhost. Now we are ready to initialize the clip channels and the renderer:

Cleanup Clip Out and Clip In Channels

RENDERER*VIDEO*CLIPOUT*1*CONTROL FLUSH
RENDERER*BACK_LAYER*STAGE STOP
RENDERER*MAIN_LAYER*STAGE STOP
RENDERER*FRONT_LAYER*STAGE STOP
RENDERER*VIDEO*CLIPIN*1*CONTROL FLUSH

Flush any clips in the clip in and clip out channel. Since the flush command needs to travel through the ringbuffer we need to wait a few frames until they have been executed.

Cleanup Renderer

RENDERER*BACK_LAYER SET_OBJECT
RENDERER*MAIN_LAYER SET_OBJECT
RENDERER*FRONT_LAYER SET_OBJECT
POOLS CLEANUP

Unload scenes from the renderer and cleanup all pools. We want to start with a fresh environment here.

Set Up Stage Start Event

STAGE_EVENTS*STAGE_START CLEAR
STAGE_EVENTS*STAGE_START ADD "RENDERER*VIDEO*CLIPOUT*1*CONTROL RECORD 5000" -1
STAGE_EVENTS*STAGE_START GET

Enable the Stage Start event to trigger the record command on the clip out channel.

Load Scenes And Set Audio And Video Clips

<! - - load background scene -->
SCENE*Vizrt_Research_Developement/Reference/TC/bg LOAD
SCENE*Vizrt_Research_Developement/Reference/TC/bg*STAGE*DIRECTOR*Director*KEY*$audioclip*CLIP SET "<11EBC981-11A3-45C7-A78545119738FC68>"
SCENE*Vizrt_Research_Developement/Reference/TC/bg*VIDEO*CLIPIN*1*TARGET SET DVE
SCENE*Vizrt_Research_Developement/Reference/TC/bg*STAGE*DIRECTOR*Director*KEY*$videoclip*CLIPNAME SET "e:/out/1080_bgclip.m4v"
SCENE*Vizrt_Research_Developement/Reference/TC/bg*STAGE*DIRECTOR*Director*KEY*$videoclip*START SET "00:00:00:00"
SCENE*Vizrt_Research_Developement/Reference/TC/TC_DISPLAY LOAD

This loads the background scene, and sets the audio clip and the video clip. The scene for the main layer is also loaded here.

Cue Scenes

SCENE*Vizrt_Research_Developement/Reference/TC/bg CUE
SCENE*Vizrt_Research_Developement/Reference/TC/TC_DISPLAY CUE

Both scenes are cued. This is required for frame accurate clip playback.

Load Scenes Into Renderer

RENDERER*BACK_LAYER SET_OBJECT Vizrt_Research_Developement/Reference/TC/bg
RENDERER*MAIN_LAYER SET_OBJECT Vizrt_Research_Developement/Reference/TC/TC_DISPLAY

The scenes are loaded into the back layer and main layer.

Reset Animation Timelines

RENDERER*BACK_LAYER*STAGE SHOW 0.0
RENDERER*MAIN_LAYER*STAGE SHOW 0.0

The timelines for back and main layers are reset to zero. Now we are ready to configure the clip out channel.

Configure Clip Out Channel

RENDERER*MAIN_LAYER*TREE*$UserData$Label*GEOM*TEXT SET 1080i XDCAM_MXF422, Audio=8 ch
RENDERER*VIDEO*CLIPOUT*1*CREATE VIDEO_SET On
RENDERER*VIDEO*CLIPOUT*1*RESOLUTION VIDEO_SET 0 0
RENDERER*VIDEO*CLIPOUT*1*CONTAINER VIDEO_SET XDCAM_MXF
RENDERER*VIDEO*CLIPOUT*1*CODEC VIDEO_SET 22
RENDERER*VIDEO*CLIPOUT*1*OPTION VIDEO_SET AUDIO ch=8
RENDERER*VIDEO*CLIPOUT*1*NAME SET "d:/1080i_3in" 5.0

The first line sets a text container in the main layer with some descriptive information. The following lines configure the clip out channel and on the last line open the clip.

Start The Animation

RENDERER*BACK_LAYER*STAGE START
RENDERER*MAIN_LAYER*STAGE START

This starts the animation on both layers. The stage start event trigger fires and the recording starts.

Close Clip

After the recording of the predetermined number of frames has been finished (can be observed on the feedback channel) we close the clip:

RENDERER*VIDEO*CLIPOUT*1*CONTROL FLUSH

We have now recorded a clip with 5000 frames in XDCAMHD422 format in an MXF container.

Render a Playlist

Recent additions to Viz Artist ease rendering a complete playlist into separate clips. This example guides through those new features. First we need to prepare some steps in the configuration file.

Default Profile

First, we create default profile that we can load with a single command. In This profile we make use of the placeholders for the name of the clip. This is under the section CHANNELS_CONFIG in the configuration file.

# the <self> placeholder gets replaced with the proper RENDERER*VIDEO*CLIPOUT*1
ClipOut1.profile.default_1=<self>*CREATE VIDEO_SET On
ClipOut1.profile.default_2=<self>*RESOLUTION VIDEO_SET 0 0
ClipOut1.profile.default_3=<self>*CONTAINER VIDEO_SET XDCAM_MXF
ClipOut1.profile.default_4=<self>*CODEC VIDEO_SET 22*
ClipOut1.profile.default_5=<self>*OPTION VIDEO_SET AUDIO ch=8
ClipOut1.profile.default_6=<self>*OPTION VIDEO_SET TC startTC=10:00:00:00
# we make use of three placeholders.one is the clip root.the others are
# for the scene name to be set and clip placeholder name itself
# that gets set with RENDERER*VIDEO*CLIPOUT*1*NAME PLACEHOLDER_SET
ClipOut1.profile.default_7=<self>*NAME SET <clip_root> playlist/<base_scene2_name>/<clip_name>

Scene Load Interceptor

The profile that we created in the previous section should always be applied when we change the scene. To be more specific we want it to be applied right before when a scene gets loaded into the render editor but before it is actually loaded. We make use of the command injector on the scene load interceptor on the MAIN_LAYER.

RENDERER*MAIN_LAYER CLEAR_INJECT_BEFORE
RENDERER*MAIN_LAYER ADD_INJECT_BEFORE "RENDERER*VIDEO*CLIPOUT*1*PROFILE APPLY" -1

Stage Interceptors

The Stage events have been already introduced above. Here we make use of them again but this time bound only onto the MAIN_LAYER. When the animation starts then an infinite record command is set to the clip out channel. When the animation stops the clip is flushed and hence properly closed.

STAGE_EVENTS*LAYER_STAGE_START CLEAR MAIN_LAYER
STAGE_EVENTS*LAYER_STAGE_STOP CLEAR MAIN_LAYER
STAGE_EVENTS*LAYER_STAGE_START ADD MAIN_LAYER "RENDERER*VIDEO*CLIPOUT*1*CONTROL RECORD 0" -1
STAGE_EVENTS*LAYER_STAGE_STOP ADD MAIN_LAYER "RENDERER*VIDEO*CLIPOUT*1*CONTROL FLUSH " -1

Startup Commands

The Interceptors are not part of a scene or the configuration file. They need to be applied once. So we just bundle them together in the startup commands section together with the activation of the feedback channel. The feedback channel commands make only sense if the controlling application resides on the localhost. Otherwise, replace localhost with the name of the host where the UDP feedback should be directed at or leave them out of the startup commands.

# scene load interceptor
StartupCommands_1= RENDERER*MAIN_LAYER CLEAR_INJECT_BEFORE
StartupCommands_2= RENDERER*MAIN_LAYER ADD_INJECT_BEFORE "RENDERER*VIDEO*CLIPOUT*1*PROFILE APPLY" -1
# stage main layer interceptor
StartupCommands_3= STAGE_EVENTS*LAYER_STAGE_START CLEAR MAIN_LAYER
StartupCommands_4= STAGE_EVENTS*LAYER_STAGE_STOP CLEAR MAIN_LAYER
StartupCommands_5= STAGE_EVENTS*LAYER_STAGE_START ADD MAIN_LAYER "RENDERER*VIDEO*CLIPOUT*1*CONTROL RECORD 0" -1
StartupCommands_6= STAGE_EVENTS*LAYER_STAGE_STOP ADD MAIN_LAYER "RENDERER*VIDEO*CLIPOUT*1*CONTROL FLUSH " -1
# feedback channel
StartupCommands_7= FEEDBACK*CLIENT ADD localhost 2001
StartupCommands_8= FEEDBACK*COMMAND ADD localhost 2001 CLIPOUT

Ready to Render The Playlist

Load the scenes into Viz Engine and cue them.

SCENE*Vizrt_RD*/tmp/n1 LOAD
SCENE*Vizrt_RD*/tmp/n1 CUE
SCENE*Vizrt_RD*/tmp/n1*STAGE SHOW 0.0
SCENE*Vizrt_RD*/tmp/n2 LOAD
SCENE*Vizrt_RD*/tmp/n2 CUE
SCENE*Vizrt_RD*/tmp/n2*STAGE SHOW 0.0
SCENE*Vizrt_RD*/tmp/n3 LOAD
SCENE*Vizrt_RD*/tmp/n3 CUE
SCENE*Vizrt_RD*/tmp/n3*STAGE SHOW 0.0

After that the scenes are ready to be put into the render editor. Now let’s set the placeholder for the clipname and render the first clip.

RENDERER*VIDEO*CLIPOUT*1*NAME PLACEHOLDER_SET "heidi_1"
SCENE*Vizrt_RD/tmp/n1*STAGE SHOW 0.0
RENDERER*MAIN_LAYER SET_OBJECT Vizrt_RD/tmp/n1

This triggers the scene load command injector that executes the RENDERER*VIDEO*CLIPOUT*1*PROFILE APPLY which in turn loads the profile and applies it to the clip out channel.

RENDERER*VIDEO*CLIPOUT*1*CREATE VIDEO_SET On
RENDERER*VIDEO*CLIPOUT*1*RESOLUTION VIDEO_SET 0 0
RENDERER*VIDEO*CLIPOUT*1*CONTAINER VIDEO_SET XDCAM_MXF
RENDERER*VIDEO*CLIPOUT*1*CODEC VIDEO_SET 22
RENDERER*VIDEO*CLIPOUT*1*OPTION VIDEO_SET AUDIO ch=8
RENDERER*VIDEO*CLIPOUT*1*OPTION VIDEO_SET TC startTC=10:00:00:00
RENDERER*VIDEO*CLIPOUT*1*NAME SET <clip_root>playlist/<base_scene2_name>/<clip_name>

assuming that is set v:/clips/out/, then the clip name is expanded to v:/clips/out/playlist/n1/heidi_1.xdcamHD422.mxf. The next step is to start the animation. This triggers the stage start command injector.

RENDERER*MAIN_LAYER*STAGE START

Which, in turn, triggers the stage start command injector.

RENDERER*VIDEO*CLIPOUT*1*CONTROL RECORD 0

Now the controlling application watches the feedback channel it subscribed to before:

CLIPOUT [0] OPEN CLIP=’v:/clips/out/playlist/n1/heidi_1’ VIDEO=1 (v:/clips/out/playlist/n1/heidi_1.xdcamHD422.mxf,,) AUDIO=1 () VBI=0 () TC=0
CLIPOUT [0] START REQ=0
CLIPOUT [0] WRITE REC=64 TOT=64
CLIPOUT [0] WRITE REC=128 TOT=128
CLIPOUT [0] WRITE REC=192 TOT=192
CLIPOUT [0] WRITE REC=256 TOT=256
CLIPOUT [0] WRITE REC=320 TOT=320
CLIPOUT [0] WRITE REC=384 TOT=384
CLIPOUT [0] WRITE REC=448 TOT=448
CLIPOUT [0] WRITE REC=512 TOT=512
CLIPOUT [0] STOP CLIP= ’v:/clips/out/playlist/n1/heidi_1’ REC=550 TOT=550 CLIPOUT [0]
FLUSH CLIP=’v:/clips/out/playlist/n1/heidi_1’ TOT=550

as we can see in the feedback messages there are also STOP and FLUSH commands. Once the animation stops the stage stop command injector kicks in.

RENDERER*VIDEO*CLIPOUT*1*CONTROL FLUSH 0

This command stops and flushes the clip. Now we can repeat with rendering the next clip until the playlist is completed.