<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Glad it worked!<div class=""><br class=""></div><div class="">If you want to overlay a picture (like the thermal bar in that GIF), you can check the <a href="https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good/html/gst-plugins-good-plugins-gdkpixbufoverlay.html" class="">gdkpixbufoverlay</a> element. If you also want to add a border to the image so that the overlay doesn’t cover part of the image, you may look at the <a href="https://gstreamer.freedesktop.org/documentation/videobox/index.html?gi-language=c" class="">videobox</a> element. By setting the “right” property to a negative value, you’ll add a black border to the right of the image.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 18 Jul 2021, at 05:09, Guennadi Liakhovetski <<a href="mailto:g.liakhovetski@gmx.de" class="">g.liakhovetski@gmx.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On Sat, 17 Jul 2021, Michael Gruner wrote:<br class=""><br class=""><blockquote type="cite" class="">The default is to only allow the same format. You need to reimplement<br class="">the transform_caps virtual method in order to change the format. (note<br class="">that transform_caps is a basetransform method).<br class=""></blockquote><br class="">Great, this works! Thanks very much! I've got a colour-coded image now.<br class="">Ideally - if not too much work - I'd also like to get numeric temperature<br class="">information like on the side bar in the GIF on<br class=""><a href="https://github.com/makerportal/raspi-thermal-cam" class="">https://github.com/makerportal/raspi-thermal-cam</a> or maybe in an additional<br class="">in-frame metadata channel. I found a discussion here<br class=""><a href="https://developer.ridgerun.com/wiki/index.php/GStreamer_and_in-band_metadata" class="">https://developer.ridgerun.com/wiki/index.php/GStreamer_and_in-band_metadata</a><br class="">but that doesn't seem to have made it to the mainline. I guess the most<br class="">user-friendly would be adding a side bar like in the former link. It<br class="">should be possible to extend the width of the image and overlay that kind<br class="">of information, right?<br class=""><br class="">Thanks<br class="">Guennadi<br class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">On 17 Jul 2021, at 13:50, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:<br class=""><br class="">Hi Michael,<br class=""><br class=""><blockquote type="cite" class="">On Sat, 17 Jul 2021, Michael Gruner wrote:<br class=""><br class="">Hi Guennadi<br class=""><br class="">The videoconvert element can already handle this conversion for you:<br class=""><br class="">gst-launch-1.0 v4l2src ! videoconvert ! video/x-raw,format=RGB ! …<br class=""></blockquote><br class="">Yes, I know about videoconvert, but I need to do some special processing<br class="">of thermal data. For the algorithms to work I have to access the raw data,<br class="">which is output by the v4l2 driver in GRAY16_BE format (1-to-1 from the<br class="">camera), and I want to transform that to a colour gradient similar to well<br class="">known thermal images, so my plugin cannot just stay within GRAY16_BE and<br class="">use videoconvert to convert that to RGB - you'd just get a gray image of<br class="">course.<br class=""><br class=""><blockquote type="cite" class="">If you, for other reason, need to write your own element, you probably<br class="">want to use the videofilter base class. It’s a specialization of the<br class="">basetransform class for video. The important virtual method for you to<br class="">implement is “transform_caps”, that will allow you to specify the input<br class="">and output caps respectively.<br class=""></blockquote><br class="">The videofilter class is "allowed" to convert between formats? I thought<br class="">it would be, so I actually tried it. But I was unable to get it to input<br class="">and output different formats. I was only able to get it to work with the<br class="">same format. Are you sure that is supposed to work?<br class=""><br class="">Thanks<br class="">Guennadi<br class=""><br class=""><blockquote type="cite" class="">Michael<br class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">On 17 Jul 2021, at 05:05, Guennadi Liakhovetski via gstreamer-devel <gstreamer-devel@lists.freedesktop.org> wrote:<br class=""></blockquote><br class="">Hi,<br class=""><br class="">I'm trying to write a plugin to convert data from a thermal camera. It<br class="">should take data from the v4l2src source in GRAY16_BE format and convert<br class="">it to an RGB video output. I'm looking at gst-element-maker but I'm not<br class="">finding any suitable base class that would take video/x-raw as input and<br class="">generate the same as output and would convert between format. Do I have to<br class="">write a plugin from scratch? Or should I use basetransform? Any tutorials<br class="">for that?<br class=""><br class="">Thanks<br class="">Guennadi<br class="">_______________________________________________<br class="">gstreamer-devel mailing list<br class="">gstreamer-devel@lists.freedesktop.org<br class="">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel<br class=""></blockquote><br class=""></blockquote></blockquote><br class=""></blockquote></div></div></blockquote></div><br class=""></div></body></html>