# Stream with arv-viewer-0.8

**URL:** <https://aravis-project.discourse.group/t/stream-with-arv-viewer-0-8/510>\
**Category:** Device Support\
**Created:** [August 12, 2022, 1:59pm UTC](https://aravis-project.discourse.group/t/stream-with-arv-viewer-0-8/510 "2022-08-12T13:59:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emre](https://avatars.discourse-cdn.com/v4/letter/e/71e660/32.png) [@Emre](https://aravis-project.discourse.group/u/Emre)\
**Post date:** [August 12, 2022, 1:59pm UTC](https://aravis-project.discourse.group/t/stream-with-arv-viewer-0-8/510/1 "2022-08-12T13:59:07Z")

</div>

I have a Raspberry PI 3 b+ and a TheImagingSource DYK 33GX250 camera. However, when I open the aravis viewer, I can’t change the pixel format “PolarizedBayerGB8” and I can’t stream. How can I change the pixel format? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/emmanuel/32/198_2.png) [@Emmanuel](https://aravis-project.discourse.group/u/Emmanuel)\
**Post date:** [August 13, 2022, 12:42pm UTC](https://aravis-project.discourse.group/t/stream-with-arv-viewer-0-8/510/2 "2022-08-13T12:42:46Z")

</div>

Hi,

Aravis viewer relies on GStreamer for the conversion from the device pixel format to the display pixel format. I don’t think there is a GStreamer converter for polarized bayer.

Emmanuel.

---

<div class="post-metadata">

**Author:** ![Emre](https://avatars.discourse-cdn.com/v4/letter/e/71e660/32.png) [@Emre](https://aravis-project.discourse.group/u/Emre)\
**Post date:** [August 15, 2022, 5:43am UTC](https://aravis-project.discourse.group/t/stream-with-arv-viewer-0-8/510/3 "2022-08-15T05:43:54Z")

</div>

After that, I tried to change the pixel format by using a Python code. This is my code:

import cv2  
import time  
import logging  
import numpy as np  
import ctypes  
import gi  
import sys  
gi.require\_version(‘Aravis’, ‘0.8’)  
from gi.repository import Aravis,GLib

if **name** == “ **main** ”:  
if len(sys.argv) \> 1:  
arg= sys.argv[1]  
else:  
path = “frame.png”  
cam = Camera(None)  
cam.set\_feature(“Width”, 2448)  
cam.set\_feature(“Height”, 2000)  
cam.set\_frame\_rate(10)  
cam.set\_exposure\_time(2000000)  
cam.set\_pixel\_format(Aravis.PIXEL\_FORMAT\_BAYER\_BG\_8)  
cam.start\_acquisition\_continuous()  
try:  
frame = cam.pop\_frame()  
print("Saving image to ", path)  
frame=cv2.imread(“frame.png”)  
cv2.imwrite(path, frame)  
finally:  
cam.stop\_acquisition()  
cam.shutdown()

But unfortunately, I got a error:

cam.set\_pixel\_format(Aravis.PIXEL\_FORMAT\_BAYER\_BG\_8)  
gi.repository.GLib.GError: arv-gc-error-quark: [PixelFormat] Value 17301515 not found (4)

I can’t figure out what is the problem.

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/emmanuel/32/198_2.png) [@Emmanuel](https://aravis-project.discourse.group/u/Emmanuel)\
**Post date:** [August 15, 2022, 6:04am UTC](https://aravis-project.discourse.group/t/stream-with-arv-viewer-0-8/510/4 "2022-08-15T06:04:58Z")

</div>

If I have read correctly the camera documentation, it only supports polarized pixel formats. You should be able to verify this point using `arv-tool-0.8 features PixelFormat`.

---

<div class="post-metadata">

**Author:** ![Emre](https://avatars.discourse-cdn.com/v4/letter/e/71e660/32.png) [@Emre](https://aravis-project.discourse.group/u/Emre)\
**Post date:** [August 15, 2022, 6:47am UTC](https://aravis-project.discourse.group/t/stream-with-arv-viewer-0-8/510/5 "2022-08-15T06:47:18Z")

</div>

Thanks for your quick response. It turns out that the camera supports only the formats ‘PolarizedBayerBG16’, ‘PolarizedBayerBG12Packed’ and ‘PolarizedBayerBG8’. So, I changed the line cam.set\_pixel\_format(Aravis.PIXEL\_FORMAT\_BAYER\_BG\_8) to cam.set\_pixel\_format\_from\_string(‘PolarizedBayerBG8’). Code works but the image is grayscale. Do you have any idea why I get grayscale image instead of a coloured one?

---

<div class="post-metadata">

**Author:** ![Emre](https://avatars.discourse-cdn.com/v4/letter/e/71e660/32.png) [@Emre](https://aravis-project.discourse.group/u/Emre)\
**Post date:** [August 16, 2022, 7:22am UTC](https://aravis-project.discourse.group/t/stream-with-arv-viewer-0-8/510/6 "2022-08-16T07:22:54Z")

</div>

I also tried the line cam.set\_feature(‘PixelFormat’,‘PolarizedBayerBG8’) but it did not work either.

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/emmanuel/32/198_2.png) [@Emmanuel](https://aravis-project.discourse.group/u/Emmanuel)\
**Post date:** [August 16, 2022, 7:51am UTC](https://aravis-project.discourse.group/t/stream-with-arv-viewer-0-8/510/7 "2022-08-16T07:51:32Z")

</div>

Aravis does not convert pixel formats. It is the job of the library you are using to display or save the camera raw data, being either cv2 or gstreamer.

“Polarized” images produced by your camera are very specific, so I guess you have to code a conversion that fits your need.
