Stuka - music video creator for studio recording sessions
v1.0.9 by arnaud sintès & nicolas combe



[home] [using Stuka] [scripting 1/2] [scripting 2/2] [download]



scripting Stuka (2/2)
overlay( 8mm, 100 ) {
    capture( 17, 26, 692, 448 );
}

marker( 4, 1top_3bottom ) {
    display( "gh1" );
    display( "et1" );
    display( "et2" );
..


You can use an input video as a global overlay for the whole output video frame:
overlay( iid, frame_count ) {
    capture( left, top, right, bottom );
}

  • iid is the id of an input, previously defined with an "input() {}" statement
  • frame_count is the number of frame to capture to make the overlay loop (relative to 25fps playback)
  • capture( left, top, right, bottom ); [optional] allows you to capture a certain part of the video, by default the whole input frame is captured and resized to match the output dimensions.
    Values are set in pixel unit.

    The overlay video is a cool feature allowing you, for example, to superimpose some old 8mm video over all your videos, as seen in the sample image above or in the demo video on the main page.



    The most important part of the script is the set of markers:
    marker( position, layout ) {}

  • position is the index position of the marker relative to the master timeline
  • layout [optional] determine the layout type to organize the video display

    The marker position can be directly extracted from your audio sequencer.

    For example a minimum marker list may be:
    marker( 1, 1fullscreen ) {
        tempo( 75 );
        signature( 4, 4 );
        display( arnaud_front );
    }

    marker( 2 ) {}
    Which means that we will have a single measure of 4/4 at 75bpm.



    The layout is only optional to determine the last marker of the list (which has to be empty).
    For all other markers, layout is mandatory and values can be:

    1fullscreen 1left_1right 1top_1bottom 1left_2right 2left_1right

    1top_2bottom 2top_1bottom 2top_2bottom 1top_3bottom 3top_1bottom

    2top_3bottom 3top_2bottom 3top_3bottom

    For example, if you choose the layout "1top_2bottom", it means that the first display unit will be visible on top, the second one at bottom-left and the third one at bottom-right.


    As we've briefly seen before, we can add a lot of commands into the marker:
    marker( position, layout ) {
        tempo( t );
        signature( bc, bu );
        separator( size );

        effect( type );

        display( "iid or gid", cycle );
        resize( "iid or gid", size_in_percent );
        speed( "iid or gid", speed_ratio );
    }

  • tempo( t ); [optional] indicates the tempo in beats per minute of the current marker and the following ones, until another tempo command is encountered.

  • signature( bc, bu ); [optional] indicates the time signature as beat_count / beat_unit
    of the current marker and the following ones, until another signature command is encountered.

  • separator( size ); [optional] set the viewport separator size for the current marker and the following ones, until another separator command is encountered.
    By default the separator size is 0 (no separator).
    The separator is a line with a black brush.



  • effect( type ); [optional] set a global effect for the current marker.
    Values can be "fade_in" or "fade_out" to perform some global fading operations,
    or "strobe, cycle" to perform some stroboscope effect (see "display" for "cycle" values).


  • display( "iid or gid", cycle ); set an ordered (relative to layout viewport numeration) input video frame into the marker, by using an input video ID or an input group ID.
    if cycle [optional] is set, a rotation is performed between all the input videos of the group.

    cycle value can be "none", "each_measure", "each_beat", "every_2_beats", "every_3_beats", "every_half_beat", "every_quarter_beat" or "every_eighth_beat"

  • resize( "iid or gid", size_in_percent ); allows the user to temporary resize the video frame of a given input video or group, by setting a zoom ratio in %.
    e.g. resize( arnaud_front, 50 ); will perform a x2 zoom onto the image.

  • speed( "iid or gid", speed_ratio ); allows the user to temporary change the playback speed ratio of a video.
    e.g. speed( arnaud_front, 0.25 ); will do a smart 1/4 speed stop effect.



    tempo and signature commands are mandatory on the first marker of the list.
    You must set at least a display command in the marker, except for the end marker.



    You can also add some comments into your script, C++ styled :
    // hello world