Reducing image format conversion time on STM32MP13 devices
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-07-03 2:11 AM
Hello all,
I'm using STM32MP135F-DK, taking picture with GC2145 camera and converting 1600x1200 raw image to png/jpeg formats to use later. I'm doing these according to the document at below link:
https://wiki.st.com/stm32mpu/wiki/STM32MP13_V4L2_camera_overview
I calculated how much time spent for below script:
##### 2 MP Setup
media-ctl -d /dev/media0 --set-v4l2 "'gc2145 1-003c':0[fmt:RGB565_2X8_BE/1600x1200@1/20 field:none]"
media-ctl -d /dev/media0 --set-v4l2 "'gc2145 1-003c':0[fmt:RGB565_2X8_BE/1600x1200@1/20 field:none]"
media-ctl -d /dev/media0 --set-v4l2 "'dcmipp_parallel':0[fmt:RGB565_2X8_BE/1600x1200]"
media-ctl -d /dev/media0 --set-v4l2 "'dcmipp_parallel':1[fmt:RGB565_2X8_LE/1600x1200]"
media-ctl -d /dev/media0 --set-v4l2 "'dcmipp_dump_postproc':0[fmt:RGB565_2X8_LE/1600x1200]"
##### 2 MP Capture
v4l2-ctl --set-fmt-video=width=1600,height=1200,pixelformat=RGBP --stream-mmap --stream-count=1 --stream-to=grab-1600x1200-rgb565.raw
##### 2 MP Convert
gst-launch-1.0 filesrc location= grab-1600x1200-rgb565.raw blocksize=3840000 ! "video/x-raw, format=(string)RGB16, width=(int)1600, height=(int)1200, framerate=(fraction)20/1" ! videoconvert ! pngenc ! filesink location=grab-1600x1200-rgb565_ex1.png
And the results are:
These results are too much for me. I saw that too much time spent especially on convert section.
I know that decreasing resolution might be one of the solutions, but is there any other suggestions to reduce that time?
Solved! Go to Solution.
- Labels:
-
STM32MP13 Lines
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-07-08 8:17 AM
Hello @alpka ,
Unfortunatly, no we have no other recommendation. The Galcore camera is the one we embed by default on STM32MP13 now and that is tested by ST, but we have no equivalent of the OV5640 on our side to propose. It will be up to you to chose a one that will reach your requirements.
Kind regards,
Erwan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-07-03 12:55 PM
Hi alpka
This post has been escalated to the ST Online Support Team for additional assistance. We'll contact you directly.
Kind Regards
Joe
STMicro Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-07-04 11:22 PM
Hello @alpka ,
Please find out the outcomes from the expert who took a look at your issue :
- PNG is not the best image format for a camera input stream because camera input streams are most of the time “noisy” and PNG is not efficient on noisy images. Moreover, PNG compression is slower on noisy images. Have you tried with JPEG instead on PNG ?
- PNG has several levels of compression (1 to 9, link to the zlib compression used by PNG format). You may try the level compression-level=1 for a faster compression (as the default value is 6, see https://gstreamer.freedesktop.org/documentation/png/pngenc.html?gi-language=c#pngenc:compression-level)
- PNG format does not support natively RGB565 (see https://www.w3.org/TR/PNG-Chunks.html), the videoconvert in the pipeline is used to convert from RGB565 to RGB24 (or ARGB32). Maybe you can adjust this sink value to RGB24 (see https://gstreamer.freedesktop.org/documentation/png/pngenc.html?gi-language=c#sink)
- We have to check if NEON is enabled for the videoconvert in your use case.
- We have to check if buffers are properly cacheable in your use case.
I hope it will help you yo go forward,
Kind regards,
Erwan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-07-05 1:23 PM
Hi Erwan,
Yes I tried the JPEG, and the JPEG conversion is faster than PNG. I will also check other suggestions.
As far as I know, OV5640 can directly take JPEG images but it's a end of life product. Do you have any other 5 MP camera suggestions?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-07-08 8:17 AM
Hello @alpka ,
Unfortunatly, no we have no other recommendation. The Galcore camera is the one we embed by default on STM32MP13 now and that is tested by ST, but we have no equivalent of the OV5640 on our side to propose. It will be up to you to chose a one that will reach your requirements.
Kind regards,
Erwan.
