ov9281 UC-599 Exposure Time Mapping V4L2_CID_EXPOSURE

Hello what is the Mapping of V4L2_CID_EXPOSURE (min: 0, max: 65535) to milliseconds or us ?

I. e. what is the default pixel clock and how to convert to exposure time in seconds?

Or, what is the minimum exposure time in useconds?


The value means the number of exposure line.

About the time of each line, which is depend on the pix clock. About the pix clock, it is depend on the xclk and PLL, which is not easy to calculate the pix clock.



could you provide an example with factory defaults? What is the formula?


We don’t have the formula, we need the factory provide us the sensor register data sheet.


Since about a year has passed … are there any news on this one? For a project, I need the absolute exposure times.


About the absolute exposure, we need to know the detail pixel clock

(PCK= hts * vts * framerate) .

Then The time per line = (value of hts)* (1/PCK).

Then the exposure time = (exposure line) * (time per line ).

Hope my answer will help you.



Thanks for your reply! How is the PCK dependant on the framerate? And what do I calculate if I am using the external trigger?

Also, what values is libarducam_mipicamera.so using for hts and vts?


Due to the sensor’s different resolution has different PCK,we adopt this way to ensure each mode’s PCK. In fact, this is a backward derivation method. The PCK will not change if the same configure whether it the streaming mode or the external trigger mode.

Feel free to let me know if you need more help.



Thanks again! But do I get this right, PCK is generated by the device PLL which works according to the settings that the Arducam userspace driver generates. Do you have a value for that?

Also, what exactly are hts and vts? From the formulas I assume these correlate with the resolution setting. Is that correct? I would really appreciate a detailed description on how to calculate the exposure time, or maybe even a portion of the sensor’s datasheet.


You are welcome. Yes you are right. The hts and vts does correlate with the resolution but as normal it should equal or more than resolution.

About the value of the hts and vts, you can read the below register

Notice, different resolution have different value. You can use

int arducam_read_sensor_reg(CAMERA_INSTANCE camera_instance, uint16_t address, uint16_t *value); to read the real value.

Thank you for your help! Here are the hts and vts values that I read out for the modes I use:

  • mode: 11, width: 1280, height: 800, pixelformat: GREY, desc: Used for ov9281 2lanes raw8 1280x800 external trigger mode hts=728, vts=910
  • mode: 12, width: 1280, height: 800, pixelformat: Y10P, desc: Used for ov9281 2lanes raw10 1280x800 external trigger mode hts=1465, vts=910
  • mode: 13, width: 1280, height: 720, pixelformat: GREY, desc: Used for ov9281 2lanes raw8 1280x720 external trigger mode hts=728, vts=910
  • mode: 14, width: 640, height: 400, pixelformat: GREY, desc: Used for ov9281 2lanes raw8 640x400 external trigger mode hts=728, vts=904
  • mode: 15, width: 320, height: 200, pixelformat: GREY, desc: Used for ov9281 2lanes raw8 320x200 external trigger mode hts=728, vts=904
That does not really look like correlation with the resolution (see mode 11 and 13, same values, different resolution) and in several modes hts is in fact lower than the resolution (mode 11 and 13).

Do you have a testpoint on pad or something on your UC-599 exposing some kind of flash pin, so I can verify the exposure time with an oscilloscope?

One missing piece in the equation is still the PCK. I have seen, you seem to use a 24 MHz crystal on the UC-599 module. Is that correct? And does this generate PCK, so PCK=24MHz?


For the mode11 and mode 13, which should be the configuration’ error. As normal, if the hts is shorter than the width, it should use the width value as HTS. The 24Mhz is xclk instead of pixel clock. You can use hts * vts * framerate to get pixel clock.

We don’t have testpoint on pad.

Thanks, I filed an issue on github for the hts values.

Since I am using external trigger, the approach with the framerate is impractical for me. I understand, that you do not want to dig into details here to protect your ip, but calibrated exposure times are really important (not just for me). So could you please tell me how to calculate or read out the pixel clock?


Yes, I know what you mean. I will discuss this issue with our partners and we will provide our customers more sensor’s information.

Hi Bin, I have the same question. Perhaps you could give us an example?

With the following settings, what would the exposure time be for the whole frame (in ms)?

Camera model: OV9281-UC599

Mode 16: (width: 1280, height: 800, pixelformat: GREY, desc: Used for ov9281 2lanes raw8 1280x800 external trigger mode)

60Hz external trigger.

Gain 13, exposure 100

Driver: libarducam_mipicamera

Computer: Raspberry pi 4

Here’s my attempt to calculate the value using your equations:

I read HTS and VTS, they are 0x2D8 (728), and 0x38E(910). 728 is the wrong value and the value that will actually be used is 1280.

910(VTS) * 1280(HTS) * 60Hz(Frame rate) = 69.888 MHz Pixel Clock

Time per line = 1280 (HTS)/69.888E6(Pixel Clock)
Time per line = 1.83E-5 Seconds = 18.31 uS
Exposure time = 100(exposure setting, aka “exposure line”) * 18.31uS (time per line)
Exposure time = 1.83 ms

Is that correct?



I think you are right.