Take photo/video from mipi camera

How I can take a photo or video fro MPI camera in console?
Thank you!

I have: Linux Khadas 4.9.241 #8 SMP PREEMPT Sat Jan 8 09:27:25 CST 2022 aarch64 aarch64 aarch64 GNU/Linux

@dr_begemot Maybe OpenCV is a good chooise.

You can follow this guide. And remove the show function, add save function