Strange image encoding with CamLink


I have connected a Canon EOS200D to a CamLink USB stick (Elgato), and I would like to obtain the video stream. The video image acquired by the camera should be correct. Using OBS, the camera image is correctly acquired.

Using OpenCV and Python, the resulting image has a strange encoding. I can not convert it and obtain a standard RGB image.

OBS image:

OpenCV image:

Steps to reproduce

import cv2
import numpy as np
import matplotlib.pyplot as plt

cap = cv2.VideoCapture(3) # select source (CamLink)

# skip a few images
for i in range(10):
    ret, frame = # read image


# display last acquired image

Operating system:

  • Ubuntu 18.04 LTS
  • Python 3.7.7
  • OpenCV : 4.4.0

Can somebody help me on this?

opencv uses BGR pixel order for images, while matplotlib expects RGB.

either try to replace the plt.imshow() call with:


or change the colorspace to RGB:

frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)

in general, mixing several img processing libs will lead to surprises !

1 Like