Cameras & sensorsTroubleshooting

Camera pixel format not changing: why it is fixed and how to set it

Why a pixel format stays fixed or resets, how resolution and frame rate profiles limit the choices, and a step-by-step way to set a format that sticks.

LumaSpec Vision7 min read Share on LinkedIn

On this page 9 sections
  1. 01First check: is the format fixed by the wrapper?
  2. 02Second check: is the profile limiting the format?
  3. 03Third check: is the parameter applied at startup?
  4. 04Choosing a format on purpose
  5. 05Parts that make this concrete
  6. 06When the usual answer is wrong
  7. 07Quick checklist
  8. 08Next step
  9. 09Questions

You set the pixel format parameter, restart the camera, and the stream still arrives in the old format. In most cases nothing is broken: the format is fixed by the software layer in front of the camera, restricted by the resolution and frame rate profile you selected, or the parameter simply does not exist in the version you are running. This guide walks through the three causes in order of likelihood, gives a test for each, and shows how to set a format that survives a restart.

First check: is the format fixed by the wrapper?

Many camera drivers and ROS or SDK wrappers declare their own stream formats and expose no format parameter at all. A typical fixed mapping is RGB for the color stream, 16-bit depth for a depth stream, and 8-bit for infrared. When the mapping is fixed, no parameter exists to change it, and dumping the node's parameters shows nothing about format. That is the tell: if the parameter is absent from the dump entirely, you are not setting it wrong, it is not there.

The test takes minutes. Stop the node, list every declared parameter, and search for "format". If nothing matches, check the vendor's release notes and issue tracker for the parameter name. Format selection parameters are often added in newer branches, so an update from the vendor can make an impossible change possible. Our article on unsupported Bayer pixel format: diagnose a blank preview covers the companion case, where the parameter exists but the viewer rejects the format.

Second check: is the profile limiting the format?

When a format parameter does exist, it is almost never independent. Cameras expose profiles: a width, a height and a frame rate, and each profile supports only a subset of pixel formats. Set 1280 by 720 at 15 fps and one list of formats is valid; set 1920 by 1080 at 30 fps and a different list is valid. Setting the format without matching the profile either fails silently or reverts on the next acquisition start.

The vendor's enumeration tool or API call is the authority here. It prints every profile together with the formats supported for that profile. Work from that list, not from guesswork. The same negotiation logic on plain USB3 and GigE cameras is covered step by step in USB camera format negotiation: diagnose rejected modes.

A useful rule of thumb before you choose: the data rate is roughly

bitrate ≈ width × height × fps × bytes per pixel

For a 12 MP camera at 30 fps in an 8-bit mono format that is about 4000 × 3000 × 30 × 1 ≈ 360 MB/s, which already exceeds what GigE can carry; USB3 can just manage it. A 3-byte color format at the same profile triples the demand, which is why high-resolution color cameras pair with 10GigE or CoaXPress interfaces. The camera resolution calculator helps you size the resolution before you lock a profile.

Third check: is the parameter applied at startup?

Some wrappers only read the format parameter when the stream is created, so a change made at runtime is ignored. If your format change takes effect after a full node restart but not live, that is the cause: stop acquisition, set format, profile, width, height and frame rate together, then start.

  1. Stop the stream and the node completely.
  2. Update the driver or wrapper to the current vendor release.
  3. Enumerate the device and list every profile with its supported formats.
  4. Choose a profile-and-format pair from that list.
  5. Set the profile parameters first, then the format parameter.
  6. Start the node and read the format back from the device, not from your saved configuration.
  7. Verify the image in a viewer and confirm the pixel depth you expect.

Step 6 matters more than it looks. Saved settings can drift from what the device accepted, which is the subject of camera startup frame rate: verify saved settings and readback. The same readback discipline applies to format.

Choosing a format on purpose

