Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Capturing still image to memory stream no longer working #200

Open
@mkj-stonehill

Description

@mkj-stonehill

I wanted to add dual camera support to MMALSharp, so I cloned the repo, and build it into my application (it was using version 0.6 from nuget before, to successfully capture images from camera 0).

There were a few changes required in my app with the latest version of MMALSharp (mostly the merged properties in MMALCameraConfig), but they seemed straight-forward. However, now when I run it, the very first
await this.Cam.ProcessAsync(this.Cam.Camera.StillPort);
I do never completes.

I've looked at Issue #198 (which is very similar); but I'm never even getting the StillPort.NativeOutputPortCallback call.

I've even looked through all of the diffs from the 0.6 release on, but nothing obvious (to me) jumps out. It's probably something stupid I'm doing (or not doing), that just happened to work on 0.6, but no longer does. Can you point me in the right direction?

I've added logging (using NLog), and here's the log I get:

2021-04-01 14:00:30.5362|DEBUG|MMALSharp|Setting parameter MMAL_PARAMETER_CAMERA_NUM
2021-04-01 14:00:31.9463|DEBUG|MMALSharp|Camera config set
2021-04-01 14:00:31.9606|DEBUG|MMALSharp|vc.ril.camera:ctr:0 : Enabling control port.
2021-04-01 14:00:31.9639|DEBUG|MMALSharp|vc.ril.camera:ctr:0 : Enabling port.
2021-04-01 14:00:31.9639|DEBUG|MMALSharp|Configuring camera parameters.
2021-04-01 14:00:31.9785|DEBUG|MMALSharp|Getting parameter MMAL_PARAMETER_CAMERA_CUSTOM_SENSOR_CONFIG
2021-04-01 14:00:32.0022|DEBUG|MMALSharp|Setting saturation: 0
2021-04-01 14:00:32.0043|DEBUG|MMALSharp|Setting parameter MMAL_PARAMETER_SATURATION
2021-04-01 14:00:32.0505|DEBUG|MMALSharp|Setting sharpness: 0
2021-04-01 14:00:32.0528|DEBUG|MMALSharp|Setting parameter MMAL_PARAMETER_SHARPNESS
2021-04-01 14:00:32.0528|DEBUG|MMALSharp|Setting contrast: 0
2021-04-01 14:00:32.0528|DEBUG|MMALSharp|Setting parameter MMAL_PARAMETER_CONTRAST
2021-04-01 14:00:32.0624|DEBUG|MMALSharp|Setting brightness: 50
2021-04-01 14:00:32.0624|DEBUG|MMALSharp|Setting parameter MMAL_PARAMETER_BRIGHTNESS
2021-04-01 14:00:32.0624|DEBUG|MMALSharp|Setting ISO: 200
2021-04-01 14:00:32.0624|DEBUG|MMALSharp|Setting parameter MMAL_PARAMETER_ISO
2021-04-01 14:00:32.0857|DEBUG|MMALSharp|Setting video stabilisation: False
2021-04-01 14:00:32.0857|DEBUG|MMALSharp|Setting parameter MMAL_PARAMETER_VIDEO_STABILISATION
2021-04-01 14:00:32.1047|DEBUG|MMALSharp|Setting exposure compensation: 0
2021-04-01 14:00:32.1047|DEBUG|MMALSharp|Setting parameter MMAL_PARAMETER_EXPOSURE_COMP
2021-04-01 14:00:32.1047|DEBUG|MMALSharp|Setting exposure mode: MMAL_PARAM_EXPOSUREMODE_AUTO
2021-04-01 14:00:32.1179|DEBUG|MMALSharp|Setting exposure metering mode: MMAL_PARAM_EXPOSUREMETERINGMODE_AVERAGE
2021-04-01 14:00:32.1238|DEBUG|MMALSharp|Setting AWB mode: MMAL_PARAM_AWBMODE_AUTO
2021-04-01 14:00:32.1386|DEBUG|MMALSharp|Setting AWB gains: 0, 0
2021-04-01 14:00:32.1447|DEBUG|MMALSharp|Setting Image FX: MMAL_PARAM_IMAGEFX_NONE
2021-04-01 14:00:32.1447|DEBUG|MMALSharp|Setting colour effects
2021-04-01 14:00:32.1597|DEBUG|MMALSharp|Setting rotation: 0
2021-04-01 14:00:32.1597|DEBUG|MMALSharp|Setting parameter MMAL_PARAMETER_ROTATION
2021-04-01 14:00:32.1650|DEBUG|MMALSharp|Setting shutter speed: 4000
2021-04-01 14:00:32.1650|DEBUG|MMALSharp|Setting parameter MMAL_PARAMETER_SHUTTER_SPEED
2021-04-01 14:00:32.1650|DEBUG|MMALSharp|Setting parameter MMAL_PARAMETER_CAPTURE_STATS_PASS
2021-04-01 14:00:32.1858|DEBUG|MMALSharp|Setting parameter MMAL_PARAMETER_CAMERA_BURST_CAPTURE
2021-04-01 14:00:32.1858|DEBUG|MMALSharp|Setting parameter MMAL_PARAMETER_ANALOG_GAIN
2021-04-01 14:00:32.1938|DEBUG|MMALSharp|Setting parameter MMAL_PARAMETER_DIGITAL_GAIN
2021-04-01 14:00:32.1938|DEBUG|MMALSharp|Commit preview
2021-04-01 14:00:32.2127|DEBUG|MMALSharp|vc.ril.camera:out:0 : Committing port format changes.
2021-04-01 14:00:32.2287|DEBUG|MMALSharp|vc.ril.camera:out:0(OPQV) : Committing port format changes.
2021-04-01 14:00:32.2371|DEBUG|MMALSharp|Commit video
2021-04-01 14:00:32.2371|DEBUG|MMALSharp|vc.ril.camera:out:1 : Committing port format changes.
2021-04-01 14:00:32.2479|DEBUG|MMALSharp|vc.ril.camera:out:1(OPQV) : Committing port format changes.
2021-04-01 14:00:32.2595|DEBUG|MMALSharp|Commit still
2021-04-01 14:00:32.2632|DEBUG|MMALSharp|vc.ril.camera:out:2 : Committing port format changes.
2021-04-01 14:00:32.2632|DEBUG|MMALSharp|vc.ril.camera:out:2(OPQV) : Committing port format changes.
2021-04-01 14:00:32.3167|DEBUG|MMALSharp|Camera component configured.
2021-04-01 14:00:35.9231|DEBUG|MMALSharp|vc.ril.image_encode:in:0 : Shallow copy port format.
2021-04-01 14:00:35.9231|DEBUG|MMALSharp|vc.ril.image_encode:out:0 : Committing port format changes.
2021-04-01 14:00:35.9347|DEBUG|MMALSharp|vc.ril.image_encode:out:0(JPEG) : Committing port format changes.
2021-04-01 14:00:35.9347|DEBUG|MMALSharp|Setting parameter MMAL_PARAMETER_JPEG_Q_FACTOR
2021-04-01 14:00:35.9584|DEBUG|MMALSharp|Setting parameter MMAL_PARAMETER_EXIF_DISABLE
2021-04-01 14:00:35.9841|DEBUG|MMALSharp|vc.ril.camera:out:2(OPQV) : Shallow copy port format.
2021-04-01 14:00:35.9841|DEBUG|MMALSharp|vc.ril.image_encode:in:0 : Committing port format changes.
2021-04-01 14:00:36.0036|DEBUG|MMALSharp|Enabling connection between vc.ril.camera:out:2(OPQV)  and vc.ril.image_encode:in:0(OPQV)
2021-04-01 14:00:36.0175|DEBUG|MMALSharp|Enabling connection between vc.ril.camera:out:0(OPQV)  and vc.null_sink:in:0(OPQV)
2021-04-01 14:00:37.1708|DEBUG|MMALSharp|vc.ril.image_encode:out:0(JPEG) : Starting output port.
2021-04-01 14:00:37.1852|DEBUG|MMALSharp|vc.ril.image_encode:out:0(JPEG) : Enabling port.
2021-04-01 14:00:37.1955|DEBUG|MMALSharp|vc.ril.image_encode:out:0(JPEG) : Initialising buffer pool.
2021-04-01 14:00:37.2035|DEBUG|MMALSharp|Creating buffer pool with 1 buffers of size 81920
2021-04-01 14:00:37.2295|DEBUG|MMALSharp|vc.ril.image_encode:out:0(JPEG) : Sending buffer to output port: Length 0.
2021-04-01 14:00:37.2343|DEBUG|MMALSharp|vc.ril.image_encode:out:0(JPEG) : Sending buffer start.
2021-04-01 14:00:37.2343|DEBUG|MMALSharp|vc.ril.image_encode:out:0(JPEG) : Sending buffer complete.
2021-04-01 14:00:37.2453|DEBUG|MMALSharp|Setting shutter speed: 4000
2021-04-01 14:00:37.2453|DEBUG|MMALSharp|Setting parameter MMAL_PARAMETER_SHUTTER_SPEED
2021-04-01 14:00:37.2453|DEBUG|MMALSharp|Setting parameter MMAL_PARAMETER_CAPTURE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions