Welcome to ARx API Docs
Interacting with the camera

Getting frames

2min
use the following override function to detect each new frame override fun setonpreviewframelistener(camerainput bytearray) { } each new frame is presented as a new bytearray because the headset automatically encodes video input, the output is a bytearray containing data from both cameras in the default resolution of 1280 480p (combination of two frames with the resolution of 640 480p) the bytearray contains data in the nv21 image format in order to convert the bytearray into a bitmap you can use the following function where previewwidth and previewheight depend on the chosen resolution implying that you must keep track of your current resolution //cameraresolution sd val previewwidth = 1280 val previewheight = 480 //cameraresolution md // val previewwidth = 2560 // val previewheight = 720 //cameraresolution hd // val previewwidth = 3840 // val previewheight = 1080 fun bytearraytobitmap(bytearray bytearray?) bitmap? { val yuvimage = yuvimage(bytearray, imageformat nv21, previewwidth, previewheight, null) val os = bytearrayoutputstream() yuvimage compresstojpeg(rect(0, 0, previewwidth, previewheight), 100, os) val jpegbytearray = os tobytearray() return bitmapfactory decodebytearray(jpegbytearray, 0, jpegbytearray size) } for simplified use and flexibility, the api enables you to work directly with the raw data contained in the bytearray but also enables you to choose the camera input and resolution of the arxwear headset changing resolution docid\ t5gqizd lxkebd6xi1 la selecting camera docid\ qlrs 2oskrxcd7rxhcced