Using Raspberry Pi MIPI Cameras with Rock Pi4


Hi everyone,

I am trying to use the 15pin MIPI cameras with the Rock Pi board. Can someone help me set it up? Are there any drivers for this?



Hi, Rohan

Which camera are you using? This one works out of box on ROCK Pi 4 with Android All image and Debian Desktop image:


Okay, I will see if I can use the one I have. It’s an IR camera:


Hi Jack,

Are there documentations available for using the pi camera on Debian Desktop? Something like


Hi, Mickey

The doc is awesome. I am sorry currently we don’t have a doc like that. So you prefer to use python to capture the images? We support standard gstreamer, I think we will write the camera docs based on the python gstreamer binding.


I have used gstreamer before. Python binding is useful but it’s fine if you don’t have it right now. Could you share whatever doc you have on using the camera so that we can get started once we get the boards on Thursday? What we need include setting camera gain and exposure time, take images and videos (preferably with hardware encoding). And on what linux distribution is the camera supported? Debian Desktop or Ubuntu server or both?



@jack, Is hardware accelerated video capture is supported? If yes, can you please share gstreamer command line to capture video with hardware acceleration (any sink)?

Regards, Alex


Hi, Volax

I am not a gstreamer expert but here are some links you can refer:

The gstreamer-rockchip-extra package is pre-installed in the debian desktop image(not in the ubuntu server image).


I’d like to report that the following command is working (w/ pi camera v2.1):

gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080 ! rkximagesink

Before trying the command I did the following:
sudo apt-get install git gcc make texinfo libncurses5-dev libexpat1-dev flex bison dejagnu libc6-dbg gdb valgrind


Hi Mickey, it’s great that you got it working! I tried to do the same, but I wasn’t able to compile rockchip-gstreamer-extras successfully. I tried following the instructions by @lex on this page: Can you elaborate further about how to get it working with Ubuntu 18.04?


For armhf image, we have pre-installed the gstreamer-rockchip-extra package. For Ubuntu 18.04 arm64, you can just install the gstreamer-rockchip-extra package from:


Hi themathgeek13, I used the debian desktop image ( where gstreamer is preinstalled.


I get this error:

WARNING: erroneous pipeline: no element “rkximagesink”

I do not understand what it about.

Before i also have to install

sudo apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio

and after

sudo apt-get install git gcc make texinfo libncurses5-dev libexpat1-dev flex bison dejagnu libc6-dbg gdb valgrind



Is tis model supported by the rockpi 4b

Raspberry Pi night vision camera , compatible with Raspberry Pi 3B+/3/2

5 million pixel OV5647 camera

Camera specification:

Lens : 1/4 5M

Aperture (F): 1.8

Focal length (Focal Length): 3.6MM ( adjustable)

FOV (Diagonal): 60 degrees

Best pixel sensor : 1080p

Size : 25mm x 24mm x 22mm


@Pierre, I am also trying the same camera. But after installing the gstreamer-rockchip-extra package successfully from the repository given by @jack above, it still does not work for me, I get an error saying “unable to allocate memory” and the pipeline shuts down without showing any output on the display. Can someone help to resolve this? I think all the necessary packages are installed, and I also upgraded to the latest Radxa kernel version for Ubuntu Server 18.04.


So far, we don’t support this sensor, yet. We support ov5645 but ov5647 is not tested. I suggest to test on Debian Stretch armhf desktop first. It’s pre-installed all the packages with gstreamer and proven working with ov5645 and imx219.


Hi @jack, @themathgeek13,
I found this: , and finaly (Maybe this can help)
But so far am unable to make the camera work. I am on the latest Ubuntu Image.
Is there a guide or Howto to writing a driver/kernel module for our cameras?



Hi, Pierre

I am glad that you would like to get the ov5647 sensor working. I think basically, you can just use the ov5647 dirver from the kernel and configure the rockpi4 dts fowlloing imx219 part.

ov5647 driver is in the kernel now.

and imx219 device tree:

For how to compile the kernel:


thanks i will try it


When i did the install with dpkg -i linux-image-4.4.154-999-rockchip-_all.deb linux-firmware-image-4.4.154-999-rockchip-_all.deb

It installed it on the emmc and it would not boot from the SSD. I had to re-edit the > Edit /boot/extlinux/extlinux.conf

But now I am wondering if I install it correctly.

When I did a dmesg | grep cam or vid
I do not see the cam detected.
I do not see any modules available in the directory to load in the kernel

@jack can you give me a Hit on what I did incorrectly Thanks!

@ themathgeek13 Did you get a chance to try this? Did it work?