<div dir="ltr">Hello George,<div><br></div><div>Thanks for your reply. </div><div><br></div><div>Is pipewire capable of supporting cameras generating multiple encoded streams?</div><div><br></div><div>Is it possible to have a call with your team, as per your convenience?<br></div><div><br></div><div>Thanks & Regards,</div><div>Aditya</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 13, 2023 at 9:36 PM George Kiagiadakis <<a href="mailto:george.kiagiadakis@collabora.com">george.kiagiadakis@collabora.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hi Aditya,<div><br></div><div>[replies inline]<br><div><div><br><blockquote type="cite"><div>On 13 Oct 2023, at 07:42, Aditya Kulkarni <<a href="mailto:avkulkarni304@gmail.com" target="_blank">avkulkarni304@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Hello George and Wim,<br><br>Please guide us on the queries below as well, in your reply.<br><br>1. Is it possible to enable libcamera spa plugin and v4l2 spa plugin simultaneously?<br></div></div></blockquote><div><br></div><div>Yes, both are actually enabled by default.</div><br><blockquote type="cite"><div><div dir="ltr">2. Is it possible to achieve communication between two spa-plugins, in pipewire?<br></div></div></blockquote><div><br></div><div>Yes, you can set them up as separate nodes in the graph and then link them as usual. This is the same as linking such a node to an application.</div><br><blockquote type="cite"><div><div dir="ltr">3. In the 3rd approach which you mentioned, i.e., "Use PipeWire to capture YUV from libcamera, then a GStreamer app to encode and make the stream available again in the PipeWire graph, then a separate app to stream". In this scenario, can pipewire graph handle, in case the encoded stream is requested by multiple clients at a time?<br></div></div></blockquote><div><br></div><div>Yes, it should be possible to capture this from multiple clients.</div><br><blockquote type="cite"><div><div dir="ltr">Looking forward to your reply.<br><br>Thanks & Regards,<br>Aditya<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 11, 2023 at 3:11 PM Aditya Kulkarni <<a href="mailto:avkulkarni304@gmail.com" target="_blank">avkulkarni304@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello George,<div><br></div><div>Our understanding is, in the spa v4l2 plugin we have SPA_MEDIA_SUBTYPE_h264 as SPA_TYPE_OBJECT_Format through which we can get/request h264 format from V4L2. </div><div><br></div><div>I'd request you to please give some insight whether the understanding is correct because you mentioned PipeWire’s v4l2 spa plugin only supports accessing video capture devices such as cameras, <b>with raw format only</b>. <br></div><div><br></div></div></blockquote></div></div></blockquote><div><br></div><div>Indeed, the h264 format is advertised. I may be wrong on saying it supports raw only. It can probably support anything that the camera supports. I am not sure if anyone has ever tested this, though.</div><div><br></div><br><blockquote type="cite"><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thanks & Regards,</div><div>Aditya</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 10, 2023 at 1:08 PM George Kiagiadakis <<a href="mailto:george.kiagiadakis@collabora.com" target="_blank">george.kiagiadakis@collabora.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hello Aditya,<div><br></div><div>PipeWire’s v4l2 spa plugin does not support hardware memory-to-memory devices (encoders, decoders, etc). It only supports accessing video capture devices such as cameras, with raw format only. We do not have any plans to extend this plugin to work with m2m devices, as there’s a lot of complexity around this functionality and very little gain from using PipeWire for this job instead of a more full-fledged multimedia framework, such as GStreamer.</div><div><br></div><div>Using GStreamer, this could be made so much easier. I can think of 3 different ways of doing it:</div><div><br></div><div><br></div><div>1. Use PipeWire to capture YUV from libcamera, then use a GStreamer application to encode and stream.</div><div><br></div><div>PipeWire [spa libcamera] —> Application [ pipewiresrc ! v4l2encoder ! streaming ]</div><div><br></div><div><br></div><div>2. Use GStreamer to do everything, remove PipeWire.</div><div><br></div><div>Application [ libcamerasrc ! v4l2encoder ! streaming ]</div><div><br></div><div><br></div><div>3. Use PipeWire to capture YUV from libcamera, then a GStreamer app to encode and make the stream available again in the PipeWire graph, then a separate app to stream.</div><div><br></div><div>PipeWire [spa libcamera] —> Application [ pipewiresrc ! v4l2encoder ! pipewiresink ] —> Application [ pipwiresrc ! streaming ]</div><div><br></div><div>This last option is the most complex one and only makes sense in some advanced scenarios, such as when the streaming application is containerized and you don’t want to give it access to the hardware encoder. Also, note that this option has never been tried, afaik, and there may be rough edges related to passing encoded video content through PipeWIre. But in theory it should be possible and any bugs can be fixed eventually.<br id="m_-2098681919943234154m_-2633089142631919969m_4793578714919081949lineBreakAtBeginningOfMessage"><div><br></div><div>I think that choosing one of these 3 options is a matter of understanding what PipeWire can offer in options 1 and 3 and considering what is your actual use case and goals.</div><div><br></div><div>I hope this helps.</div><div><br></div><div>Best regards,</div><div>George</div><div><br></div><div><br><blockquote type="cite"><div>On 9 Oct 2023, at 16:39, Aditya Kulkarni <<a href="mailto:avkulkarni304@gmail.com" target="_blank">avkulkarni304@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Hello Wim,<br><br>Thanks for your reply. We checked with the libcamera team on adding h264 support but they confirmed that the addition of h264 support in libcamera is out of libcamera's scope. <br><br>We are trying to find a way to achieve h264 using pipewire for our live streaming use case. <br><br>We can get encoded data from the R-Pi which has hardware encoder but libcamera has support to extract raw format. <br><br><b>What we thought is, we can get the raw format by using the libcamera spa plugin of pipewire and this raw format can be passed to v4l2 spa plugin of pipewire for encoding. Further, v4l2 spa plugin in pipewire will interact with v4l2 driver to get h264 format from R-Pi hardware encoder.</b><br><br>The High level flow diagram of the above approach has been attached to this email for your reference.<br><br>The above approach demands the usage of two spa plugins simultaneously. <br><br><b>In this scenario,<br>1. Is it possible to enable libcamera spa plugin and v4l2 spa plugin at the same time? <br>2. Is it possible to achieve inter-spa-plugin communication, in pipewire?</b><div><br></div><div>Can you please guide us on this.<br><br>We would also like to know from you, in case, there is any better approach to achieve this. <br><br>Thanks and Regards,<br>Aditya<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 31, 2023 at 7:19 PM Wim Taymans <<a href="mailto:wim.taymans@gmail.com" target="_blank">wim.taymans@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, 31 Aug 2023 at 15:38, Aditya Kulkarni <<a href="mailto:avkulkarni304@gmail.com" target="_blank">avkulkarni304@gmail.com</a>> wrote:<br>
><br>
> Hello,<br>
><br>
> We are looking for Camera live streaming using h264 format on Raspberry Pi.<br>
><br>
> We are using the Pipewire framework to interact with applications and libcamera.<br>
><br>
> But, we are facing pw.link: (39.0 -> 47.0) negotiating -> error (no more input formats).<br>
><br>
> As libcamera doesn't have H264 support, can you please guide on how to achieve H264 using pipewire, when libcamera is used.<br>
<br>
It is not possible, libcamera does not support h264.<br>
<br>
Wim<br>
<br>
><br>
> Hoping for your reply.<br>
><br>
> Thanks & Regards,<br>
> Aditya<br>
><br>
><br>
><br>
</blockquote></div>
<span id="m_-2098681919943234154m_-2633089142631919969m_4793578714919081949cid:f_lnixfmb50"><High_level_approach_diagram.png></span></div></blockquote></div></div><br><br><div>
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div>--<br>George Kiagiadakis<br>Principal Software Engineer<br><br>Collabora Ltd.<br>Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK</div><div>Registered in England & Wales, no. 5513718</div></div>
</div>
<br></div></blockquote></div>
</blockquote></div>
</div></blockquote></div><br><div>
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div>--<br>George Kiagiadakis<br>Principal Software Engineer<br><br>Collabora Ltd.<br>Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK</div><div>Registered in England & Wales, no. 5513718</div></div>
</div>
<br></div></div></div></blockquote></div>