-
Notifications
You must be signed in to change notification settings - Fork 33
Configuration
- Debugging
- Logging
- Resolution
- Sharpness
- Contrast
- Brightness
- Saturation
- ISO
- Exposure compensation
- Exposure mode
- Exposure metering mode
- Automatic white balance mode
- Manual analog gain
- Manual digital gain
- Image effects
- Colour effects
- Rotation
- Flip image
- Zoom (Region of interest)
- Shutter speed
- Automatic white balance
- Dynamic range compression
- Statistics pass
- Annotation
- Encoding
- Camera mode
- Burst mode
- Preview renderer configuration
- Static overlay configuration
- Video specific configuration
- User provided buffer number and size
In MMALSharp there is a configuration property named MMALCameraConfig.Debug
which allows you to enable verbose logging. This will cause additional logging to be written and should only be used to help diagnose any issues that may occur when using the library.
If further debugging is required, you can enable the native MMAL debugging logs as seen below:
-
Raspberry Pi 3: In the /boot/config.txt file, add the following:
start_debug=1
. Raspberry Pi 4: You must specify "start_file" and "fixup_file" manually in /boot/config.txt - addstart_file=start4db.elf
andfixup_file=fixup4db.dat
. - Prior to running MMALSharp, run
export VC_LOGLEVEL=mmal:trace
- Capture image using MMALSharp
- Run
sudo vcdbg log msg
andsudo vcdbg log assert
As of v0.6, MMALSharp now uses Microsoft.Extensions.Logging.Abstractions to provide package agnostic logging. If you want to enable logging, you must provide the ILoggerFactory instance your client application is using. For .NET Core applications, this will typically be done during dependency injection configuration. For more information, please see here. The ILoggerFactory instance should be set before carrying out any MMALSharp specific operations.
NLog example:
Below is an example using NLog using the NLog.Extensions.Logging
NuGet package:
var loggerFactory = LoggerFactory.Create(builder =>
{
builder
.ClearProviders()
.SetMinimumLevel(LogLevel.Trace)
.AddNLog("NLog.config");
});
MMALLog.LoggerFactory = loggerFactory;
Serilog example:
Referring to the ticket #155, logging to a file with Serilog is done slightly differently. It relies on the packages Serilog.Extensions.Logging
and Serilog.Sinks.File
, see below for an example on how this is configured:
File.Delete("debug.log"); // log output will append
MMALLog.LoggerFactory = new LoggerFactory()
.AddSerilog(new LoggerConfiguration()
.MinimumLevel.Verbose()
.WriteTo.File("debug.log")
.CreateLogger());
Changes the resolution of outputted still image and video recordings. The camera module has a pre-defined set of sensor modes which it will use when capturing images. Don't worry if the resolution you choose does not match any of the sensor modes - the GPU ISP will scale the image on your behalf.
Instance property | MMALCameraConfig.Resolution |
---|---|
Default Value | Resolution.As5MPixel |
Possible Values | Resolution.As8MPixel, Resolution.As7MPixel, Resolution.As6MPixel, Resolution.As5MPixel, Resolution.As4MPixel, Resolution.As3MPixel, Resolution.As2MPixel, Resolution.As1MPixel, Resolution.As03MPixel, Resolution.As720p, Resolution.As1080p, Resolution.As1440p |
How to Set: |
MMALCameraConfig.Resolution = new Resolution(640, 480); MMALCameraConfig.Resolution = Resolution.As5MPixel; |
Changes the Sharpness of an image.
Instance property | MMALCameraConfig.Sharpness |
---|---|
Default Value | 0 (auto) |
Possible Values | 0 - 100 |
How to Set: |
MMALCameraConfig.Sharpness = 50; |
Changes the Contrast of an image.
Instance property | MMALCameraConfig.Contrast |
---|---|
Default Value | 0 (auto) |
Possible Values | 0 - 100 |
How to Set: |
MMALCameraConfig.Contrast = 50; |
Changes the Brightness of an image.
Instance property | MMALCameraConfig.Brightness |
---|---|
Default Value | 50 |
Possible Values | 0 - 100 |
How to Set: |
MMALCameraConfig.Brightness = 70; |
Changes the Saturation of an image.
Instance property | MMALCameraConfig.Saturation |
---|---|
Default Value | 0 (auto) |
Possible Values | 0 - 100 |
How to Set: |
MMALCameraConfig.Saturation = 50; |
Changes the ISO setting used by the sensor. Relates to the amount of time the sensor is exposed to light. A lower value means the sensor will be exposed for longer. The Shutter Speed will automatically adjust based on the ISO value committed.
Instance property | MMALCameraConfig.ISO |
---|---|
Default Value | 0 (auto) |
Possible Values | 0 (auto) or 100 - 800 |
How to Set: |
MMALCameraConfig.ISO = 100; |
Change the Exposure Compensation of the sensor - doing so will produce a lighter/darker image beyond the recommended exposure.
Instance property | MMALCameraConfig.ExposureCompensation |
---|---|
Default Value | 0 |
Possible Values | -10 - 10 |
How to Set: |
MMALCameraConfig.ExposureCompensation = 10; |
Configure the Exposure Mode used by the sensor.
Instance property | MMALCameraConfig.ExposureCompensation |
---|---|
Default Value | MMAL_PARAM_EXPOSUREMODE_T.MMAL_PARAM_EXPOSUREMODE_AUTO |
Possible Values |
MMAL_PARAM_EXPOSUREMODE_AUTO, // auto: use automatic exposure mode MMAL_PARAM_EXPOSUREMODE_NIGHT, // night: select setting for night shooting MMAL_PARAM_EXPOSUREMODE_NIGHTPREVIEW, MMAL_PARAM_EXPOSUREMODE_BACKLIGHT, // backlight: select setting for backlit subject MMAL_PARAM_EXPOSUREMODE_SPOTLIGHT, MMAL_PARAM_EXPOSUREMODE_SPORTS, // sports: select setting for sports(fast shutter etc.) MMAL_PARAM_EXPOSUREMODE_SNOW, // snow: select setting optimised for snowy scenery MMAL_PARAM_EXPOSUREMODE_BEACH, // beach: select setting optimised for beach MMAL_PARAM_EXPOSUREMODE_VERYLONG, // verylong: select setting for long exposures MMAL_PARAM_EXPOSUREMODE_FIXEDFPS, // fixedfps: constrain fps to a fixed value MMAL_PARAM_EXPOSUREMODE_ANTISHAKE, // antishake: antishake mode MMAL_PARAM_EXPOSUREMODE_FIREWORKS // fireworks: select setting optimised for fireworks |
How to Set: |
MMALCameraConfig.ExposureCompensation = MMAL_PARAM_EXPOSUREMODE_T.MMAL_PARAM_EXPOSUREMODE_AUTO; |
Configure the exposure metering mode to be used by the camera. The metering mode determines how the camera measures exposure.
Instance property | MMALCameraConfig.ExposureMeterMode |
---|---|
Default Value | MMAL_PARAM_EXPOSUREMETERINGMODE_T.MMAL_PARAM_EXPOSUREMETERINGMODE_AVERAGE |
Possible Values |
MMAL_PARAM_EXPOSUREMETERINGMODE_T.MMAL_PARAM_EXPOSUREMETERINGMODE_SPOT MMAL_PARAM_EXPOSUREMETERINGMODE_T.MMAL_PARAM_EXPOSUREMETERINGMODE_AVERAGE MMAL_PARAM_EXPOSUREMETERINGMODE_T.MMAL_PARAM_EXPOSUREMETERINGMODE_MATRIX |
How to Set: |
MMALCameraConfig.ExposureMeterMode = MMAL_PARAM_EXPOSUREMETERINGMODE_T.MMAL_PARAM_EXPOSUREMETERINGMODE_AVERAGE; |
Spot metering MMAL_PARAM_EXPOSUREMETERINGMODE_T.MMAL_PARAM_EXPOSUREMETERINGMODE_SPOT
:
With spot metering, the camera will only measure a very small area of the scene and ignores everything else. On the Raspberry Pi camera, this will be the very centre of the image.
Average metering MMAL_PARAM_EXPOSUREMETERINGMODE_T.MMAL_PARAM_EXPOSUREMETERINGMODE_AVERAGE
:
Using this metering mode, the camera will use the light information coming from the entire scene. It does not focus on any particular area of the scene.
Matrix metering MMAL_PARAM_EXPOSUREMETERINGMODE_T.MMAL_PARAM_EXPOSUREMETERINGMODE_MATRIX
:
Matrix metering works by dividing the entire frame into multiple "zones" which are then analysed on an individual basis for light and dark tones.
Sources: https://photographylife.com/understanding-metering-modes https://en.wikipedia.org/wiki/Metering_mode#Spot_metering
Configure the Auto White Balance to be used by the camera
Instance property | MMALCameraConfig.AwbMode |
---|---|
Default Value | MMAL_PARAM_AWBMODE_T.MMAL_PARAM_AWBMODE_OFF |
Possible Values |
MMAL_PARAM_AWBMODE_OFF, // off: turn off white balance calculation MMAL_PARAM_AWBMODE_AUTO, // auto: automatic mode(default) MMAL_PARAM_AWBMODE_SUNLIGHT, // sun: sunny mode(between 5000K and 6500K) MMAL_PARAM_AWBMODE_CLOUDY, // cloud: cloudy mode(between 6500K and 12000K) MMAL_PARAM_AWBMODE_SHADE, // shade: shade mode MMAL_PARAM_AWBMODE_TUNGSTEN, // tungsten: tungsten lighting mode(between 2500K and 3500K) MMAL_PARAM_AWBMODE_FLUORESCENT, // fluorescent: fluorescent lighting mode(between 2500K and 4500K) MMAL_PARAM_AWBMODE_INCANDESCENT, // incandescent: incandescent lighting mode MMAL_PARAM_AWBMODE_FLASH, // flash: flash mode MMAL_PARAM_AWBMODE_HORIZON // horizon: horizon mode |
How to Set: |
MMALCameraConfig.AwbMode = MMAL_PARAM_AWBMODE_T.MMAL_PARAM_AWBMODE_AUTO; |
Available in v0.7
This configuration setting is used to manually adjust the sensor's analog gain. Requires exposure mode to be left at "auto" (or at least not "off"). Expects a floating point value from 1.0 to 8.0 for the OV5647 sensor on Camera Module V1, and 1.0 to 12.0 for the IMX219 sensor on Camera Module V2 and the IMX447 on the HQ Camera.
Instance property | MMALCameraConfig.AnalogGain |
---|---|
Default Value | 0 (off) |
Possible Values | 1.0 - 8.0 |
How to Set: |
MMALCameraConfig.AnalogGain = 4.0; |
Available in v0.7
This configuration setting is used to manually adjust the digital gain used by the ISP. Requires exposure mode to be left at "auto" (or at least not "off"). Expects a floating point value from 1.0 to 255.0, but values over about 4.0 will produce overexposed images.
Instance property | MMALCameraConfig.DigitalGain |
---|---|
Default Value | 0 (off) |
Possible Values | 1.0 - 255.0 |
How to Set: |
MMALCameraConfig.DigitalGain = 3.0; |
Apply effects to the resulting image. Some effects may not be applicable depending on the firmware version.
Instance property | MMALCameraConfig.ImageFx |
---|---|
Default Value | MMAL_PARAM_IMAGEFX_T.MMAL_PARAM_IMAGEFX_NONE |
Possible Values |
MMAL_PARAM_IMAGEFX_NONE, // none: no effect (default) MMAL_PARAM_IMAGEFX_NEGATIVE, // negative: invert the image colours MMAL_PARAM_IMAGEFX_SOLARIZE, // solarise: solarise the image MMAL_PARAM_IMAGEFX_POSTERIZE, // posterise: posterise the image MMAL_PARAM_IMAGEFX_WHITEBOARD, // whiteboard: whiteboard effect MMAL_PARAM_IMAGEFX_BLACKBOARD, // blackboard: blackboard effect MMAL_PARAM_IMAGEFX_SKETCH, // sketch: sketch effect MMAL_PARAM_IMAGEFX_DENOISE, // denoise: denoise the image MMAL_PARAM_IMAGEFX_EMBOSS, // emboss: emboss the image MMAL_PARAM_IMAGEFX_OILPAINT, // oilpaint: oil paint effect MMAL_PARAM_IMAGEFX_HATCH, // hatch: hatch sketch effect MMAL_PARAM_IMAGEFX_GPEN, // gpen: graphite sketch effect MMAL_PARAM_IMAGEFX_PASTEL, // pastel: pastel effect MMAL_PARAM_IMAGEFX_WATERCOLOUR, // watercolour: watercolour effect MMAL_PARAM_IMAGEFX_FILM, // film: film grain effect MMAL_PARAM_IMAGEFX_BLUR, // blur: blur the image MMAL_PARAM_IMAGEFX_SATURATION, // saturation: colour saturate the image MMAL_PARAM_IMAGEFX_COLOURSWAP, // colourswap: not fully implemented MMAL_PARAM_IMAGEFX_WASHEDOUT, // washedout: not fully implemented MMAL_PARAM_IMAGEFX_COLOURPOINT, // colourpoint: not fully implemented MMAL_PARAM_IMAGEFX_COLOURBALANCE, // colourbalance: not fully implemented MMAL_PARAM_IMAGEFX_CARTOON // cartoon: not fully implemented |
How to Set: |
MMALCameraConfig.ImageFx = MMAL_PARAM_IMAGEFX_T.MMAL_PARAM_IMAGEFX_PASTEL; |
Allows a user to change the colour of an image. Firmware expects U and V components of YUV colour space i.e. U = 128, V = 128 will result in a greyscale (monochrome) image. MMALSharp converts a System.Drawing.Color
struct on your behalf.
Instance property | MMALCameraConfig.ColourFx |
---|---|
Default Value | Disabled |
Possible Values | A `System.Drawing.Color` structure. |
How to Set: |
MMALCameraConfig.ColourFx = new ColourEffects { Color = Color.Blue, Enable = true }; |
Rotate the resulting image.
Instance property | MMALCameraConfig.Rotation |
---|---|
Default Value | 0 |
Possible Values | 0, 90, 180, 270 |
How to Set: |
MMALCameraConfig.Rotation = 90; |
Flip the resulting image.
Instance property | MMALCameraConfig.Flips |
---|---|
Default Value | MMAL_PARAM_MIRROR_T.MMAL_PARAM_MIRROR_NONE |
Possible Values |
MMAL_PARAM_MIRROR_NONE, MMAL_PARAM_MIRROR_VERTICAL, MMAL_PARAM_MIRROR_HORIZONTAL, MMAL_PARAM_MIRROR_BOTH |
How to Set: |
MMALCameraConfig.Flips = MMAL_PARAM_MIRROR_T.MMAL_PARAM_MIRROR_VERTICAL; |
Zoom in on the resulting image to produce a Region of Interest.
Instance property | MMALCameraConfig.ROI |
---|---|
Default Value | Disabled |
Possible Values | X, Y, Height and Width parameters must be less than 1.0. |
How to Set: |
MMALCameraConfig.ROI = new Zoom { X = 0.5, Y = 0.5, Height = 0.1, Width = 0.1 }; |
Adjust the shutter speed, this setting adjusts the length of time that the sensor is exposed to light. A fast shutter speed will reduce the length of time it is exposed to light.
Instance property | MMALCameraConfig.ShutterSpeed |
---|---|
Default Value | 0 (auto) |
Possible Values | 0 - 6000000 (8000000 on v2 module) |
How to Set: |
MMALCameraConfig.ShutterSpeed = 1000000; |
There is an upper limit of 6000000us (6000ms, 6s), past which operation is undefined.
Sets red AWB gains to be applied. Only applies when AwbMode is disabled.
Instance property | MMALCameraConfig.AwbGainsR |
---|---|
Default Value | 0 (auto) |
Possible Values | TODO |
How to Set: |
MMALCameraConfig.AwbGainsR = 2; |
Sets blue AWB gains to be applied. Only applies when AwbMode is disabled.
Instance property | MMALCameraConfig.AwbGainsB |
---|---|
Default Value | 0 (auto) |
Possible Values | TODO |
How to Set: |
MMALCameraConfig.AwbGainsB = 2; |
Dynamic range compression increases the range of dark areas and decreases brighter areas, which helps improve the resulting image in low light areas.
Instance property | MMALCameraConfig.DrcLevel |
---|---|
Default Value | MMAL_PARAMETER_DRC_STRENGTH_T.MMAL_PARAMETER_DRC_STRENGTH_OFF |
Possible Values |
MMAL_PARAMETER_DRC_STRENGTH_OFF MMAL_PARAMETER_DRC_STRENGTH_LOW MMAL_PARAMETER_DRC_STRENGTH_MEDIUM MMAL_PARAMETER_DRC_STRENGTH_HIGH |
How to Set: |
MMALCameraConfig.DrcLevel = MMAL_PARAMETER_DRC_STRENGTH_T.MMAL_PARAMETER_DRC_STRENGTH_MEDIUM; |
Displays the exposure, analogue and digital gains, and AWB settings used.
Instance property | MMALCameraConfig.StatsPass |
---|---|
Default Value | false |
Possible Values | true, false |
How to Set: |
MMALCameraConfig.StatsPass = true; |
Allows annotation to be applied to the resulting image.
Enable annotation
There are public API methods to enable and disable the annotation functionality. To enable, call MMALCamera.EnableAnnotation
. To disable, call MMALCamera.DisableAnnotation
.
Customise annotation options
Instance property | MMALCameraConfig.Annotate |
---|---|
Default Value | |
Properties | CustomText, TextSize, TextColour, BgColour, ShowShutterSettings, ShowGainSettings, ShowLensSettings, ShowCafSettings, ShowMotionSettings, ShowFrameNumber, ShowBlackBackground, ShowDateText, ShowTimeText, DateFormat, TimeFormat, RefreshRate |
How to Set: |
MMALCameraConfig.Annotate = new AnnotateImage { ShowDateText = true, ShowTimeText = true, DateFormat = "dd/MM/yyyy", TimeFormat = "HH:mm", RefreshRate = DateTimeTextRefreshRate.Minutes }; |
In MMALSharp, certain components provide the ability to have their encoding type and pixel format changed, such as the Camera, Encoder/Decoder, Splitter and Resizer components.
A user is able to change the encoding type and pixel format used by a Component by using one of the Encoding formats available in the MMALSharp.Native.MMALEncoding
class.
To change the encoding of the Camera component, there are specific MMALCameraConfig
properties that you can adjust prior to initialising the Camera component, i.e prior to calling ConfigureCameraSettings()
. The encoding type set against these properties will dictate which raw encoding type is used when sending data from the camera sensor. By default, the MMALCameraConfig.Encoding
is set to OPAQUE
- this is a special proprietary format designed by Broadcom which acts as a pointer to the data being transferred and is a more efficient way of transferring data between components, it is recommended to use this throughout your pipeline as far as possible before outputting to a full encoding format. The MMALCameraConfig.EncodingSubFormat
is set to I420
by default, this is because that is the pixel format generated natively by the camera component and therefore doesn't require any conversion - this is the most efficient pixel format to use. You can of course ask the ISP to output a different pixel format such as a flavour of RGB but please bear in mind this will be less efficient due to the conversion being taken place.
MMALCameraConfig.Encoding
MMALCameraConfig.EncodingSubFormat
For all other components, the encoding type is specified via a MMALPortConfig
object when configuring the input/output port of your respective component, i.e when calling ConfigureInputPort
/ConfigureOutputPort
.
Both camera modules feature different modes which affects their output resolution, framerate, and field of view. Details of the various modes available can be found here for the OV5647 module, and here for the IMX219.
Selecting a video mode which is as close as possible to your desired resolution is favourable, and MMALSharp selects Mode 0 (automatic) by default; in automatic mode the sensor will select the optimal settings based on your specified resolution and framerate.
Instance property | MMALCameraConfig.SensorMode |
---|---|
Default Value | Mode0 |
Properties | Mode0, Mode1, Mode2, Mode3, Mode4, Mode5, Mode6, Mode7 |
How to Set: |
MMALCameraConfig.SensorMode = MMALSensorMode.Mode0; |
Available in v0.6
Burst mode is configured against the camera's still port and allows it to take pictures at a much faster rate at the expense of quality.
Instance property | MMALCameraConfig.StillBurstMode |
---|---|
Default Value | false |
How to Set: |
MMALCameraConfig.StillBurstMode = true; |
Indicates whether to use full screen or windowed mode.
Instance property | PreviewConfiguration.FullScreen |
---|---|
Default Value | true |
Possible Values | true, false |
How to Set: |
var config = new PreviewConfiguration { FullScreen = false }; |
If set to true, indicates that any display scaling should disregard the aspect ratio of the frame region being displayed.
Instance property | PreviewConfiguration.NoAspect |
---|---|
Default Value | false |
Possible Values | true, false |
How to Set: |
var config = new PreviewConfiguration { NoAspect = true }; |
Specifies where the preview overlay should be drawn on the screen.
Instance property | PreviewConfiguration.PreviewWindow |
---|---|
Default Value | new Rectangle(0, 0, 1024, 768); |
How to Set: |
var config = new PreviewConfiguration { PreviewWindow = new Rectangle(200, 50, 640, 480); }; |
Opacity of the preview windows. Value between 1 (fully invisible) - 255 (fully opaque). Note: If RGBA encoding is used with the preview component then the alpha channel will be ignored.
Instance property | PreviewConfiguration.Opacity |
---|---|
Default Value | 255 |
How to Set: |
var config = new PreviewConfiguration { Opacity = 100 }; |
Sets the relative depth of the images, with greater values being in front of smaller values.
Instance property | PreviewConfiguration.Layer |
---|---|
Default Value | 2 |
How to Set: |
var config = new PreviewConfiguration { Layer = 1 }; |
Indicates whether any flipping or rotation should be used on the overlay.
Instance property | PreviewConfiguration.DisplayTransform |
---|---|
Default Value | MMAL_DISPLAY_ROT0 |
How to Set: |
var config = new PreviewConfiguration { DisplayTransform = MMALParametersVideo.MMAL_DISPLAYTRANSFORM_T.MMAL_DISPLAY_ROT90 }; |
Indicates how the image should be scaled to fit the display.
Instance property | PreviewConfiguration.DisplayMode |
---|---|
Default Value | MMAL_DISPLAY_MODE_FILL |
How to Set: |
var config = new PreviewConfiguration { DisplayTransform = MMALParametersVideo.MMAL_DISPLAYMODE_T.MMAL_DISPLAY_MODE_LETTERBOX }; |
The PreviewOverlayConfiguration
class inherits from PreviewConfiguration
, meaning the info above regarding Preview renderer configuration applies here also.
Specifies the resolution of the static resource to be used with this Preview Overlay. If this is null then the parent renderer's resolution will be used instead.
Instance property | PreviewOverlayConfiguration.Resolution |
---|---|
Default Value | |
How to Set: |
var config = new PreviewOverlayConfiguration { Resolution = new Resolution(640, 480); }; |
The encoding of the static resource. Can be one of the following: YUV, RGB, RGBA, BGR, BGRA. If left null, we will try to work out the encoding based on the size of the image (3 bytes for RGB, 4 bytes for RGBA).
Instance property | PreviewOverlayConfiguration.Encoding |
---|---|
Default Value | |
How to Set: |
var config = new PreviewOverlayConfiguration { Encoding = MMALEncoding.I420; }; |
Enables video stabilisation support when recording video. Please note that enabling this config will cause the video recording to be cropped by a small percentage to compensate for the stabilisation being carried out.
Instance property | MMALCameraConfig.VideoStabilisation |
---|---|
Default Value | false |
Possible Values | true, false |
How to Set: |
MMALCameraConfig.VideoStabilisation = true; |
Not supported by firmware however code present.
H.264 encoding only
Every intra refresh period, H.264 video uses a complete frame (I-frame) which subsequent frames are then based upon. This setting specifies the number of frames between each I-frame. A higher value will reduce the size of the resulting video, and a smaller value will result in a less error prone stream.
Instance property | MMALCameraConfig.IntraPeriod |
---|---|
Default Value | -1 (disabled) |
Possible Values | |
How to Set: |
MMALCameraConfig.IntraPeriod = 1; |
Sets the encoding profile.
Instance property | MMALCameraConfig.VideoProfile |
---|---|
Default Value | -1 (disabled) |
Possible Values | MMAL_VIDEO_PROFILE_T.MMAL_VIDEO_PROFILE_H264_HIGH, MMAL_VIDEO_PROFILE_T.MMAL_VIDEO_PROFILE_H264_MAIN, MMAL_VIDEO_PROFILE_T.MMAL_VIDEO_PROFILE_H264_EXTENDED |
How to Set: |
MMALCameraConfig.VideoProfile = MMAL_VIDEO_PROFILE_T.MMAL_VIDEO_PROFILE_H264_HIGH; |
Sets the encoding level.
Instance property | MMALCameraConfig.VideoLevel |
---|---|
Default Value | MMAL_VIDEO_LEVEL_T.MMAL_VIDEO_LEVEL_H264_4 |
Possible Values |
MMAL_VIDEO_LEVEL_H264_1 MMAL_VIDEO_LEVEL_H264_1b MMAL_VIDEO_LEVEL_H264_11 MMAL_VIDEO_LEVEL_H264_12 MMAL_VIDEO_LEVEL_H264_13 MMAL_VIDEO_LEVEL_H264_2 MMAL_VIDEO_LEVEL_H264_21 MMAL_VIDEO_LEVEL_H264_22 MMAL_VIDEO_LEVEL_H264_3 MMAL_VIDEO_LEVEL_H264_31 MMAL_VIDEO_LEVEL_H264_32 MMAL_VIDEO_LEVEL_H264_4 MMAL_VIDEO_LEVEL_H264_41 MMAL_VIDEO_LEVEL_H264_42 |
How to Set: |
MMALCameraConfig.VideoLevel = MMAL_VIDEO_LEVEL_T.MMAL_VIDEO_LEVEL_H264_42; |
Valid values: See MMALSharp.Native.MMALParametersVideo.MMAL_VIDEO_LEVEL_T
When enabled, the stream will include PPS and SPS headers on every I-frame. Certain streaming methods require this to be enabled e.g. Apple HLS.
Instance property | MMALCameraConfig.InlineHeaders |
---|---|
Default Value | false |
Possible Values | true, false |
How to Set: |
MMALCameraConfig.InlineHeaders = true; |
When enabled, Inline Motion Vector headers will be produced. These Vectors display motion occurred between frames.
Instance property | MMALCameraConfig.InlineMotionVectors |
---|---|
Default Value | false |
Possible Values | true, false |
How to Set: |
MMALCameraConfig.InlineMotionVectors = true; |
There may be scenarios where the number of buffers used by the camera's still or video port isn't enough and you may get small performance benefits by increasing the number. The minimum number of buffers used will always be the value of BufferNumRecommended
which is retrieved natively from the port.
MMALCameraConfig.UserBufferNum = 10;
There may be scenarios where the size of buffers used by the camera's still or video port isn't enough and you may get small performance benefits by increasing the number. The minimum size of buffers used will always be the value of BufferSizeRecommended
which is retrieved natively from the port.
MMALCameraConfig.UserBufferSize = 20000;