MovieCreator

MLModule
author MeVis Medical Solutions AG
package MeVisLab/Standard
dll MLMovieCreator
definition MLMovieCreator.def
see also SoExaminerViewer
keywords movie, compression, avi, mov, quicktime

Purpose

The MovieCreator module can collect an arbitrary number of images via its image input and compress then into an AVI on Windows and a QuickTime Movie on macOS. The movie is compressed by a user-selectable compression algorithm and is written onto disk.

Usage

Choose a filename, a suitable compression algorithm and provide the module’s image input with an ML image. This image must have a z-extend of one, say it must be one slice. The datatype of the image must be MLuint8 or a compatible. The image may be a greyvalue image or a colored one with three or four color channels (RGB or RGBA). If the image is of the latter type (RGBA), the fourth alpha channel is simply ignored. Also, the input image’s width and height must be a multiple of four on Windows. This is due to the usage of the Windows vfw-API. These size constrains do not apply to macOS. In addition, the image extends must not vary while recording or those particular frames are being ignored.

If the module’s ‘Enable recording’ is checked, any image input change (or notification) triggers the module to record a frame, which is immediately inserted into the movie. To finish a recording, press ‘Finish Movie’, in order to cancel a recording, press ‘Reset Recording’.

On the Codec-tab, there is an information field which displays the registered, available compression codecs on the current system. All codecs have unique identifiers consisting of four letters. Note that some of the displayed codecs on Windows are ‘Read only’ codecs, which means that one can play a movie that is compressed with a certain codec (in other words: the codec may be used for decompression), but this codec cannot be used for compressing images to a movie. In this case an error message is displayed in the status field and a default codec is chosen instead. On macOS only valid compression codecs are displayed.

Details

The MovieCreator makes use of the Windows vfw-API, where vfw stands for VideoForWindows. On macOS, the module uses Apple’s Audio Video Foundation. Currently, the module is not supported on Linux.

Input Fields

The input image must have a height and width which are multiples of four (4) on Windows. The extend in z-dimension must be 1 (a single slice). The datatype of the input image must be MLuint8 or compatible. The color dimension can be 1 which results into a greyvalue movie. Or, the color dimension can have an extend of 3 or more, where the first three entries are interpreted as RGB values.

input0

name: input0, type: Image

Parameter Fields

Field Index

Available Codecs: String Status: String
Codec: String  
Enable recording: Bool  
Finish Movie: Trigger  
FPS: Integer  
Num. Frames: Integer  
Output Filename: String  
Reset Recording: Trigger  

Visible Fields

Enable recording

name: enableRecording, type: Bool, default: FALSE

If checked, all valid new images connected to the module’s image input will be recorded. The frames are added on-the-fly to the current movie. If unchecked, the module is set to passive stance and no frames are recorded.

Output Filename

name: outputFilename, type: String

The name of the output file. This must be specified before a recording is started.

Codec

name: codecCode, type: String, default: cvid

The used compression codec. Here a codec code consisting of four letters (e.g. avc1) can be entered. The codec is checked against the codecs installed on the current system and is accepted, if the codec is available. Addionally, the codec codes of all installed codecs are displayed in the field below.

FPS

name: framesPerSecond, type: Integer, default: 24

The number of frames per second of the target movie.

Num. Frames

name: numFrames, type: Integer, persistent: no

This information field displays the number of frames recorded so far into the current movie.

Status

name: message, type: String, persistent: no

Displays some status information and error messages.

Available Codecs

name: availableCodecs, type: String, persistent: no

Displays the codec codes of all installed codecs on the current system.

Reset Recording

name: triggerReset, type: Trigger

If clicked, the current recording of a movie is canceled and a frames are being discarded.

Finish Movie

name: triggerFinish, type: Trigger, deprecated name: triggerMakeAvi

If clicked, the internal movie stream is closed. Beware: if the input images changes after a movie has been finished and ‘Enable recording’ is still checked, a new movie is created under the old name and the old movie is lost.