<div dir="ltr">Greetings,<div>I am attempting to capture a frame from a stream, much like the example listed here:</div><div><a href="https://github.com/rubenrua/GstreamerCodeSnippets/blob/master/C/takepic.c">https://github.com/rubenrua/GstreamerCodeSnippets/blob/master/C/takepic.c</a><br></div><div><br></div><div>In the part of the code where the actual frame is captured and converted is this:</div><div><br></div><div><table class="gmail-highlight gmail-tab-size gmail-js-file-line-container" style="box-sizing:border-box;border-collapse:collapse;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box"><td id="gmail-LC123" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;word-wrap:normal;white-space:pre"> <span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">g_object_get</span> (data->sink, <span class="gmail-pl-s" style="box-sizing:border-box;color:rgb(3,47,98)"><span class="gmail-pl-pds" style="box-sizing:border-box">"</span>last-sample<span class="gmail-pl-pds" style="box-sizing:border-box">"</span></span>, &from_sample, <span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">NULL</span>);
<table class="gmail-highlight gmail-tab-size gmail-js-file-line-container" style="box-sizing:border-box;border-collapse:collapse;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;white-space:normal"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box"><td id="gmail-LC124" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;word-wrap:normal"><span class="gmail-pl-k" style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre;box-sizing:border-box;color:rgb(215,58,73)">if</span><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre"> (from_sample == </span></font><span class="gmail-pl-c1" style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre;box-sizing:border-box;color:rgb(0,92,197)">NULL</span><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre">) {
</span></font><span class="gmail-pl-c1" style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre;box-sizing:border-box;color:rgb(0,92,197)">   GST_ERROR</span><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre"> (</span></font><span class="gmail-pl-s" style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre;box-sizing:border-box;color:rgb(3,47,98)"><span class="gmail-pl-pds" style="box-sizing:border-box">"</span>Error getting last sample form sink<span class="gmail-pl-pds" style="box-sizing:border-box">"</span></span><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre">);
   return;
}
caps = </span></font><span class="gmail-pl-c1" style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre;box-sizing:border-box;color:rgb(0,92,197)">gst_caps_from_string</span><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre"> (</span></font><span class="gmail-pl-s" style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre;box-sizing:border-box;color:rgb(3,47,98)"><span class="gmail-pl-pds" style="box-sizing:border-box">"</span>image/png<span class="gmail-pl-pds" style="box-sizing:border-box">"</span></span><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre">);
to_sample = </span></font><span class="gmail-pl-c1" style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre;box-sizing:border-box;color:rgb(0,92,197)">gst_video_convert_sample</span><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre"> (from_sample, caps, GST_CLOCK_TIME_NONE, &err);

And then it continues to create a file. Now this all works perfectly 
as it is listed here. But I need to save my files as bitmaps. So I change
the caps definition to:
caps = gst_caps_from_string ("image/bmp");
This works, but calling gst_video_convert_sample returns an error, that when
printed out states:
Cannot find any image encoder for caps image/bmp.</span></font>

<font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre">When I do gst-inspect-1.0 | grep bmp, I get this:</span></font>
<br><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre">libav:  avdec_bmp: libav BMP (Windows and OS/2 bitmap) decoder
libav:  avenc_bmp: libav BMP (Windows and OS/2 bitmap) encoder
typefindfunctions: image/vnd.wap.wbmp: no extensions
typefindfunctions: image/bmp: bmp

Should I be seeing something more? Should my libav encoder support this?

Thanks,
Jack D.

</span></font></td></tr><tr style="box-sizing:border-box"><td id="gmail-L125" class="gmail-blob-num gmail-js-line-number" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;line-height:20px;color:rgba(27,31,35,0.3);text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC125" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;word-wrap:normal;white-space:pre"></td></tr></tbody></table><br></td></tr></tbody></table></div></div>