Video Commands
blend
Blends videos or still images together, using different alphas, blend modes, and possibly with rescaling, translation, and added borders.
Options
- -o, --output_path <output_path>
Output folder for blended frames.
- -m, --modes <modes>
Either one for all images, or one per image in the form of a sequence. Blending modes are: mean, add, satadd, max, alpha. In the add mode the values are clipped. For alpha-blending, we assume that RGB values are not ‘alpha-premultiplied’.
- Default
max
- -a, --alphas <alphas>
List of alpha values for each input image
- Default
1.0
- -s, --scales <scales>
List of scales ‘s’ for each input image, starting with the second one (first image has always a scale of 1). Scaled images must be of same dimension or smaller than the first images.
- Default
1.0
- -t, --translations <translations>
List of translations ‘x0,y0|x1_y1|…’ for each input image, starting with the second one (first image is always at 0,0). If set to 0,0 no translation is performed for any image.
- Default
0,0
- -bw, --borderwidth <borderwidth>
Border width added to insets.
- Default
0
- -bc, --bordercolor <bordercolor>
Border color in RGBA format. For example: 1,1,1,1 is white.
- Default
1,1,1,1
- -bo, --borderover
Border is overlayed on top of inset images, without increasing their size.
- Default
False
- -w, --overwrite
Force overwrite of output images.
- Default
False
- -k, --workers <workers>
Number of worker threads to spawn, set to -1 for maximum number of workers
- Default
-1
- -wkb, --workersbackend <workersbackend>
What backend to spawn workers with, can be ‘loky’ (multi-process) or ‘threading’ (multi-thread)
- Default
threading
- -d, --device <device>
Sets the CUDA devices id, e.g. 0,1,2
- Default
0
Arguments
- INPUT_PATHS
Optional argument(s)
mp4
Converts a folder of images into an MP4 video file.
Options
- -p, --prefix <prefix>
Prefix for image filenames
- -l, --leading <leading>
Number of leading zeros for frame indices.
- -e, --extension <extension>
Extension for image filenames
- -o, --output_path <output_path>
Output file path for movie
- -fps, --framerate <framerate>
Sets the framerate in frames per second
- Default
30
- -c, --codec <codec>
Encoding codec, For x264 class codecs: libx264 (reference but slow), or: h264_nvenc (faster, GPU). For x265 class codecs: libx265 (reference but slow), or: hevc_nvenc(faster, GPU
- Default
h264_nvenc
- -ps, --preset <preset>
Possible values: ultrafast, superfast, veryfast, faster, fast, medium (default preset), slow, slower, veryslow. A preset is a collection of options that will provide a certain encoding speed to compression ratio. A slower preset will provide better compression (compression is quality per filesize). This means that, for example, if you target a certain file size or constant bit rate, you will achieve better quality with a slower preset. Similarly, for constant quality encoding, you will simply save bitrate by choosing a slower preset.
- Default
slow
- -q, --quality <quality>
Sets the quality of the video by modulating the bit rate. Set to a higher value for higher quality, or lower (negative ok) value for lower quality. Means different things for different codecs.
- Default
0
- -wi, --width <width>
Video frame width, recommended values: 1280(HD720), 1920(HD1080), 2048(2K), 3840(UHD-1), 4096(4K), 7680(8K). If zero then original size preserved, if -1 the best fit is found while allowing some downscaling. Height is automatically determined to preserve aspect ratio, and is forced to be a multiple of 32.
- Default
0
- -pf, --pixelformat <pixelformat>
Pixel format, can be yuv420p (default, recommended) or yuv444p (no chrominance downsampling but better compatibility), or any other allowed ffmpeg & codec pixel format.
- Default
yuv420p
- -w, --overwrite
to force overwrite of target
- Default
False
Arguments
- INPUT_PATH
Required argument
overlay
Adds scale bars and timestamps to videos.
Options
- -o, --output_path <output_path>
Output folder for overlayed frames.
- -sb, --scalebar, -nsb, --no-scalebar
True to insert scale bar.
- Default
True
- -bl, --barlength <barlength>
Length of scale bar in the provided unit.
- Default
1
- -bs, --barscale <barscale>
Conversion factor from pixels to units – what is the side length of a pixel/voxel in units.
- Default
1
- -bh, --barheight <barheight>
Height of th scale bar in pixels
- Default
4
- -bp, --barpos <barpos>
Positions of the scale bar in pixels in natural order: (x, y). Can also be a string: bottom_left, bottom_right, top_left, top_right.
- Default
bottom_right
- -bu, --barunit <barunit>
Scale bar unit name.
- Default
μm
- -ts, --timestamp, -nts, --no-timestamp
True to insert time stamp.
- Default
True
- -ts, --timestart <timestart>
Start time for time stamp
- Default
0
- -ti, --timeinterval <timeinterval>
Time interval inn units of time between consecutive images.
- Default
1
- -tp, --timepos <timepos>
Positions of the time stamp in pixels in natural order: (x, y). Can also be a string: bottom_left, bottom_right, top_left, top_right.
- Default
top_right
- -tu, --timeunit <timeunit>
Time stamp time unit name.
- Default
s
- -mg, --margin <margin>
Margin around bar expressed in units relative to the text height
- Default
1
- -c, --color <color>
Color of the bar and text as tuple of 4 values: (R, G, B, A)
- -nf, --numberformat <numberformat>
Format string to represent the start and end values.
- Default
{:.1f}
- -fn, --fontname <fontname>
Font name.
- Default
Helvetica
- -fs, --fontsize <fontsize>
Font size in pixels.
- Default
32
- -md, --mode <mode>
Blending modes. Either one for all images, or one per image in the form of a sequence. Blending modes are: mean, add, satadd, max, alpha.
- Default
max
- -w, --overwrite
Force overwrite of output images.
- Default
False
- -k, --workers <workers>
Number of worker threads to spawn, set to -1 for maximum number of workers
- Default
-1
- -wkb, --workersbackend <workersbackend>
What backend to spawn workers with, can be ‘loky’ (multi-process) or ‘threading’ (multi-thread)
- Default
threading
- -d, --device <device>
Sets the CUDA devices id, e.g. 0,1,2
- Default
0
Arguments
- INPUT_PATH
Required argument
resize
Resizes video
Options
- -o, --output_path <output_path>
Output folder for resized frames.
- -c, --crop <crop>
Crop image by removing a given number of pixels/voxels per axis. For example: 10,20*10,20 crops 10 pixels on the left for axis 0, 20 pixels from the right of axis #0, and the same for axis 2.
- -r, --resize <resize>
After cropping, the image is resized to the given shape. If any entry in the tuple is -1 then that position in the shape is automatically determined based on the existing shape to preserve aspect ratio.
- -ro, --resizeorder <resizeorder>
The order of the spline interpolation, default is 3. The order has to be in the range 0-5.
- Default
3
- -rm, --resizemode <resizemode>
Optional The mode parameter determines how the input array is extended beyond its boundaries. Can be: ‘reflect’, ‘constant’, ‘nearest’, ‘mirror’, ‘wrap’.
- Default
constant
- -pw, --padwidth <padwidth>
After cropping and resizing, padding is performed. The provided tuple is interpreted similarly to cropping. For example, 5,5*5,5 pads all sides with 5 pixels.
- -pm, --padmode <padmode>
Padding mode. See numpy.pad for the available modes
- Default
constant
- -pc, --padcolor <padcolor>
Padding color as tuple of normalised floats: (R,G,B,A). Default is transparent black.
- Default
0,0,0,0
- -w, --overwrite
Force overwrite of output images.
- Default
False
- -k, --workers <workers>
Number of worker threads to spawn, set to -1 for maximum number of workers
- Default
-1
- -wkb, --workersbackend <workersbackend>
What backend to spawn workers with, can be ‘loky’ (multi-process) or ‘threading’ (multi-thread)
- Default
threading
- -d, --device <device>
Sets the CUDA devices id, e.g. 0,1,2
- Default
0
Arguments
- INPUT_PATH
Required argument
stack
Stacks video vertically or horizontally (video = folder of images).
Options
- -o, --output_path <output_path>
Output folder for stacked frames.
- -or, --orientation <orientation>
Stitching mode: horiz, vert
- Default
horiz
- -w, --overwrite
Force overwrite of output images.
- Default
False
- -k, --workers <workers>
Number of worker threads to spawn, set to -1 for maximum number of workers
- Default
-1
- -wkb, --workersbackend <workersbackend>
What backend to spawn workers with, can be ‘loky’ (multi-process) or ‘threading’ (multi-thread)
- Default
threading
Arguments
- INPUT_PATHS
Optional argument(s)
volrender
Renders 3D volumetric video
Options
- -o, --output_path <output_path>
Output folder to store rendered PNGs. Default is: frames_<channel_name>
- -c, --channels <channels>
list of channels to color, all channels when ommited.
- -s, --slicing <slicing>
dataset slice (TZYX), e.g. [0:5] (first five stacks) [:,0:100] (cropping in z).
- -w, --overwrite
to force overwrite of target
- Default
False
- -a, --aspect <aspect>
sets aspect ratio e.g. 4
- Default
4
- -cm, --colormap <colormap>
sets colormap, e.g. viridis, gray, magma, plasma, inferno
- Default
magma
- -rs, --rendersize <rendersize>
Sets the frame color size. i.e. -ws 400 sets the window to 400x400
- Default
2048
- -cl, --clim <clim>
Sets the contrast limits, i.e. -cl 0,1000 sets the contrast limits to [0,1000]
- -opt, --options <options>
Render options, e.g: ‘gamma=1.2,box=True’. Important: no white spaces!!! Complete list with defaults will be displayed on first run
Arguments
- INPUT_PATHS
Optional argument(s)