<< Click to display table of contents >> TRVCamView.ViewMode |
Specifies how video frames are positioned and scaled in the viewer.
type
// defined in MRVType unit
TRVCamViewMode = (vvmNormal, vvmCenter, vvmCut, vvmAspect,
vvmStretch);
property ViewMode: TRVCamViewMode;
View Mode |
Sample |
vvmNormal A video is displayed at the top left corner of the window, without stretching |
|
vvmCenter A video is displayed in the center of the window, without stretching |
|
vvmCut A video is stretched proportionally so that the smallest side fits the window, the largest side is truncated
|
|
vvmAspect (default) A video is stretched proportionally to fit the window, keeping the side proportions.
|
|
vvmStretch A video is stretched to fit the window. |
[FMX note]: If CaptionColor is semi-transparent, the area for placing video includes the caption area. Otherwise (also in VCL and LCL) the area for placing video is below the caption area.
Note about efficiency
Stretched drawing of large frames may take noticeable time and CPU resources, especially in VCL and LCL, so "normal" and "center" modes are faster.
How to make drawing more efficient:
•[VCL and LCL for Windows] lower quality of scaling using FrameScaleQuality property;
•using "normal" or "center" modes and pre-scale video.
The following TRVCamera settings affect video size:
•VideoResolution property;
•GStreamerProperty.UseVideoScale and related properties;
•FFMpegProperty.UseVideoScale and related properties;
•SetCamVideoMode method.
Resizing video using FFmpeg or GStreamer instead of stretch-drawing has the following advantages:
•they resize frames in a thread context, while drawing is performed in the context of the main process;
•if frames are downscaled by FFmpeg or GStreamer, RVMedia can work with smaller images that can be processed faster and take less memory.
Default value
vvmAspect
See also