SOLVED IMX-287M: How to synchronize video frame capture with an LED?
-
I'm using an IMX-287M on the Raspberry Pi 5 to record video at over 500 FPS.
I'm using an LED PCB to light the scene.
The LED PCB is controlled by the Raspberry Pi 5.
The LED PCB can be turned on by setting a Pi 5 GPIO pin to 1 and it can be turned off by setting the GPIO pin to 0.How can I synchronize the video capture on the IMX-287M to the GPIO pin of the Pi 5 so that the LED PCB turns on when the IMX-287M is capturing a video frame (during exposure) and turns off the rest of the time?
That it, how can I turn on/off the LED PCB in sync with the video capture of the IMX-287M?
-
- If your IMX287 is running in stream mode, please use the upgrade package from the following link for the upgradeļ¼
https://www.mediafire.com/file/d4yjibcjp1hw8z8/MV-MIPI-IMX287M_C1.37_L2.04_20240306_beta_upgrade.bin/file - The camera will generate its own strobe synchronization signal. I suggest using this signal to drive your LED instead of using the Raspberry Pi's IO. For more details on the principle, please refer to the following link:
https://wiki.veye.cc/index.php/Mv_mipi_camera_manual#Strobe - On the ADP-MV1 board, the J3-5 pin will output the strobe signal by default.
https://wiki.veye.cc/index.php/ADP-MV1_Adapter_Board_Data_Sheet/zh
- If your IMX287 is running in stream mode, please use the upgrade package from the following link for the upgradeļ¼
-
Hi. Thank you very much for your reply.
It worked.
(Edited to add answers.)-
I downloaded the bin file, but how do I use/run/apply it?
Answer. This explains it: https://wiki.veye.cc/index.php/Mvcam_firmware_update_manual -
What is stream mode?
Do you mean the result you get when you run: ./mv_mipi_i2c.sh -r -f trgmode -b 6
In that case, I'm in mode 0 (Video streaming mode). Is this what you were asking?
I'm configuring the camera using: v4l2-ctl --set-ctrl frame_rate={framerate} -d {subdevice}
And I'm reading frames in C using v4l2_open(), v4l2_mmap(), etc. -
Do I need to turn some strobe setting using the I2C interface in order to activate the strobe?
Answer. No, I think. I think you only need to make sure you're in streaming mode, but that's the default I think.
-
-
I'm now trying to change the strobe duration, but I'm unable to.
The strobe is synced with the framerate and the strobe duty cycle is about 4%, but I'd like to increase it.
I'm trying to do:./mv_mipi_i2c.sh -r -f trgexp_delay -b 6
./mv_mipi_i2c.sh -r -f trginterval -b 6and I'm reading back those values to verify that they have changed, but the strobe duration doesn't seem to be changing.
-
@etale_cohomology said in IMX-287M: How to synchronize video frame capture with an LED?:
./mv_mipi_i2c.sh -r -f trgexp_delay -b 6
./mv_mipi_i2c.sh -r -f trginterval -b 6In video streaming mode, these two parameters do not take effect. The camera will output the strobe control signal based on the actual exposure time, whether it is in manual exposure mode or automatic exposure mode.
-
@veye_xumm Okay, thank you very much for the replies.