<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[UnitCam quality and compression settings missing for Arduino and Core2]]></title><description><![CDATA[<p dir="auto">Unfortunately I didn't find any possibility to change the resolution of the <a href="https://docs.m5stack.com/en/unit/unit_cam" target="_blank" rel="noopener noreferrer nofollow ugc">UnitCam</a> (in the official <a href="https://github.com/m5stack/M5-ProductExampleCodes/blob/master/Unit/UNIT_CAM/CAM2CORE/CAM2CORE.ino" target="_blank" rel="noopener noreferrer nofollow ugc">example</a> for the Core2). I need RGB instead of Jpeg encoding, as stated in the docs.</p>
<p dir="auto">I would like to adapt the <code>esp_camera.h</code> from <a href="https://github.com/m5stack/M5Stack-Camera#initialization" target="_blank" rel="noopener noreferrer nofollow ugc">older camera libraries</a> but it is completely different to the current example, though the hardware seems to be the same.</p>
<p dir="auto">Hopefully someone can help..</p>
]]></description><link>https://community.m5stack.com/topic/4762/unitcam-quality-and-compression-settings-missing-for-arduino-and-core2</link><generator>RSS for Node</generator><lastBuildDate>Mon, 04 May 2026 00:01:18 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/4762.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 28 Oct 2022 21:35:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to UnitCam quality and compression settings missing for Arduino and Core2 on Thu, 03 Nov 2022 22:39:49 GMT]]></title><description><![CDATA[<p dir="auto">Thanks  lot <a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a>, I really appreciate.</p>
<p dir="auto">I had guessed the output format can also simply be changed by writing to the ov2640 register. At least it says it on the main page, that the other settings would be available.</p>
<p dir="auto">Anyways, I am fine with working with jpg, but unfortunately I cannot reproduce the jpeg yet in an RGBA8 texture with the given resolution from the provided buffer (~8000 bytes). The photo taken is just white/grey.</p>
<p dir="auto"><img src="/assets/uploads/files/1667220436017-8224550e-e22d-41b3-90ed-9e59588730eb-grafik.png" alt="0_1667220298210_8224550e-e22d-41b3-90ed-9e59588730eb-grafik.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1667220583609-0cf88125-bb78-4c0a-9827-97a54f63315b-grafik-resized.png" alt="0_1667220428253_0cf88125-bb78-4c0a-9827-97a54f63315b-grafik.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I am just sending the uint8_t buffer over Serial<br />
<code>for (uint32_t i = 0; i&lt;frame.size; i++) {        Serial.write( frame.buf[i] ); }</code>, and read the bytes to a texture, while filtering for Jpeg Start <code>ff d8</code> and Stops <code>ff d9</code> (which I find).<br />
<img src="/assets/uploads/files/1667221062882-ee39c219-d6c9-44ee-8297-692ab61868f1-grafik.png" alt="0_1667220924758_ee39c219-d6c9-44ee-8297-692ab61868f1-grafik.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The length / size of the buffer ~1000-3000  for the 160x140 resolution, seems suspiciously low though, compared to the relatively good image shown on the Core2 display. Hm.. I assume the buffer has to be uncompressed based on compression settings found in the Jpeg header bytes..</p>
<p dir="auto">-- Got it working by decompressing jpeg</p>
]]></description><link>https://community.m5stack.com/post/19171</link><guid isPermaLink="true">https://community.m5stack.com/post/19171</guid><dc:creator><![CDATA[swiminthesky]]></dc:creator><pubDate>Thu, 03 Nov 2022 22:39:49 GMT</pubDate></item><item><title><![CDATA[Reply to UnitCam quality and compression settings missing for Arduino and Core2 on Mon, 31 Oct 2022 06:07:21 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/swiminthesky" aria-label="Profile: swiminthesky">@<bdi>swiminthesky</bdi></a></p>
<p dir="auto">I've extended the Cam2Core example to show how to send commands to the camera. You can find it <a href="https://github.com/felmue/MyM5StackExamples/tree/main/M5Stack/Cam2CoreExtended" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
<p dir="auto">The API allows to change many settings, including resolution and quality. However I don't think it includes a way to switch the encoding. JPEG seems to be hardcoded into the camera firmware.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/19168</link><guid isPermaLink="true">https://community.m5stack.com/post/19168</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Mon, 31 Oct 2022 06:07:21 GMT</pubDate></item><item><title><![CDATA[Reply to UnitCam quality and compression settings missing for Arduino and Core2 on Sun, 30 Oct 2022 23:43:14 GMT]]></title><description><![CDATA[<p dir="auto">Also I can't find out the default resolution of the camera :/</p>
<p dir="auto">I just found the device control register list for the ov2640. But I have to figure out how to write to the registers via Core2/ESP32</p>
<p dir="auto"><img src="/assets/uploads/files/1667169885701-ecc89c74-87c1-43b9-a04d-802becf19061-grafik-resized.png" alt="0_1667169748991_ecc89c74-87c1-43b9-a04d-802becf19061-grafik.png" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1667168942556-68f6083f-56cc-41ac-9ae0-5ab50f112030-grafik-resized.png" alt="0_1667168805826_68f6083f-56cc-41ac-9ae0-5ab50f112030-grafik.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The older esp_camera.h is getting camera addresses and configs from <a href="https://github.com/espressif/esp32-camera/blob/master/driver/include/sensor.h" target="_blank" rel="noopener noreferrer nofollow ugc">sensor.h</a> (OV2640 is on 0x26 there)</p>
]]></description><link>https://community.m5stack.com/post/19165</link><guid isPermaLink="true">https://community.m5stack.com/post/19165</guid><dc:creator><![CDATA[swiminthesky]]></dc:creator><pubDate>Sun, 30 Oct 2022 23:43:14 GMT</pubDate></item></channel></rss>