Once the mechanics work, pick the format from the application, not from habit:

  • 8-bit mono (Mono8) for measurement, gauging and most defect detection: smallest bandwidth, no color information needed.
  • RGB or BGR 8-8-8 when a color classification or a human-facing display needs true color.
  • Bayer formats (RGGB and friends) when you want the raw mosaic and will demosaic yourself; they carry color at roughly one byte per pixel.
  • YUV or YCbCr variants when a video-oriented consumer pipeline expects them; avoid them for measurement because chroma subsampling discards detail.

If your color decision keeps flickering with ambient light, monochrome color sorting under changing ambient light shows when mono plus filtered light beats a color format outright.

Parts that make this concrete

A 12 MP rolling-shutter camera on USB3 covers the profile space most lines need:

Area scan cameras12 MP USB3 area scan camera, IMX226, 1/1.7" rolling shutter, 30 fps, 4000 × 3000 resolution (LS-CMR-0166)LS-CMR-0166
Sensor format
1/1.7"
Interface
USB3
Resolution
12 MP
Shutter
Rolling
$560.00View partBuild a system with it

For higher resolution over GigE where bandwidth forces the format choice, a 20 MP model is the trade point:

Area scan camerasHikrobot MV-CS200-10GC 20 MP Area Scan Camera, GigE, IMX183, Color, BasicMV-CS200-10GC
Sensor format
1"
Interface
GigE
Resolution
16-25 MP
Shutter
Rolling
$739.00View partBuild a system with it

Both are listed in the area scan cameras category, and the camera finder filters by interface, resolution and shutter so you can shortlist parts that support the format you need. When the camera choice ripples into the rest of the build, the system configurator pairs camera, lens and cabling in one pass.

When the usual answer is wrong

Two cases look like format problems but are not. First, a blank or garbage image after a format change is often an endianness or layout mismatch in the consumer, not a failed set; the image data is fine, your decoder is reading the wrong layout. Second, a format that reverts after a power cycle points to the camera loading a stored user set that overrides your startup values. Set the parameters after the user set loads, or rewrite the user set itself. For a clean baseline before either test, reset camera settings programmatically before capture gives a repeatable starting point.

Quick checklist

  • Parameter missing from the dump: update the wrapper, restart, list all declared parameters.
  • Parameter present but ignored: stop the stream before setting the format.
  • Change reverts: match the profile (width, height, fps) to the format from the enumeration list.
  • Bandwidth error: recalculate the data rate for the new bytes-per-pixel value.
  • Still wrong after restart: read the value back from the device and check for a stored user set.

Next step

If you have worked through the checks and the format still will not take, send us the enumeration output and the parameter dump through the contact page, or use the camera configurator to spec a part whose supported formats match your pipeline. Our GigE Vision stream timeout guide is the next read when the format is right but the stream drops.

Questions

Why does my pixel format parameter not appear in the parameter list?

The wrapper or driver version you are running may predate the format parameter, or the parameter is only registered when the stream it controls is enabled. Update to the current release from the vendor, restart the node so parameters are re-declared, and list all declared parameters before assuming the camera cannot do it.

Can I set pixel format while the camera is streaming?

Usually not. Most machine-vision cameras require the stream to be stopped before AcquisitionPixelFormat or an equivalent control accepts a new value. Stop acquisition, set the format, set a matching resolution and frame rate, then restart and read the value back to confirm it stuck.

How do I know which pixel formats my resolution and frame rate support?

Use the camera vendor's enumeration tool or API call that lists device profiles. It reports each width, height and frame rate combination together with the formats valid for it. Pick a combination from that list rather than setting the format first and hoping the profile follows.

Does the pixel format affect frame rate and bandwidth?

Yes. A 3-byte-per-pixel format moves roughly three times the data of an 8-bit mono format at the same resolution and frame rate. On USB3 and GigE cameras the interface bandwidth can force a lower frame rate or a compressed format, so check the data rate calculation before you commit to a format.