<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Base-Art - Philippe Normand</title><link href="https://base-art.net/" rel="alternate"></link><link href="https://base-art.net/feeds/philippe-normand.atom.xml" rel="self"></link><id>https://base-art.net/</id><updated>2024-04-16T22:15:00+02:00</updated><entry><title>From WebKit/GStreamer to rust-av, a journey on our stack’s layers</title><link href="https://base-art.net/Articles/from-webkitgstreamer-to-rust-av-a-journey-on-our-stacks-layers/" rel="alternate"></link><published>2024-04-16T22:15:00+02:00</published><updated>2024-04-16T22:14:33+02:00</updated><author><name>Philippe Normand</name></author><id>tag:base-art.net,2024-04-16:/Articles/from-webkitgstreamer-to-rust-av-a-journey-on-our-stacks-layers/</id><summary type="html">&lt;p&gt;In this post I&amp;#8217;ll try to document the journey starting from a WebKit issue and
ending up improving third-party projects that WebKitGTK and WPEWebKit depend&amp;nbsp;on.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve been working on WebKit&amp;#8217;s GStreamer backends for a while. Usually some new
feature needed on WebKit side would trigger work …&lt;/p&gt;</summary><content type="html">&lt;p&gt;In this post I&amp;#8217;ll try to document the journey starting from a WebKit issue and
ending up improving third-party projects that WebKitGTK and WPEWebKit depend&amp;nbsp;on.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve been working on WebKit&amp;#8217;s GStreamer backends for a while. Usually some new
feature needed on WebKit side would trigger work on GStreamer. That&amp;#8217;s quite
common and healthy actually, by improving GStreamer (bug fixes or implementing
new features) we make the whole stack stronger (hopefully). It&amp;#8217;s not hard to
imagine other web-engines, such as Servo for instance, leveraging fixes made in
GStreamer in the context of WebKit&amp;nbsp;use-cases.&lt;/p&gt;
&lt;p&gt;Sometimes though we have to go deeper and this is what this post is&amp;nbsp;about!&lt;/p&gt;
&lt;p&gt;Since version 2.44, WebKitGTK and WPEWebKit ship with a
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/WebCodecs_API"&gt;WebCodecs&lt;/a&gt;
backend. That backend leverages the wide range of GStreamer audio and video
decoders/encoders to give low-level access to encoded (or decoded) audio/video
frames to Web developers. I delivered a &lt;a href="https://gstconf.ubicast.tv/videos/webcodecs-in-webkit-with-gstreamer/"&gt;lightning
talk&lt;/a&gt; at
gst-conf 2023 about this&amp;nbsp;topic.&lt;/p&gt;
&lt;p&gt;There are still some issues to fix regarding performance and some &lt;span class="caps"&gt;W3C&lt;/span&gt; web
platform tests are still failing. The &lt;span class="caps"&gt;AV1&lt;/span&gt; decoding tests were flagged early on
while I was working on WebCodecs, I didn&amp;#8217;t have time back then to investigate
the failures further, but a couple weeks ago I went back to those specific&amp;nbsp;issues.&lt;/p&gt;
&lt;p&gt;The WebKit layout tests harness is executed by various post-commit bots, on
various platforms. The WebKitGTK and WPEWebKit bots run on Linux. The WebCodec
tests for &lt;span class="caps"&gt;AV1&lt;/span&gt; currently make use of the GStreamer &lt;code&gt;av1enc&lt;/code&gt; and
&lt;a href="https://gstreamer.freedesktop.org/documentation/dav1d"&gt;dav1ddec&lt;/a&gt; elements. We
currently don&amp;#8217;t run the tests using the modern and hardware-accelerated
&lt;code&gt;vaav1enc&lt;/code&gt; and &lt;code&gt;vaav1dec&lt;/code&gt; elements because the bots don&amp;#8217;t have compatible&amp;nbsp;GPUs.&lt;/p&gt;
&lt;p&gt;The decoding tests were failing, &lt;a href="https://github.com/WebKit/WebKit/tree/main/LayoutTests/imported/w3c/web-platform-tests/webcodecs/full-cycle-test.https.any.js"&gt;this
one&lt;/a&gt;
for instance (the &lt;code&gt;?av1&lt;/code&gt; variant). In that test both encoding and decoding are
tested, but decoding was failing, for a couple reasons. Rabbit hole starts here.
After debugging this for a while, it was clear that the colorspace information
was lost between the encoded chunks and the decoded frames. The decoded video
frames didn&amp;#8217;t have the expected colorimetry&amp;nbsp;values.&lt;/p&gt;
&lt;p&gt;The
&lt;a href="https://github.com/WebKit/WebKit/blob/main/Source/WebCore/platform/graphics/gstreamer/VideoDecoderGStreamer.h"&gt;VideoDecoderGStreamer&lt;/a&gt;
class basically takes encoded chunks and notifies decoded
&lt;a href="https://github.com/WebKit/WebKit/blob/main/Source/WebCore/platform/graphics/gstreamer/VideoFrameGStreamer.h"&gt;VideoFrameGStreamer&lt;/a&gt;
objects to the upper layers (&lt;span class="caps"&gt;JS&lt;/span&gt;) in WebCore. A video frame is basically a
GstSample (Buffer and Caps) and we have code in place to interpret the
colorimetry parameters exposed in the sample caps and translate those to the
various WebCore equivalents. So far so good, but the caps set on the &lt;code&gt;dav1ddec&lt;/code&gt;
elements didn&amp;#8217;t have those informations! I thought the &lt;code&gt;dav1ddec&lt;/code&gt; element could
be fixed, &amp;#8220;shouldn&amp;#8217;t be that hard&amp;#8221; and I knew that code because I wrote it in
2018&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;So let&amp;#8217;s fix the GStreamer &lt;code&gt;dav1ddec&lt;/code&gt; element. It&amp;#8217;s a video decoder written in
Rust, relying on the &lt;a href="https://github.com/rust-av/dav1d-rs"&gt;dav1d-rs&lt;/a&gt; bindings of
the popular C &lt;code&gt;libdav1d&lt;/code&gt; library. The &lt;code&gt;dav1ddec&lt;/code&gt; element basically feeds encoded
chunks of data to dav1d using the dav1d-rs bindings. In return, the bindings
provide the decoded frames using a &lt;code&gt;Dav1dPicture&lt;/code&gt; Rust structure and the
&lt;code&gt;dav1ddec&lt;/code&gt; GStreamer element basically makes buffers and caps out of this
decoded picture. The dav1d-rs bindings are quite minimal, we implemented &lt;span class="caps"&gt;API&lt;/span&gt; on
a per-need basis so far, so it wasn&amp;#8217;t very surprising that&amp;#8230; colorimetry
information for decoded pictures was not exposed! Rabbit hole goes one level&amp;nbsp;deeper.&lt;/p&gt;
&lt;p&gt;So let&amp;#8217;s add colorimetry &lt;span class="caps"&gt;API&lt;/span&gt; in &lt;code&gt;dav1d-rs&lt;/code&gt;. When working on (Rust) bindings of a
C library, if you need to expose additional &lt;span class="caps"&gt;API&lt;/span&gt; the answer is quite often in the
C headers of the library. Every &lt;code&gt;Dav1dPicture&lt;/code&gt; has a &lt;code&gt;Dav1dSequenceHeader&lt;/code&gt;, in
which we can see a few interesting&amp;nbsp;fields:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;typedef&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;struct&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;Dav1dSequenceHeader&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;enum&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Dav1dColorPrimaries&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;pri&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;///&amp;lt; color primaries (av1)&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;enum&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Dav1dTransferCharacteristics&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;trc&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;///&amp;lt; transfer characteristics (av1)&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;enum&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Dav1dMatrixCoefficients&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;mtrx&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;///&amp;lt; matrix coefficients (av1)&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;enum&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Dav1dChromaSamplePosition&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;chr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;///&amp;lt; chroma sample position (av1)&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="kt"&gt;uint8_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;color_range&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Dav1dSequenceHeader&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;After sharing a naive branch with rust-av co-maintainers &lt;a href="https://github.com/lu-zero"&gt;Luca
Barbato&lt;/a&gt; and &lt;a href="https://github.com/sdroege"&gt;Sebastian
Dröge&lt;/a&gt;, I came up with a
&lt;a href="https://github.com/rust-av/dav1d-rs/pull/94"&gt;couple&lt;/a&gt;
&lt;a href="https://github.com/rust-av/dav1d-rs/pull/97"&gt;pull-requests&lt;/a&gt; that eventually
were shipped in version 0.10.3 of dav1d-rs. I won&amp;#8217;t deny matching primaries,
transfer, matrix and chroma-site enum values to &lt;code&gt;rust-av&lt;/code&gt;&lt;span class="quo"&gt;&amp;#8216;&lt;/span&gt;s Pixel enum was a bit
challenging :P Anyway, with &lt;code&gt;dav1d-rs&lt;/code&gt; fixed up, rabbit hole level goes up one
level&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;Now with the needed &lt;code&gt;dav1d-rs&lt;/code&gt; &lt;span class="caps"&gt;API&lt;/span&gt;, the GStreamer &lt;code&gt;dav1ddec&lt;/code&gt; element could be
fixed. Again, matching the various enum values to their GStreamer equivalent was
an interesting exercise. The &lt;a href="https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1514"&gt;merge
request&lt;/a&gt;
was merged, but to this date it&amp;#8217;s not shipped in a stable gst-plugins-rs release
yet. There&amp;#8217;s one more complication here, &lt;span class="caps"&gt;ABI&lt;/span&gt; broke between &lt;code&gt;dav1d&lt;/code&gt; 1.2 and 1.4
versions. The &lt;code&gt;dav1d-rs&lt;/code&gt; 0.10.3 release expects the latter. I&amp;#8217;m not sure how we
will cope with that in terms of gst-plugins-rs release&amp;nbsp;versioning&amp;#8230;&lt;/p&gt;
&lt;p&gt;Anyway, WebKit&amp;#8217;s runtime environment can be adapted to ship dav1d 1.4 and
development version of the &lt;code&gt;dav1ddec&lt;/code&gt; element, which is what was done in this
&lt;a href="https://github.com/WebKit/WebKit/pull/27218"&gt;pull request&lt;/a&gt;. The rabbit is
getting out of his&amp;nbsp;hole.&lt;/p&gt;
&lt;p&gt;The WebCodec &lt;span class="caps"&gt;AV1&lt;/span&gt; tests were finally fixed in WebKit, by this &lt;a href="https://github.com/WebKit/WebKit/pull/27230"&gt;pull
request&lt;/a&gt;. Beyond colorimetry
handling a few more fixes were needed, but luckily those didn&amp;#8217;t require any
fixes outside of&amp;nbsp;WebKit.&lt;/p&gt;
&lt;p&gt;Wrapping up, if you&amp;#8217;re still reading this post, I thank you for your patience.
Working on inter-connected projects can look a bit daunting at times, but
eventually the whole ecosystem benefits from cross-project collaborations like
this one. Thanks to Luca and Sebastian for the help and reviews in &lt;code&gt;dav1d-rs&lt;/code&gt;
and the &lt;code&gt;dav1ddec&lt;/code&gt; element. Thanks to my fellow &lt;a href="https://igalia.com"&gt;Igalia&lt;/a&gt;
colleagues for the WebKit&amp;nbsp;reviews.&lt;/p&gt;</content><category term="misc"></category><category term="Projects"></category><category term="WebKit"></category><category term="GStreamer"></category></entry><entry><title>GNOME Web Canary is back</title><link href="https://base-art.net/Articles/gnome-web-canary-is-back/" rel="alternate"></link><published>2023-07-08T10:00:00+02:00</published><updated>2023-07-08T17:30:00+02:00</updated><author><name>Philippe Normand</name></author><id>tag:base-art.net,2023-07-08:/Articles/gnome-web-canary-is-back/</id><summary type="html">&lt;p&gt;This is a short &lt;span class="caps"&gt;PSA&lt;/span&gt; post announcing the return of the &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web Canary builds.
Read on for the crunchy&amp;nbsp;details.&lt;/p&gt;
&lt;p&gt;A couple years ago I was blogging about the &lt;a href="https://base-art.net/Articles/introducing-the-gnome-web-canary-flavor/"&gt;&lt;span class="caps"&gt;GNOME&lt;/span&gt; Web Canary
flavor&lt;/a&gt;.
In summary this special build of &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web provides a preview of the upcoming
version of …&lt;/p&gt;</summary><content type="html">&lt;p&gt;This is a short &lt;span class="caps"&gt;PSA&lt;/span&gt; post announcing the return of the &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web Canary builds.
Read on for the crunchy&amp;nbsp;details.&lt;/p&gt;
&lt;p&gt;A couple years ago I was blogging about the &lt;a href="https://base-art.net/Articles/introducing-the-gnome-web-canary-flavor/"&gt;&lt;span class="caps"&gt;GNOME&lt;/span&gt; Web Canary
flavor&lt;/a&gt;.
In summary this special build of &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web provides a preview of the upcoming
version of the underlying WebKitGTK engine, it is potentially unstable, but
allows for testing features that have not shipped in a stable release&amp;nbsp;yet.&lt;/p&gt;
&lt;p&gt;Unfortunately, Canary broke right after &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web switched to &lt;span class="caps"&gt;GTK4&lt;/span&gt;, because back
then the WebKit &lt;span class="caps"&gt;CI&lt;/span&gt; was missing build bots and infrastructure for hosting
WebKitGTK4 build artefacts. Recently, thanks to the efforts of my
&lt;a href="https://igalia.com"&gt;Igalia&lt;/a&gt; colleagues, &lt;a href="https://www.igalia.com/team/pabelenda"&gt;Pablo
Abelenda&lt;/a&gt;, &lt;a href="https://www.igalia.com/team/lmoura"&gt;Lauro
Moura&lt;/a&gt;, &lt;a href="https://www.igalia.com/team/dpino"&gt;Diego
Pino&lt;/a&gt; and &lt;a href="https://www.igalia.com/team/clopez"&gt;Carlos
López&lt;/a&gt; the WebKit &lt;span class="caps"&gt;CI&lt;/span&gt; provides WebKitGTK4
build artefacts, hosted on a server kindly provided by&amp;nbsp;Igalia.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://base-art.net/png/Epiphany-Canary-GTK4.png"/&gt;&lt;/p&gt;
&lt;p&gt;The installation instructions are already mentioned in the introductory post but I&amp;#8217;ll just remind them again&amp;nbsp;here:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;flatpak&lt;span class="w"&gt; &lt;/span&gt;--user&lt;span class="w"&gt; &lt;/span&gt;remote-add&lt;span class="w"&gt; &lt;/span&gt;--if-not-exists&lt;span class="w"&gt; &lt;/span&gt;webkit&lt;span class="w"&gt; &lt;/span&gt;https://software.igalia.com/flatpak-refs/webkit-sdk.flatpakrepo
flatpak&lt;span class="w"&gt; &lt;/span&gt;--user&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;https://nightly.gnome.org/repo/appstream/org.gnome.Epiphany.Canary.flatpakref
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;If you installed the older version of Canary, pre-&lt;span class="caps"&gt;GTK4&lt;/span&gt;, you might see an error
related with an expired &lt;span class="caps"&gt;GPG&lt;/span&gt; key. This is due to how I update the WebKit runtime,
and I&amp;#8217;ll try to avoid it in future updates. For the time being, you can remove
the flatpak remote and re-add&amp;nbsp;it:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;flatpak&lt;span class="w"&gt; &lt;/span&gt;--user&lt;span class="w"&gt; &lt;/span&gt;remote-delete&lt;span class="w"&gt; &lt;/span&gt;webkit
flatpak&lt;span class="w"&gt; &lt;/span&gt;--user&lt;span class="w"&gt; &lt;/span&gt;remote-add&lt;span class="w"&gt; &lt;/span&gt;webkit&lt;span class="w"&gt; &lt;/span&gt;https://software.igalia.com/flatpak-refs/webkit-sdk.flatpakrepo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;That&amp;#8217;s all folks, happy hacking and happy&amp;nbsp;testing.&lt;/p&gt;</content><category term="misc"></category><category term="Projects"></category><category term="WebKit"></category></entry><entry><title>WebRTC in WebKitGTK and WPE, status updates, part I</title><link href="https://base-art.net/Articles/webrtc-in-webkitgtk-and-wpe-status-updates-part-i/" rel="alternate"></link><published>2023-02-16T21:30:00+01:00</published><updated>2023-02-16T21:19:35+01:00</updated><author><name>Philippe Normand</name></author><id>tag:base-art.net,2023-02-16:/Articles/webrtc-in-webkitgtk-and-wpe-status-updates-part-i/</id><summary type="html">&lt;script type="module"&gt;
    import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@9/dist/mermaid.esm.min.mjs';
    mermaid.initialize({ startOnLoad: true });
&lt;/script&gt;

&lt;p&gt;Some time ago we at &lt;a href="https://igalia.com"&gt;Igalia&lt;/a&gt; embarked on the journey to ship
a &lt;a href="https://gstreamer.freedesktop.org"&gt;GStreamer&lt;/a&gt;-powered WebRTC backend. This is
a long journey, it is not over, but we made some progress …&lt;/p&gt;</summary><content type="html">&lt;script type="module"&gt;
    import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@9/dist/mermaid.esm.min.mjs';
    mermaid.initialize({ startOnLoad: true });
&lt;/script&gt;

&lt;p&gt;Some time ago we at &lt;a href="https://igalia.com"&gt;Igalia&lt;/a&gt; embarked on the journey to ship
a &lt;a href="https://gstreamer.freedesktop.org"&gt;GStreamer&lt;/a&gt;-powered WebRTC backend. This is
a long journey, it is not over, but we made some progress. This post is the
first of a series providing some insights of the challenges we are facing and
the plans for the next release&amp;nbsp;cycle(s).&lt;/p&gt;
&lt;p&gt;Most web-engines nowadays bundle a version of &lt;a href="https://webrtc.org/"&gt;LibWebRTC&lt;/a&gt;,
it is indeed a pragmatic approach. WebRTC is a huge spec, spanning across many
protocols, RFCs and codecs. LibWebRTC is in fact a multimedia framework on its
own, and it&amp;#8217;s a very big code-base. I still remember the suprised face of
&lt;a href="https://crisal.io/"&gt;Emilio&lt;/a&gt; at the &lt;a href="https://webengineshackfest.org/2022/"&gt;2022 WebEngines
conference&lt;/a&gt; when I told him we had unusual
plans regarding WebRTC support in GStreamer WebKit ports. There are several
reasons for this plan, explained in the &lt;a href="https://wpewebkit.org/about/faq.html"&gt;&lt;span class="caps"&gt;WPE&lt;/span&gt;
&lt;span class="caps"&gt;FAQ&lt;/span&gt;&lt;/a&gt;. We worked on a LibWebRTC backend for
the WebKit GStreamer ports, my colleague Thibault Saunier &lt;a href="https://blogs.gnome.org/tsaunier/2018/07/31/webkitgtk-and-wpe-gains-webrtc-support-back/"&gt;blogged about
it&lt;/a&gt;
but unfortunately this backend has remained disabled by default and not shipped
in the tarballs, for the reasons explained in the &lt;span class="caps"&gt;WPE&lt;/span&gt; &lt;span class="caps"&gt;FAQ&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;The GStreamer project nowadays provides a library and a plugin allowing
applications to interact with third-party WebRTC actors. This is in my opinion a
paradigm shift, because it enables new ways of interoperability between the
so-called Web and traditional native applications. Since the GstWebRTC
announcement back in late 2017 I&amp;#8217;ve been experimenting with the idea of shipping
an alternative to LibWebRTC in WebKitGTK and &lt;span class="caps"&gt;WPE&lt;/span&gt;. The &lt;a href="https://github.com/WebKit/WebKit/commit/a530847a7ce739e1b8b7a55cf1f5ae41a0938a11"&gt;initial GstWebRTC WebKit
backend&lt;/a&gt;
was merged upstream on March 18,&amp;nbsp;2022.&lt;/p&gt;
&lt;p&gt;As you might already know, before any audio/video call, your browser might ask
permission to access your webcam/microphone and even during the call you can now
share your screen. From the WebKitGTK/&lt;span class="caps"&gt;WPE&lt;/span&gt; perspective the procedure is the same
of course. Let&amp;#8217;s dive&amp;nbsp;in.&lt;/p&gt;
&lt;h2&gt;WebCam/Microphone&amp;nbsp;capture&lt;/h2&gt;
&lt;p&gt;Back in 2018 for the LibWebRTC backend, Thibault added support for
GStreamer-powered media capture to WebKit, meaning that capture devices such as
microphones and webcams would be accessible from WebKit applications using the
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia"&gt;getUserMedia&lt;/a&gt;
spec. Under the hood, a GStreamer source element is created, using the
&lt;a href="https://gstreamer.freedesktop.org/documentation/gstreamer/gstdevice.html?gi-language=c"&gt;GstDevice&lt;/a&gt;
&lt;span class="caps"&gt;API&lt;/span&gt;. This implementation is now re-used for the GstWebRTC backend, it works
fine, still has room for improvements but that&amp;#8217;s a topic for a follow-up&amp;nbsp;post.&lt;/p&gt;
&lt;p&gt;A MediaStream can be rendered in a &lt;code&gt;&amp;lt;audio&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;video&amp;gt;&lt;/code&gt; element, through a
custom GStreamer source element that we also provide in WebKit, this is all
internally wired up so that the following &lt;span class="caps"&gt;JS&lt;/span&gt; code will trigger the WebView in
natively capturing and rendering a WebCam device using&amp;nbsp;GStreamer:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;html&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;head&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;script&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nx"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mediaDevices&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getUserMedia&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;audio&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;mediaStream&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;video&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;srcObject&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mediaStream&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onloadedmetadata&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;play&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;script&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;head&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;video&lt;/span&gt;&lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;html&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;When this WebPage is rendered and after the user has granted access to capture
devices, the GStreamer backends will create not one, but two&amp;nbsp;pipelines.&lt;/p&gt;
&lt;pre class="mermaid"&gt;
flowchart LR
    pipewiresrc--&gt;videoscale--&gt;videoconvert--&gt;videorate--&gt;valve--&gt;appsink
&lt;/pre&gt;

&lt;pre class="mermaid"&gt;
flowchart LR
    subgraph mediastreamsrc
    appsrc--&gt;srcghost[src]
    end
    subgraph playbin3
       subgraph decodebin3
       end
       subgraph webkitglsink
       end
       decodebin3--&gt;webkitglsink
    end
    srcghost--&gt;decodebin3
&lt;/pre&gt;

&lt;p&gt;The first pipeline routes video frames from the capture device using
&lt;code&gt;pipewiresrc&lt;/code&gt; to an &lt;code&gt;appsink&lt;/code&gt;. From the &lt;code&gt;appsink&lt;/code&gt; our capturer leveraging the
Observer design pattern notifies its observers. In this case there is only one
observer which is a GStreamer source element internal to WebKit called
&lt;code&gt;mediastreamsrc&lt;/code&gt;. The playback pipeline shown above is heavily simplified, in
reality more elements are involved, but what matters most is that thanks to the
flexibility of Gstreamer, we can leverage the existing MediaPlayer backend that
we at Igalia have been maintaining for more than 10 years, to render
MediaStreams. All we needed was a custom source element, the rest of our
MediaPlayer didn&amp;#8217;t need much changes to support this&amp;nbsp;use-case.&lt;/p&gt;
&lt;p&gt;One notable change we did since the initial implementation though is that for us
a MediaStream can be either raw, encoded or even encapsulated in a &lt;span class="caps"&gt;RTP&lt;/span&gt; payload. So
depending on which component is going to render the MediaStream, we have enough
flexibility to allow zero-copy, in most scenarios. In the example above,
typically the stream will be raw from source to renderer. However, some webcams
can provide encoded streams. &lt;span class="caps"&gt;WPE&lt;/span&gt; and WebKitGTK will be able to internally
leverage these and in some cases allow for direct streaming from hardware device
to outgoing PeerConnection without third-party&amp;nbsp;encoding.&lt;/p&gt;
&lt;h2&gt;Desktop&amp;nbsp;capture&lt;/h2&gt;
&lt;p&gt;There is another &lt;span class="caps"&gt;JS&lt;/span&gt; &lt;span class="caps"&gt;API&lt;/span&gt;, allowing to capture from your screen or a window,
called
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia"&gt;getDisplayMedia&lt;/a&gt;,
and yes, we also support it! Thanks to these recent years ground-breaking
progress of the Linux Desktop such as &lt;a href="https://pipewire.org"&gt;PipeWire&lt;/a&gt; and
&lt;a href="https://flatpak.github.io/xdg-desktop-portal/"&gt;xdg-desktop-portal&lt;/a&gt; we can now
stream your favorite desktop environment over WebRTC. Under the hood when the
WebView is granted access to the desktop capture through the portal, our backend
creates a &lt;code&gt;pipewiresrc&lt;/code&gt; GStreamer element, configured to source from the file
descriptor provided by the portal, and we have a healthy raw video&amp;nbsp;stream.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s a &lt;a href="https://www.youtube.com/live/fAbbiyRnJ6I"&gt;demo&lt;/a&gt;:&lt;/p&gt;
&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/fAbbiyRnJ6I" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen&gt;&lt;/iframe&gt;

&lt;h2&gt;WebAudio&amp;nbsp;capture&lt;/h2&gt;
&lt;p&gt;What more, yes you can also create a &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamAudioDestinationNode"&gt;MediaStream from a WebAudio
node&lt;/a&gt;.
On the backend side, the
&lt;a href="https://github.com/WebKit/WebKit/blob/main/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceGStreamer.cpp"&gt;GStreamerMediaStreamAudioSource&lt;/a&gt;
fills GstBuffers from the audio bus channels and notifies third-parties
internally observing the MediaStream, such as outgoing media sources, or simply
an &lt;code&gt;&amp;lt;audio&amp;gt;&lt;/code&gt; element that was configured to source from the given MediaStream. I
have no demo for this, you&amp;#8217;ll have to take my&amp;nbsp;word.&lt;/p&gt;
&lt;h2&gt;Canvas&amp;nbsp;capture&lt;/h2&gt;
&lt;p&gt;But wait there is more. Did I hear canvas? Yes we can feed your favorite
&lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; to a MediaStream. The &lt;span class="caps"&gt;JS&lt;/span&gt; &lt;span class="caps"&gt;API&lt;/span&gt; is called
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/captureStream"&gt;captureStream&lt;/a&gt;,
&lt;a href="https://github.com/WebKit/WebKit/blob/main/Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp"&gt;its code is actually
cross-platform&lt;/a&gt;
but defers to the &lt;code&gt;HTMLCanvasElement::toVideoFrame()&lt;/code&gt; method which has a
GStreamer implementation. The code is not the most optimal yet though due to
shortcomings of our current graphics pipeline implementation. Here is a &lt;a href="https://www.youtube.com/live/gW0OzeRpzeU"&gt;demo of
Canvas to WebRTC&lt;/a&gt; running in the
WebKitGTK&amp;nbsp;MiniBrowser:&lt;/p&gt;
&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/gW0OzeRpzeU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen&gt;&lt;/iframe&gt;

&lt;h2&gt;Wrap-up&lt;/h2&gt;
&lt;p&gt;So we&amp;#8217;ve got MediaStream support covered. This is only one part of the puzzle
though. We are facing challenges now on the
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection"&gt;PeerConnection&lt;/a&gt;
implementation. MediaStreams are cool but it&amp;#8217;s even better when you can share
them with your friends on the fancy A/V conferencing websites, but we&amp;#8217;re not
entirely ready for this yet in WebKitGTK and &lt;span class="caps"&gt;WPE&lt;/span&gt;. For this reason, WebRTC is not
yet enabled by default in the upcoming WebKitGTK and &lt;span class="caps"&gt;WPE&lt;/span&gt; 2.40 releases. We&amp;#8217;re
just not there yet. In the next part of these series I&amp;#8217;ll tackle the
PeerConnection backend on which we&amp;#8217;re working hard on these days, both in WebKit
and in&amp;nbsp;GStreamer.&lt;/p&gt;
&lt;p&gt;Happy hacking and as always, all my gratitude goes to my fellow
&lt;a href="https://igalia.com"&gt;Igalia&lt;/a&gt; comrades for allowing me to keep working on these
domains and to Metrological for funding some of this work. Is your organization
or company interested in leveraging modern WebRTC APIs from WebKitGTK and/or
&lt;span class="caps"&gt;WPE&lt;/span&gt;? If so please &lt;a href="https://www.igalia.com/contact/"&gt;get in touch with us&lt;/a&gt; in
order to help us speed-up the implementation&amp;nbsp;work.&lt;/p&gt;</content><category term="misc"></category><category term="Projects"></category><category term="WebKit"></category><category term="GStreamer"></category></entry><entry><title>Introducing the GNOME Web Canary flavor</title><link href="https://base-art.net/Articles/introducing-the-gnome-web-canary-flavor/" rel="alternate"></link><published>2021-08-02T14:00:00+02:00</published><updated>2021-08-02T19:15:00+02:00</updated><author><name>Philippe Normand</name></author><id>tag:base-art.net,2021-08-02:/Articles/introducing-the-gnome-web-canary-flavor/</id><summary type="html">&lt;p&gt;Today I am happy to unveil &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web Canary which aims to provide bleeding edge,
most likely very unstable builds of Epiphany, depending on daily builds of the
WebKitGTK development version. Read on to know more about&amp;nbsp;this.&lt;/p&gt;
&lt;p&gt;Until recently the &lt;a class="reference external" href="https://wiki.gnome.org/Apps/Web"&gt;&lt;span class="caps"&gt;GNOME&lt;/span&gt; Web browser&lt;/a&gt; was available for end-users in two …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Today I am happy to unveil &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web Canary which aims to provide bleeding edge,
most likely very unstable builds of Epiphany, depending on daily builds of the
WebKitGTK development version. Read on to know more about&amp;nbsp;this.&lt;/p&gt;
&lt;p&gt;Until recently the &lt;a class="reference external" href="https://wiki.gnome.org/Apps/Web"&gt;&lt;span class="caps"&gt;GNOME&lt;/span&gt; Web browser&lt;/a&gt; was available for end-users in two
flavors. The primary, stable release provides the vanilla experience of the
upstream Web browser. It is shipped as part of the &lt;span class="caps"&gt;GNOME&lt;/span&gt; release cycle and in
distros. The second flavor, called &lt;a class="reference external" href="https://blogs.gnome.org/mcatanzaro/2018/01/24/announcing-epiphany-technology-preview/"&gt;Tech Preview&lt;/a&gt;, is oriented towards early
testers of &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web. It is available as a Flatpak, included in the &lt;span class="caps"&gt;GNOME&lt;/span&gt;
nightly repo. The builds represent the current state of the &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web master
branch, the &lt;a class="reference external" href="https://webkitgtk.org"&gt;WebKitGTK&lt;/a&gt; version it links to is the one provided by the &lt;span class="caps"&gt;GNOME&lt;/span&gt;
nightly&amp;nbsp;runtime.&lt;/p&gt;
&lt;p&gt;Tech Preview is great for users testing the latest development of &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web, but
what if you want to test features that are not yet shipped in &lt;em&gt;any&lt;/em&gt; WebKitGTK
version? Or what if you are &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web developer and you want to implement new
features on Web that depend on &lt;span class="caps"&gt;API&lt;/span&gt; that was not released yet in&amp;nbsp;WebKitGTK?&lt;/p&gt;
&lt;p&gt;Historically, the answer was simply &amp;#8220;you can &lt;a class="reference external" href="https://trac.webkit.org/wiki/BuildingGtk"&gt;build WebKitGTK yourself&lt;/a&gt;&amp;#8220;.
However, this requires some knowledge and a good build machine (or a lot of
patience). Even as WebKit developer builds have become easier to produce thanks
to the Flatpak &lt;span class="caps"&gt;SDK&lt;/span&gt; we provide, you would still need to somehow make Epiphany
detect your local build of WebKit. Other browsers offer nightly or &amp;#8220;Canary&amp;#8221;
builds which don&amp;#8217;t have such requirements. This is exactly what Epiphany Canary
aims to do! Without building WebKit&amp;nbsp;yourself!&lt;/p&gt;
&lt;p&gt;A brief interlude about the term: Canary typically refers to highly unstable
builds of a project, they are named after &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Sentinel_species"&gt;Sentinel species&lt;/a&gt;. Canary birds were
taken into mines to warn coal miners of carbon monoxide presence. For instance
&lt;a class="reference external" href="https://www.google.com/chrome/canary/"&gt;Chrome has been providing Canary builds&lt;/a&gt; of its browser for a long time. These
builds are useful because they allow early testing, by end-users. Hence
potentially early detection of bugs that might not have been detected by the
usual automated test harness that buildbots and &lt;span class="caps"&gt;CI&lt;/span&gt; systems&amp;nbsp;run.&lt;/p&gt;
&lt;p&gt;To similar ends, a new build profile and icon were added in Epiphany, along with
a new Flatpak manifest. Everything is now nicely integrated in the Epiphany
project &lt;span class="caps"&gt;CI&lt;/span&gt;. WebKit builds are already done for every upstream commit using the
&lt;a class="reference external" href="https://build.webkit.org/"&gt;WebKit Buildbot&lt;/a&gt;. As those builds are made with the WebKit Flatpak &lt;span class="caps"&gt;SDK&lt;/span&gt;, they
can be reused elsewhere (x86_64 is the only arch supported for now) as long as
the WebKit Flatpak platform runtime is being used as well. Build artifacts are
saved, compressed, and &lt;a class="reference external" href="https://webkitgtk-release.igalia.com/built-products/"&gt;uploaded to a web server&lt;/a&gt; kindly hosted and provided by
&lt;a class="reference external" href="https://igalia.com"&gt;Igalia&lt;/a&gt;. The &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web &lt;span class="caps"&gt;CI&lt;/span&gt; now has a new job, called &lt;tt class="docutils literal"&gt;canary&lt;/tt&gt;, that generates a
build manifest that installs WebKitGTK build artifacts in the build sandbox,
that can be detected during the Epiphany Flatpak build. The resulting Flatpak
bundle can be downloaded and locally installed. The runtime environment is the
one provided by the WebKit &lt;span class="caps"&gt;SDK&lt;/span&gt; though, so not exactly the same as the one
provided by &lt;span class="caps"&gt;GNOME&lt;/span&gt;&amp;nbsp;Nightly.&lt;/p&gt;
&lt;p&gt;Back to the two main use-cases, and who would want to use&amp;nbsp;this:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;You are a &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web developer looking for &lt;span class="caps"&gt;CI&lt;/span&gt; coverage of some shiny new
WebKitGTK &lt;span class="caps"&gt;API&lt;/span&gt; you want to use from &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web. Every new merge request on the
&lt;span class="caps"&gt;GNOME&lt;/span&gt; Web Gitlab repo now produces installable Canary bundles, that can be
used to test the code changes being submitted for review. This bundle is not
automatically updated though, it&amp;#8217;s good only for one-off&amp;nbsp;testing.&lt;/li&gt;
&lt;li&gt;You are an early tester of &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web, looking for bleeding edge version of
both &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web and WebKitGTK. You can &lt;a class="reference external" href="https://nightly.gnome.org/repo/appstream/org.gnome.Epiphany.Canary.flatpakref"&gt;install Canary&lt;/a&gt; using the provided
Flatpakref. Every commit on the &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web master branch produces an update of
Canary, that users can get through the usual &lt;tt class="docutils literal"&gt;flatpak update&lt;/tt&gt; or through their
flatpak-enabled&amp;nbsp;app-store.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Due to an issue in the Flatpakref file, the WebKit &lt;span class="caps"&gt;SDK&lt;/span&gt; flatpak remote
is not automatically added during the installation of &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web Canary. So it
needs to be manually added before attempting to install the&amp;nbsp;flatpakref:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ flatpak --user remote-add --if-not-exists webkit https://software.igalia.com/flatpak-refs/webkit-sdk.flatpakrepo
$ flatpak --user install https://nightly.gnome.org/repo/appstream/org.gnome.Epiphany.Canary.flatpakref
&lt;/pre&gt;
&lt;p&gt;As you can see in the screenshot below, the &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web branding is clearly
modified compared to the other flavors of the application. The updated logo,
kindly provided by Tobias Bernard, has some yellow tones and the Tech Preview
stripes. Also the careful reader will notice the reported WebKitGTK version in
the screenshot is a development build of &lt;span class="caps"&gt;SVN&lt;/span&gt; revision r280382. Users are
strongly advised to add this information to bug&amp;nbsp;reports.&lt;/p&gt;
&lt;img src="https://base-art.net/png/Epiphany-Canary.png"/&gt;&lt;p&gt;As WebKit developers we are always interested in getting users&amp;#8217; feedback. I hope
this new flavor of &lt;span class="caps"&gt;GNOME&lt;/span&gt; Web will be useful for both &lt;span class="caps"&gt;GNOME&lt;/span&gt; and WebKitGTK
communities. Many thanks to &lt;a class="reference external" href="https://igalia.com"&gt;Igalia&lt;/a&gt; for sponsoring WebKitGTK build artifacts
hosting and some of the work time I spent on this side project. Also thanks to
Michael Catanzaro, Alexander Mikhaylenko and Jordan Petridis for the reviews in&amp;nbsp;Gitlab.&lt;/p&gt;
</content><category term="misc"></category><category term="Projects"></category><category term="WebKit"></category></entry><entry><title>Catching up on WebKit GStreamer WebAudio backends maintenance</title><link href="https://base-art.net/Articles/catching-up-on-webkit-gstreamer-webaudio-backends-maintenance/" rel="alternate"></link><published>2020-11-29T13:45:00+01:00</published><updated>2020-11-29T13:45:00+01:00</updated><author><name>Philippe Normand</name></author><id>tag:base-art.net,2020-11-29:/Articles/catching-up-on-webkit-gstreamer-webaudio-backends-maintenance/</id><summary type="html">&lt;p&gt;Over the past few months the WebKit development team has been working on
modernizing support for the &lt;a class="reference external" href="https://www.w3.org/TR/webaudio/"&gt;WebAudio&lt;/a&gt; specification. This post highlights some
of the changes that were recently merged, focusing on the GStreamer&amp;nbsp;ports.&lt;/p&gt;
&lt;p&gt;My fellow WebKit colleague, Chris Dumez, has been very active lately, updating
the WebAudio implementation …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Over the past few months the WebKit development team has been working on
modernizing support for the &lt;a class="reference external" href="https://www.w3.org/TR/webaudio/"&gt;WebAudio&lt;/a&gt; specification. This post highlights some
of the changes that were recently merged, focusing on the GStreamer&amp;nbsp;ports.&lt;/p&gt;
&lt;p&gt;My fellow WebKit colleague, Chris Dumez, has been very active lately, updating
the WebAudio implementation for the mac ports in order to comply with the latest
changes of the specification. His contributions have been documented in the
Safari Technology Preview release notes for &lt;a class="reference external" href="https://webkit.org/blog/11294/release-notes-for-safari-technology-preview-113/"&gt;version 113&lt;/a&gt;, &lt;a class="reference external" href="https://webkit.org/blog/11294/release-notes-for-safari-technology-preview-114/"&gt;version 114&lt;/a&gt;,
&lt;a class="reference external" href="https://webkit.org/blog/11294/release-notes-for-safari-technology-preview-115/"&gt;version 115&lt;/a&gt; and &lt;a class="reference external" href="https://webkit.org/blog/11294/release-notes-for-safari-technology-preview-116/"&gt;version 116&lt;/a&gt;. This is great for the WebKit project! Since
the initial implementation landed around 2011, there wasn&amp;#8217;t much activity and
over the years our implementation started lagging behind other web engines in
terms of features and spec compliance. So, many thanks Chris, I think you&amp;#8217;re
making a lot of WebAudio web developers very happy these days&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;The flip side of the coin is that some of these changes broke the GStreamer
backends, as Chris is focusing mostly on the Apple ports, a few bugs slipped in,
noticed by the &lt;span class="caps"&gt;CI&lt;/span&gt; test bots and dutifully &lt;a class="reference external" href="https://trac.webkit.org/wiki/WebKitGTK/Gardening/Howto"&gt;gardened&lt;/a&gt; by our bots sheriffs. &lt;a class="reference external" href="https://base-art.net/Articles/1/"&gt;Those
backends were upstreamed in 2012&lt;/a&gt; and since then I didn&amp;#8217;t devote much time to
their maintenance, aside from casual&amp;nbsp;bug-fixing.&lt;/p&gt;
&lt;p&gt;One of the WebAudio features recently supported by WebKit is &lt;a class="reference external" href="https://webaudio.github.io/web-audio-api/#audioworklet"&gt;the Audio Worklet
interface&lt;/a&gt; which allows applications to perform audio processing in a dedicated
thread, thus relieving some pressure off the main thread and ensuring a
glitch-free WebAudio rendering. I added support for this feature in &lt;a class="reference external" href="https://trac.webkit.org/changeset/268579"&gt;r268579&lt;/a&gt;.
Folks eager to test this can try the &lt;span class="caps"&gt;GTK&lt;/span&gt; nightly MiniBrowser with the&amp;nbsp;demos:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ wget https://trac.webkit.org/export/270226/webkit/trunk/Tools/Scripts/webkit-flatpak-run-nightly
$ chmod +x webkit-flatpak-run-nightly
$ python3 webkit-flatpak-run-nightly --gtk MiniBrowser https://googlechromelabs.github.io/web-audio-samples/audio-worklet/
&lt;/pre&gt;
&lt;p&gt;For many years our AudioFileReader implementation was limited to mono and stereo
audio layouts. This limitation was lifted off in &lt;a class="reference external" href="https://trac.webkit.org/changeset/269104"&gt;r269104&lt;/a&gt; allowing for
processing of up to 5.1 surround audio files in the &lt;a class="reference external" href="https://www.w3.org/TR/webaudio/#AudioBufferSourceNode"&gt;AudioBufferSourceNode&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Our AudioDestination, used for audio playback, was only able to render stereo.
It is now able to probe the GStreamer platform audio sink for the maximum number
of channels it can handle, since &lt;a class="reference external" href="https://trac.webkit.org/changeset/268727"&gt;r268727&lt;/a&gt;. Support for &lt;a class="reference external" href="https://www.w3.org/TR/webaudio/#dom-audiocontext-getoutputtimestamp"&gt;AudioContext
getOutputTimestamp&lt;/a&gt; was hooked up in the GStreamer backend in &lt;a class="reference external" href="https://trac.webkit.org/changeset/266109"&gt;r266109&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The WebAudio spec has a &lt;a class="reference external" href="https://www.w3.org/TR/webaudio/#mediastreamaudiosourcenode"&gt;MediaStreamAudioDestinationNode&lt;/a&gt; for MediaStreams,
allowing to feed audio samples coming from the WebAudio pipeline to outgoing
WebRTC streams. Since &lt;a class="reference external" href="https://trac.webkit.org/changeset/269827"&gt;r269827&lt;/a&gt; the GStreamer ports now support this feature as
well! Similarly, incoming WebRTC streams or capture devices can stream their
audio samples to a WebAudio pipeline, this has been supported for a couple years
already, contributed by my colleague Thibault&amp;nbsp;Saunier.&lt;/p&gt;
&lt;p&gt;Our GStreamer FFTFrame implementation was broken for a few weeks, while Chris
was landing various improvements for the platform-agnostic and mac-specific
implementations. I finally fixed it in &lt;a class="reference external" href="https://trac.webkit.org/changeset/267471"&gt;r267471&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This is only the tip of the iceberg. A few more patches were merged, including
some security-related bug-fixes. As the Web Platform keeps growing, supporting
more and more multimedia-related use-cases, we, at the &lt;a class="reference external" href="https://www.igalia.com/technology/multimedia"&gt;Igalia Multimedia team&lt;/a&gt;,
are committed to maintain our position as GStreamer experts in the WebKit&amp;nbsp;community.&lt;/p&gt;
</content><category term="misc"></category><category term="Projects"></category><category term="GStreamer"></category><category term="WebKit"></category></entry><entry><title>Web-augmented graphics overlay broadcasting with WPE and GStreamer</title><link href="https://base-art.net/Articles/web-augmented-graphics-overlay-broadcasting-with-wpe-and-gstreamer/" rel="alternate"></link><published>2020-07-02T15:00:00+02:00</published><updated>2020-07-02T15:00:00+02:00</updated><author><name>Philippe Normand</name></author><id>tag:base-art.net,2020-07-02:/Articles/web-augmented-graphics-overlay-broadcasting-with-wpe-and-gstreamer/</id><summary type="html">&lt;p&gt;Graphics overlays are everywhere nowadays in the live video broadcasting
industry. In this post I introduce a new demo relying on &lt;a class="reference external" href="https://gstreamer.freedesktop.org"&gt;GStreamer&lt;/a&gt; and
&lt;a class="reference external" href="https://wpewebkit.org"&gt;WPEWebKit&lt;/a&gt; to deliver low-latency web-augmented video&amp;nbsp;broadcasts.&lt;/p&gt;
&lt;p&gt;Readers of this blog might remember a few posts about &lt;a class="reference external" href="https://wpewebkit.org"&gt;WPEWebKit&lt;/a&gt; and a
&lt;a class="reference external" href="https://gstreamer.freedesktop.org"&gt;GStreamer&lt;/a&gt; element we at &lt;a class="reference external" href="https://igalia.com"&gt;Igalia&lt;/a&gt; worked on …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Graphics overlays are everywhere nowadays in the live video broadcasting
industry. In this post I introduce a new demo relying on &lt;a class="reference external" href="https://gstreamer.freedesktop.org"&gt;GStreamer&lt;/a&gt; and
&lt;a class="reference external" href="https://wpewebkit.org"&gt;WPEWebKit&lt;/a&gt; to deliver low-latency web-augmented video&amp;nbsp;broadcasts.&lt;/p&gt;
&lt;p&gt;Readers of this blog might remember a few posts about &lt;a class="reference external" href="https://wpewebkit.org"&gt;WPEWebKit&lt;/a&gt; and a
&lt;a class="reference external" href="https://gstreamer.freedesktop.org"&gt;GStreamer&lt;/a&gt; element we at &lt;a class="reference external" href="https://igalia.com"&gt;Igalia&lt;/a&gt; worked on. In december 2018 I &lt;a class="reference external" href="https://base-art.net/Articles/web-overlay-in-gstreamer-with-wpewebkit/"&gt;introduced
GstWPE&lt;/a&gt; and a few months later blogged about a &lt;a class="reference external" href="https://base-art.net/Articles/html-overlays-with-gstwpe-the-demo/"&gt;proof-of-concept application&lt;/a&gt;
I wrote for it. So, learning from this first iteration, I wrote another&amp;nbsp;demo!&lt;/p&gt;
&lt;p&gt;The first demo was already quite cool, but had a few&amp;nbsp;down-sides:&lt;/p&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;It works only on desktop (running in a Wayland compositor). The Wayland
compositor dependency can be a burden in some cases. Ideally we could
imaginge GstWPE applications running &amp;#8220;in the cloud&amp;#8221;, on machines without &lt;span class="caps"&gt;GPU&lt;/span&gt;,
bare&amp;nbsp;metal.&lt;/li&gt;
&lt;li&gt;While it was cool to stream to Twitch, Youtube and the like, these platforms
currently can ingest only &lt;span class="caps"&gt;RTMP&lt;/span&gt; streams. That means the latency introduced can
be quite significant, depending on the network conditions of course, but even
in ideal conditions the latency was between one and 2 seconds. This is not
great, in the world we live&amp;nbsp;in.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To address the first point, &lt;span class="caps"&gt;WPE&lt;/span&gt; founding engineer, &lt;a class="reference external" href="https://blogs.igalia.com/zdobersek/"&gt;Žan Doberšek&lt;/a&gt; enabled
software rasterizing support in &lt;span class="caps"&gt;WPE&lt;/span&gt; and its &lt;a class="reference external" href="https://github.com/igalia/wpebackend-fdo"&gt;&lt;span class="caps"&gt;FDO&lt;/span&gt; backend&lt;/a&gt;. This is great because
it allows &lt;span class="caps"&gt;WPE&lt;/span&gt; to run on machines without &lt;span class="caps"&gt;GPU&lt;/span&gt; (like continuous integration
builders, test bots) but also &amp;#8220;in the cloud&amp;#8221; where machines with &lt;span class="caps"&gt;GPU&lt;/span&gt; are less
affordable than bare metal! Following up, I enabled this feature in GstWPE. The
source element caps template now has &lt;cite&gt;video/x-raw&lt;/cite&gt;, in addition to
&lt;cite&gt;video/x-raw(memory:GLMemory)&lt;/cite&gt;. To force swrast, you need to set the
&lt;cite&gt;LIBGL_ALWAYS_SOFTWARE=true&lt;/cite&gt; environment variable. The downside of swrast is
that you need a good &lt;span class="caps"&gt;CPU&lt;/span&gt;. Of course it depends on the video resolution and
framerate you want to&amp;nbsp;target.&lt;/p&gt;
&lt;p&gt;On the latency front, I decided to switch from &lt;span class="caps"&gt;RTMP&lt;/span&gt; to WebRTC! This &lt;span class="caps"&gt;W3C&lt;/span&gt; spec
isn&amp;#8217;t only about video chat! With WebRTC, sub-second live one-to-many
broadcasting can be achieved, without much efforts, given you have a good &lt;span class="caps"&gt;SFU&lt;/span&gt;.
For this demo I chose &lt;a class="reference external" href="https://janus.conf.meetecho.com"&gt;Janus&lt;/a&gt;, because its APIs are well documented, and it&amp;#8217;s a
cool project! I&amp;#8217;m not sure it would scale very well in large deployments, but
for my modest use-case, it fits very&amp;nbsp;well.&lt;/p&gt;
&lt;p&gt;Janus has a plugin called &lt;a class="reference external" href="https://janus.conf.meetecho.com/docs/videoroom.html"&gt;video-room&lt;/a&gt; which allows multiple participants to
chat. But then imagine a participant only publishing its video stream and
multiple &amp;#8220;clients&amp;#8221; connecting to that room, without sharing any video or audio
stream, one-to-many broadcasting. As it turns out, &lt;a class="reference external" href="https://gstreamer.freedesktop.org"&gt;GStreamer&lt;/a&gt; applications can
already connect to this video-room plugin using &lt;a class="reference external" href="https://gstreamer.freedesktop.org/documentation/webrtc/index.html?gi-language=c#webrtcbin-page"&gt;GstWebRTC&lt;/a&gt;! A demo was developed
by &lt;a class="reference external" href="https://github.com/tobiasfriden"&gt;tobiasfriden&lt;/a&gt; and &lt;a class="reference external" href="https://github.com/saket424"&gt;saket424&lt;/a&gt; in Python, it recently moved to the &lt;a class="reference external" href="https://gitlab.freedesktop.org/gstreamer/gst-examples"&gt;gst-examples&lt;/a&gt;
repository. As I kind of prefer to use Rust nowadays (whenever I can anyway) I
ported this demo to Rust, it was upstreamed in &lt;a class="reference external" href="https://gitlab.freedesktop.org/gstreamer/gst-examples"&gt;gst-examples&lt;/a&gt; as well. This
specific demo streams the video test pattern to a Janus&amp;nbsp;instance.&lt;/p&gt;
&lt;p&gt;Adapting this Janus demo was then quite trivial. By relying on a similar video
mixer approach I used for the first GstWPE demo, I had a GstWPE-powered WebView
streaming to&amp;nbsp;Janus.&lt;/p&gt;
&lt;p&gt;The next step was the actual graphics overlays infrastructure. In the first
GstWPE demo I had a basic &lt;span class="caps"&gt;GTK&lt;/span&gt; &lt;span class="caps"&gt;UI&lt;/span&gt; allowing to edit the overlays on-the-fly. This
can&amp;#8217;t be used for this new demo, because I wanted to use it headless. After
doing some research I found a really nice NodeJS app on Github, it was developed
by &lt;a class="reference external" href="https://github.com/moschopsuk"&gt;Luke Moscrop&lt;/a&gt;, who&amp;#8217;s actually one of the main developers of the &lt;a class="reference external" href="https://github.com/bbc/brave"&gt;Brave
&lt;span class="caps"&gt;BBC&lt;/span&gt;&lt;/a&gt; project. The &lt;a class="reference external" href="https://github.com/moschopsuk/Roses-2015-CasparCG-Graphics"&gt;Roses CasparCG Graphics&lt;/a&gt; was developed in the context of
the &lt;a class="reference external" href="https://www.la1tv.co.uk"&gt;Lancaster University Students&amp;#8217; Union &lt;span class="caps"&gt;TV&lt;/span&gt; Station&lt;/a&gt;, this app starts a
web-server on port 3000 with two main entry&amp;nbsp;points:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;An admin web-&lt;span class="caps"&gt;UI&lt;/span&gt; (in &lt;cite&gt;/admin/&lt;/cite&gt; allowing to create and manage overlays, like sports score
boards, info banners, and so&amp;nbsp;on.&lt;/li&gt;
&lt;li&gt;The target overlay page (in the root location of the server), which is a
web-page without predetermined background, displaying the overlays with &lt;span class="caps"&gt;HTML&lt;/span&gt;,
&lt;span class="caps"&gt;CSS&lt;/span&gt; and &lt;span class="caps"&gt;JS&lt;/span&gt;. This web-page is meant to be fed to &lt;a class="reference external" href="https://casparcg.com"&gt;CasparCG&lt;/a&gt; (or GstWPE&amp;nbsp;:))&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After making a few tweaks in this NodeJS app, I can&amp;nbsp;now:&lt;/p&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;Start the NodeJS app, load the admin &lt;span class="caps"&gt;UI&lt;/span&gt; in a browser and enable some&amp;nbsp;overlays&lt;/li&gt;
&lt;li&gt;Start my native Rust GStreamer/&lt;span class="caps"&gt;WPE&lt;/span&gt; application, which:&lt;ul&gt;
&lt;li&gt;connects to the overlay&amp;nbsp;web-server&lt;/li&gt;
&lt;li&gt;mixes a live video source (webcam for instances) with the &lt;span class="caps"&gt;WPE&lt;/span&gt;-powered&amp;nbsp;overlay&lt;/li&gt;
&lt;li&gt;encodes the video stream to H.264, &lt;span class="caps"&gt;VP8&lt;/span&gt; or &lt;span class="caps"&gt;VP9&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;sends the encoded &lt;span class="caps"&gt;RTP&lt;/span&gt; stream using WebRTC to a Janus&amp;nbsp;server&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Let &amp;#8220;consumer&amp;#8221; clients connect to Janus with their browser, in order to see
the resulting live&amp;nbsp;broadcast.&lt;/li&gt;
&lt;/ol&gt;
&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/QNZJYOuVGiE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen&gt;&lt;/iframe&gt;&lt;p&gt;(If the video doesn&amp;#8217;t display, here is the &lt;a class="reference external" href="https://youtu.be/QNZJYOuVGiE"&gt;Youtube link&lt;/a&gt;.)&lt;/p&gt;
&lt;p&gt;This is pretty cool and fun, as my colleague &lt;a class="reference external" href="https://bkardell.com"&gt;Brian Kardell&lt;/a&gt; mentions in the
video. Working on this new version gave me more ideas for the next one. And very
recently the &lt;a class="reference external" href="https://github.com/Igalia/WPEBackend-fdo/commit/fd14bac16e465083b755675c441e19cc60db04b3"&gt;audio rendering protocol&lt;/a&gt; was merged in WPEBackend-&lt;span class="caps"&gt;FDO&lt;/span&gt;! That
means even more use-cases are now unlocked for&amp;nbsp;GstWPE.&lt;/p&gt;
&lt;p&gt;This demo&amp;#8217;s source code is hosted on &lt;a class="reference external" href="https://github.com/Igalia/gst-wpe-webrtc-demo"&gt;Github&lt;/a&gt;. Feel free to open issues there, I
am always interested in getting feedback, good or&amp;nbsp;bad!&lt;/p&gt;
&lt;p&gt;GstWPE is maintained upstream in &lt;a class="reference external" href="https://gstreamer.freedesktop.org"&gt;GStreamer&lt;/a&gt; and relies heavily on &lt;a class="reference external" href="https://wpewebkit.org"&gt;WPEWebKit&lt;/a&gt; and
its &lt;a class="reference external" href="https://github.com/igalia/wpebackend-fdo"&gt;&lt;span class="caps"&gt;FDO&lt;/span&gt; backend&lt;/a&gt;. Don&amp;#8217;t hesitate to &lt;a class="reference external" href="https://www.igalia.com/contact/"&gt;contact us&lt;/a&gt; if you have specific
requirements or issues with these projects&amp;nbsp;:)&lt;/p&gt;
</content><category term="misc"></category><category term="Projects"></category><category term="GStreamer"></category><category term="WebKit"></category></entry><entry><title>Setting up Debian containers on Fedora Silverblue</title><link href="https://base-art.net/Articles/setting-up-debian-containers-on-fedora-silverblue/" rel="alternate"></link><published>2020-06-13T13:50:00+02:00</published><updated>2020-06-13T13:50:00+02:00</updated><author><name>Philippe Normand</name></author><id>tag:base-art.net,2020-06-13:/Articles/setting-up-debian-containers-on-fedora-silverblue/</id><summary type="html">&lt;p&gt;After almost 20 years using Debian, I am trying something different, &lt;a class="reference external" href="https://silverblue.fedoraproject.org/"&gt;Fedora
Silverblue&lt;/a&gt;. However for work I still need to use Debian/Ubuntu from time to
time. In this post I am explaining the steps to setup Debian containers on&amp;nbsp;Silverblue.&lt;/p&gt;
&lt;p&gt;By default Silverblue comes with &lt;a class="reference external" href="https://docs.fedoraproject.org/en-US/fedora-silverblue/toolbox/"&gt;Toolbox&lt;/a&gt; which perfectly integrates …&lt;/p&gt;</summary><content type="html">&lt;p&gt;After almost 20 years using Debian, I am trying something different, &lt;a class="reference external" href="https://silverblue.fedoraproject.org/"&gt;Fedora
Silverblue&lt;/a&gt;. However for work I still need to use Debian/Ubuntu from time to
time. In this post I am explaining the steps to setup Debian containers on&amp;nbsp;Silverblue.&lt;/p&gt;
&lt;p&gt;By default Silverblue comes with &lt;a class="reference external" href="https://docs.fedoraproject.org/en-US/fedora-silverblue/toolbox/"&gt;Toolbox&lt;/a&gt; which perfectly integrates the &lt;span class="caps"&gt;OS&lt;/span&gt;.
It&amp;#8217;s a shell script which actually relies on &lt;a class="reference external" href="https://podman.io/"&gt;Podman&lt;/a&gt;, an alternative to Docker.
And it works really well with Fedora images! However I ran into various issues
when I wanted to setup Debian containers pulled from&amp;nbsp;docker.io:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ toolbox create -c sid --image docker.io/debian:sid
Image required to create toolbox container.
Download docker.io/debian:sid (500MB)? [y/N]: y
Created container: sid
Enter with: toolbox enter --container sid
$ toolbox enter -c sid
toolbox: failed to start container sid
&lt;/pre&gt;
&lt;p&gt;This should work, but doesn&amp;#8217;t, because Toolbox expects specific &lt;a class="reference external" href="https://github.com/containers/toolbox#image-requirements"&gt;Image
requirements&lt;/a&gt;. After some digging into alternate Toolbox implementations and
quite a bit of experimentation, I found a &lt;a class="reference external" href="https://github.com/containers/toolbox/pull/298"&gt;Toolbox pull-request adding support
for Debian containers&lt;/a&gt;. Unfortunately this pull-request wasn&amp;#8217;t merged yet,
perhaps because the Toolbox developers are busy in the rewrite of Toolbox in Go.
Scrolling down the comments, &lt;a class="reference external" href="https://piware.de/"&gt;Martin Pitt&lt;/a&gt; provides some &lt;a class="reference external" href="https://github.com/containers/toolbox/pull/298#issuecomment-598591600"&gt;details&lt;/a&gt; and links to
the approach he&amp;#8217;s taken to achieve the same goal. Trying to follow his
instructions, I finally managed to have working Debian containers in Silverblue.
Many thanks to him! Here&amp;#8217;s the&amp;nbsp;run-down&lt;/p&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;Download the build-debian-toolbox&amp;nbsp;script:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="literal-block"&gt;
$ wget https://piware.de/gitweb/?p=bin.git;a=blob_plain;f=build-debian-toolbox;hb=HEAD
$ mkdir -p ~/bin
$ mv build-debian-toolbox ~/bin
$ chmod +x ~/bin/build-debian-toolbox
&lt;/pre&gt;
&lt;ol class="arabic simple" start="2"&gt;
&lt;li&gt;Modify it a little. Here I had to:&lt;ul&gt;
&lt;li&gt;change the shell shebang to &lt;cite&gt;/bin/bash&lt;/cite&gt;&lt;/li&gt;
&lt;li&gt;Update toolbox call sites to &lt;cite&gt;~/bin/toolbox&lt;/cite&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Make sure &lt;cite&gt;~/bin/&lt;/cite&gt; is first in your shell &lt;cite&gt;$&lt;span class="caps"&gt;PATH&lt;/span&gt;&lt;/cite&gt;&lt;/li&gt;
&lt;li&gt;Download the patched &lt;cite&gt;toolbox&lt;/cite&gt; script from &lt;a class="reference external" href="https://github.com/containers/toolbox/pull/401"&gt;this pull-request&lt;/a&gt; and:&lt;ul&gt;
&lt;li&gt;Move it to &lt;cite&gt;~/bin/&lt;/cite&gt;&lt;/li&gt;
&lt;li&gt;Again, switch to the &lt;cite&gt;/bin/bash/&lt;/cite&gt; shebang in that&amp;nbsp;script&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Then run &lt;cite&gt;build-debian-toolbox&lt;/cite&gt;. By default it will create a Debian Sid
container, unless you provide override as command-line arguments, so for
instance to create an Ubuntu bionic container you&amp;nbsp;can:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ build-debian-toolbox bionic ubuntu
...
$ toolbox run -c bionic cat /etc/os-release
NAME=&amp;quot;Ubuntu&amp;quot;
VERSION=&amp;quot;18.04.4 LTS (Bionic Beaver)&amp;quot;
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=&amp;quot;Ubuntu 18.04.4 LTS&amp;quot;
VERSION_ID=&amp;quot;18.04&amp;quot;
HOME_URL=&amp;quot;https://www.ubuntu.com/&amp;quot;
SUPPORT_URL=&amp;quot;https://help.ubuntu.com/&amp;quot;
BUG_REPORT_URL=&amp;quot;https://bugs.launchpad.net/ubuntu/&amp;quot;
PRIVACY_POLICY_URL=&amp;quot;https://www.ubuntu.com/legal/terms-and-policies/privacy-policy&amp;quot;
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
&lt;/pre&gt;
&lt;p&gt;That&amp;#8217;s it! Hopefully the Toolbox Go rewrite will support this out of the box
without requiring third-party tweaks. Thanks again to Martin for his work
on this&amp;nbsp;topic.&lt;/p&gt;
</content><category term="misc"></category><category term="Misc"></category></entry><entry><title>Web Engines Hackfest 2014</title><link href="https://base-art.net/Articles/web-engines-hackfest-2014/" rel="alternate"></link><published>2020-06-13T12:05:12+02:00</published><updated>2020-06-13T12:05:12+02:00</updated><author><name>Philippe Normand</name></author><id>tag:base-art.net,2020-06-13:/Articles/web-engines-hackfest-2014/</id><summary type="html">&lt;p&gt;Last week I attended the &lt;a class="reference external" href="http://www.webengineshackfest.org/"&gt;Web Engines Hackfest&lt;/a&gt;. The
event was sponsored by Igalia (also hosting the event), Adobe and&amp;nbsp;Collabora.&lt;/p&gt;
&lt;p&gt;As usual I spent most of the time working on the WebKitGTK+ GStreamer
backend and &lt;a class="reference external" href="https://coaxion.net"&gt;Sebastian Dröge&lt;/a&gt; kindly joined and helped out quite a
bit, make sure to read …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Last week I attended the &lt;a class="reference external" href="http://www.webengineshackfest.org/"&gt;Web Engines Hackfest&lt;/a&gt;. The
event was sponsored by Igalia (also hosting the event), Adobe and&amp;nbsp;Collabora.&lt;/p&gt;
&lt;p&gt;As usual I spent most of the time working on the WebKitGTK+ GStreamer
backend and &lt;a class="reference external" href="https://coaxion.net"&gt;Sebastian Dröge&lt;/a&gt; kindly joined and helped out quite a
bit, make sure to read &lt;a class="reference external" href="https://coaxion.net/blog/2014/12/web-engines-hackfest-2014/"&gt;his post&lt;/a&gt; about the&amp;nbsp;event!&lt;/p&gt;
&lt;p&gt;We first worked on the WebAudio GStreamer backend, Sebastian cleaned
up various parts of the code, including the playback pipeline and the
source element we use to bridge the WebCore AudioBus with the playback
pipeline. On my side I finished the &lt;a class="reference external" href="https://bugs.webkit.org/show_bug.cgi?id=78883"&gt;AudioSourceProvider patch&lt;/a&gt; that was
abandoned for a few months (years) in Bugzilla. It&amp;#8217;s an interesting
feature to have so that web apps can use the WebAudio &lt;span class="caps"&gt;API&lt;/span&gt; with raw
audio coming from Media&amp;nbsp;elements.&lt;/p&gt;
&lt;p&gt;I also hacked on &lt;a class="reference external" href="https://bugs.webkit.org/show_bug.cgi?id=138562"&gt;GstGL support for video rendering&lt;/a&gt;. It&amp;#8217;s quite
interesting to be able to share the &lt;span class="caps"&gt;GL&lt;/span&gt; context of WebKit with
GStreamer! The patch is not ready yet for landing but thanks to
the reviews from Sebastian, Mathew Waters and Julien Isorce I&amp;#8217;ll improve it
and hopefully commit it soon in WebKit&amp;nbsp;ToT.&lt;/p&gt;
&lt;p&gt;Sebastian also worked on &lt;a class="reference external" href="http://w3c.github.io/media-source/"&gt;Media Source Extensions&lt;/a&gt; support. We had a
very basic, non-working, backend that required&amp;#8230; a rewrite, basically
:) I hope we will have this &lt;a class="reference external" href="https://bugs.webkit.org/show_bug.cgi?id=139441"&gt;reworked backend&lt;/a&gt; soon in
trunk. Sebastian already has it working on&amp;nbsp;Youtube!&lt;/p&gt;
&lt;p&gt;The event was interesting in general, with discussions about rendering
engines, rendering and&amp;nbsp;JavaScript.&lt;/p&gt;
</content><category term="misc"></category><category term="WebKit"></category></entry><entry><title>Moving to Pelican</title><link href="https://base-art.net/Articles/moving-to-pelican/" rel="alternate"></link><published>2020-06-13T12:05:12+02:00</published><updated>2020-06-13T12:05:12+02:00</updated><author><name>Philippe Normand</name></author><id>tag:base-art.net,2020-06-13:/Articles/moving-to-pelican/</id><summary type="html">&lt;p&gt;Time for a change! Almost 10 years ago I was starting to hack on a
Blog engine with two friends, it was called &lt;a class="reference external" href="http://github.com/philn/alinea"&gt;Alinea&lt;/a&gt; and it powered
this website for a long time. Back then hacking on your own Blog
engine was the pre-requirement to host your blog :) But nowadays …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Time for a change! Almost 10 years ago I was starting to hack on a
Blog engine with two friends, it was called &lt;a class="reference external" href="http://github.com/philn/alinea"&gt;Alinea&lt;/a&gt; and it powered
this website for a long time. Back then hacking on your own Blog
engine was the pre-requirement to host your blog :) But nowadays
people just use Wordpress or similar platforms, if they still have a
blog at all. Alinea fell into oblivion as I didn&amp;#8217;t have time and
motivation to maintain&amp;nbsp;it.&lt;/p&gt;
&lt;p&gt;Moving to Pelican was quite easy, since I&amp;#8217;ve been writing content in
ReST on the previous blog I only had to pull data from the database
and hacked pelican_import.py a bit&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;Now that this website looks almost modern I&amp;#8217;ll hopefully start to blog
again, expect at least news about the &lt;a class="reference external" href="http://webkit.org"&gt;WebKit&lt;/a&gt; work I still enjoy doing
at &lt;a class="reference external" href="http://igalia.com"&gt;Igalia&lt;/a&gt;.&lt;/p&gt;
</content><category term="misc"></category><category term="Misc"></category></entry><entry><title>GStreamer’s playbin3 overview for application developers</title><link href="https://base-art.net/Articles/gstreamers-playbin3-overview-for-application-developers/" rel="alternate"></link><published>2020-06-13T12:05:12+02:00</published><updated>2020-06-13T12:05:12+02:00</updated><author><name>Philippe Normand</name></author><id>tag:base-art.net,2020-06-13:/Articles/gstreamers-playbin3-overview-for-application-developers/</id><summary type="html">&lt;p&gt;Multimedia applications based on GStreamer usually handle playback with the
&lt;a class="reference external" href="https://gstreamer.freedesktop.org/documentation/tutorials/playback/playbin-usage.html"&gt;playbin&lt;/a&gt; element. I recently added support for &lt;a class="reference external" href="https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-playbin3.html"&gt;playbin3&lt;/a&gt; in WebKit. This post
aims to document the changes needed on application side to support this new
generation flavour of&amp;nbsp;playbin.&lt;/p&gt;
&lt;p&gt;So, first of, why is it named playbin3 anyway? The GStreamer …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Multimedia applications based on GStreamer usually handle playback with the
&lt;a class="reference external" href="https://gstreamer.freedesktop.org/documentation/tutorials/playback/playbin-usage.html"&gt;playbin&lt;/a&gt; element. I recently added support for &lt;a class="reference external" href="https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-playbin3.html"&gt;playbin3&lt;/a&gt; in WebKit. This post
aims to document the changes needed on application side to support this new
generation flavour of&amp;nbsp;playbin.&lt;/p&gt;
&lt;p&gt;So, first of, why is it named playbin3 anyway? The GStreamer 0.10.x series had a
playbin element but a first rewrite (playbin2) made it obsolete in the GStreamer
1.x series. So playbin2 was renamed to playbin. That&amp;#8217;s why a second rewrite is
nicknamed playbin3, I suppose&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;Why should you care about playbin3? Playbin3 (and the elements it&amp;#8217;s using
internally: parsebin, decodebin3, uridecodebin3 among others) is the result of a
deep re-design of playbin2 (along with decodebin2 and uridecodebin) to better&amp;nbsp;support:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;gapless&amp;nbsp;playback&lt;/li&gt;
&lt;li&gt;audio cross-fading support (not yet&amp;nbsp;implemented)&lt;/li&gt;
&lt;li&gt;adaptive&amp;nbsp;streaming&lt;/li&gt;
&lt;li&gt;reduced &lt;span class="caps"&gt;CPU&lt;/span&gt;, memory and I/O resource&amp;nbsp;usage&lt;/li&gt;
&lt;li&gt;faster stream switching and full control over the stream selection&amp;nbsp;process&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This work was carried on mostly by Edward Hervey, he presented his work in
detail at 3 GStreamer conferences. If you want to learn more about this and the
internals of playbin3 make sure to watch his awesome presentations at the &lt;a class="reference external" href="https://gstconf.ubicast.tv/videos/decodebin3-or-dealing-with-modern-playback-use-cases/"&gt;2015
gst-conf&lt;/a&gt;, &lt;a class="reference external" href="https://gstconf.ubicast.tv/videos/the-new-gststream-api-design-and-usage/"&gt;2016 gst-conf&lt;/a&gt; and &lt;a class="reference external" href="https://gstconf.ubicast.tv/videos/lightning-talks/#start=1418&amp;amp;autoplay&amp;amp;timeline"&gt;2017 gst-conf&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Playbin3 was added in GStreamer 1.10. It is still considered experimental but in
my experience it works already very well. Just keep in mind you should use at
least the latest GStreamer 1.12 (or even the upcoming 1.14) release before
reporting any issue in Bugzilla. Playbin3 is not a drop-in replacement for
playbin, both elements share only a sub-set of GObject properties and signals.
However, if you don&amp;#8217;t want to modify your application source code just yet, it&amp;#8217;s
very easy to try playbin3&amp;nbsp;anyway:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ USE_PLAYBIN3=1 my-playbin-based-app
&lt;/pre&gt;
&lt;p&gt;Setting the &lt;cite&gt;USE_PLAYBIN&lt;/cite&gt; environment variable enables a code path inside the
GStreamer playback plugin which swaps the playbin element for the playbin3
element. This trick provides a glance to the playbin3 element for the most lazy
people :) The problem is that depending on your use of playbin, you might get
runtime warnings, here&amp;#8217;s an example with the Totem&amp;nbsp;player:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ USE_PLAYBIN3=1 totem ~/Videos/Agent327.mp4
(totem:22617): GLib-GObject-WARNING **: ../../../../gobject/gsignal.c:2523: signal 'video-changed' is invalid for instance '0x556db67f3170' of type 'GstPlayBin3'

(totem:22617): GLib-GObject-WARNING **: ../../../../gobject/gsignal.c:2523: signal 'audio-changed' is invalid for instance '0x556db67f3170' of type 'GstPlayBin3'

(totem:22617): GLib-GObject-WARNING **: ../../../../gobject/gsignal.c:2523: signal 'text-changed' is invalid for instance '0x556db67f3170' of type 'GstPlayBin3'

(totem:22617): GLib-GObject-WARNING **: ../../../../gobject/gsignal.c:2523: signal 'video-tags-changed' is invalid for instance '0x556db67f3170' of type 'GstPlayBin3'

(totem:22617): GLib-GObject-WARNING **: ../../../../gobject/gsignal.c:2523: signal 'audio-tags-changed' is invalid for instance '0x556db67f3170' of type 'GstPlayBin3'

(totem:22617): GLib-GObject-WARNING **: ../../../../gobject/gsignal.c:2523: signal 'text-tags-changed' is invalid for instance '0x556db67f3170' of type 'GstPlayBin3'
sys:1: Warning: g_object_get_is_valid_property: object class 'GstPlayBin3' has no property named 'n-audio'
sys:1: Warning: g_object_get_is_valid_property: object class 'GstPlayBin3' has no property named 'n-text'
sys:1: Warning: ../../../../gobject/gsignal.c:3492: signal name 'get-video-pad' is invalid for instance '0x556db67f3170' of type 'GstPlayBin3'
&lt;/pre&gt;
&lt;p&gt;As mentioned previously, playbin and playbin3 don&amp;#8217;t share the same set of
GObject properties and signals, so some changes in your application are required
in order to use&amp;nbsp;playbin3.&lt;/p&gt;
&lt;p&gt;If your application is based on the &lt;a class="reference external" href="https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-libs/html/GstPlayer.html"&gt;GstPlayer&lt;/a&gt; library then you should set the
&lt;cite&gt;GST_PLAYER_USE_PLAYBIN3&lt;/cite&gt; environment variable. GstPlayer already handles both
playbin and playbin3, so no changes needed in your application if you use&amp;nbsp;GstPlayer!&lt;/p&gt;
&lt;p&gt;Ok, so what if your application relies directly on playbin? Some
changes are needed! If you previously used playbin stream selection
properties and signals, you will now need to handle the GstStream and
GstStreamCollection APIs. Playbin3 will emit a &lt;a class="reference external" href="https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstMessage.html#GST-MESSAGE-STREAM-COLLECTION:CAPS"&gt;stream collection
message&lt;/a&gt; on the bus, this is very nice because the collection
includes information (metadata!) about the streams (or tracks) the
media asset contains. In playbin this was handled with a bunch of
signals (audio-tags-changed, audio-changed, etc), properties (n-audio,
n-video, etc) and action signals (get-audio-tags, get-audio-pad, etc).
The new &lt;a class="reference external" href="https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstStream.html"&gt;GstStream &lt;span class="caps"&gt;API&lt;/span&gt;&lt;/a&gt; provides a centralized and
non-playbin-specific access point for all these informations. To
select streams with playbin3 you now need to send a &lt;a class="reference external" href="https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstEvent.html#gst-event-new-select-streams"&gt;select_streams
event&lt;/a&gt; so that the demuxer can know exactly which streams should be
exposed to downstream elements. That means potentially improved
performance! Once playbin3 completed the stream selection it will emit
a &lt;a class="reference external" href="https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstMessage.html#GST-MESSAGE-STREAMS-SELECTED:CAPS"&gt;streams selected message&lt;/a&gt;, the application should handle this
message and potentially update its internal state about the selected
streams. This is also the best moment to update your &lt;span class="caps"&gt;UI&lt;/span&gt; regarding the
selected streams (like audio track language, video track dimensions,&amp;nbsp;etc).&lt;/p&gt;
&lt;p&gt;Another small difference between playbin and playbin3 is about the source
element setup. In playbin there is a &lt;cite&gt;source&lt;/cite&gt; read-only GObject property and a
&lt;cite&gt;source-setup&lt;/cite&gt; GObject signal. In playbin3 only the latter is available, so your
application should rely on &lt;cite&gt;source-setup&lt;/cite&gt; instead of the &lt;cite&gt;notify::source&lt;/cite&gt;
GObject&amp;nbsp;signal.&lt;/p&gt;
&lt;p&gt;The &lt;a class="reference external" href="https://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/tools/gst-play.c"&gt;gst-play-1.0&lt;/a&gt; playback utility program already supports playbin3 so it
provides a good source of inspiration if you consider porting your application
to playbin3. As mentioned at the beginning of this post, WebKit also now
supports playbin3, however it needs to be enabled at build time using the CMake
&lt;cite&gt;-DUSE_GSTREAMER_PLAYBIN3=&lt;span class="caps"&gt;ON&lt;/span&gt;&lt;/cite&gt; option. This feature is not part of the WebKitGTK+
2.20 series but should be shipped in 2.22. As a final note I wanted to
acknowledge my favorite worker-owned coop &lt;a class="reference external" href="https://igalia.com"&gt;Igalia&lt;/a&gt; for allowing me to work on
this WebKit feature and also our friends over at &lt;a class="reference external" href="https://centricular.com"&gt;Centricular&lt;/a&gt; for all the
quality work on&amp;nbsp;playbin3.&lt;/p&gt;
</content><category term="misc"></category><category term="Projects"></category><category term="GStreamer"></category></entry><entry><title>The GNOME-Shell Gajim extension maintenance</title><link href="https://base-art.net/Articles/the-gnome-shell-gajim-extension-maintenance/" rel="alternate"></link><published>2020-06-13T12:05:12+02:00</published><updated>2020-06-13T12:05:12+02:00</updated><author><name>Philippe Normand</name></author><id>tag:base-art.net,2020-06-13:/Articles/the-gnome-shell-gajim-extension-maintenance/</id><summary type="html">&lt;p&gt;Back in January 2011 I wrote a &lt;span class="caps"&gt;GNOME&lt;/span&gt;-Shell &lt;a class="reference external" href="https://extensions.gnome.org/extension/565/gajim-im-integration/"&gt;extension&lt;/a&gt; allowing Gajim users to
carry on with their chats using the Empathy infrastructure and &lt;span class="caps"&gt;UI&lt;/span&gt; present in the
Shell. For some time the extension was also part of the official
gnome-shell-extensions module and then I had to move it to …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Back in January 2011 I wrote a &lt;span class="caps"&gt;GNOME&lt;/span&gt;-Shell &lt;a class="reference external" href="https://extensions.gnome.org/extension/565/gajim-im-integration/"&gt;extension&lt;/a&gt; allowing Gajim users to
carry on with their chats using the Empathy infrastructure and &lt;span class="caps"&gt;UI&lt;/span&gt; present in the
Shell. For some time the extension was also part of the official
gnome-shell-extensions module and then I had to move it to Github as a
&lt;a class="reference external" href="https://github.com/philn/gnome-shell-gajim-extension"&gt;standalone extension&lt;/a&gt;. Sadly I stopped using Gajim a few years ago and my
interest in maintaining this extension has decreased quite a&amp;nbsp;lot.&lt;/p&gt;
&lt;p&gt;I don&amp;#8217;t know if this extension is actively used by anyone beyond the few bugs
reported in Github, so this is a call for help. If anyone still uses this
extension and wants it supported in future versions of &lt;span class="caps"&gt;GNOME&lt;/span&gt;-Shell, please send
me a mail so I can transfer ownership of the Github repository and see what I
can do for the extensions.gnome.org page as&amp;nbsp;well.&lt;/p&gt;
&lt;p&gt;(Huh, also. Hi blogosphere again! My last post was in 2014 it seems&amp;nbsp;:))&lt;/p&gt;
</content><category term="misc"></category><category term="Projects"></category></entry><entry><title>WebKitGTK and WPE now supporting videos in the img tag</title><link href="https://base-art.net/Articles/webkitgtk-and-wpe-now-supporting-videos-in-the-img-tag/" rel="alternate"></link><published>2020-06-09T18:00:00+02:00</published><updated>2020-06-10T09:00:00+02:00</updated><author><name>Philippe Normand</name></author><id>tag:base-art.net,2020-06-09:/Articles/webkitgtk-and-wpe-now-supporting-videos-in-the-img-tag/</id><summary type="html">&lt;p&gt;Using videos in the &lt;cite&gt;&amp;lt;img&amp;gt;&lt;/cite&gt; &lt;span class="caps"&gt;HTML&lt;/span&gt; tag can lead to more responsive web-page loads
in most cases. Colin Bendell blogged about this topic, make sure to read his
&lt;a class="reference external" href="https://cloudinary.com/blog/evolution_of_img_gif_without_the_gif"&gt;post on the cloudinary website&lt;/a&gt;. As it turns out, this feature has been
supported for more than 2 years in Safari, but …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Using videos in the &lt;cite&gt;&amp;lt;img&amp;gt;&lt;/cite&gt; &lt;span class="caps"&gt;HTML&lt;/span&gt; tag can lead to more responsive web-page loads
in most cases. Colin Bendell blogged about this topic, make sure to read his
&lt;a class="reference external" href="https://cloudinary.com/blog/evolution_of_img_gif_without_the_gif"&gt;post on the cloudinary website&lt;/a&gt;. As it turns out, this feature has been
supported for more than 2 years in Safari, but only recently the WebKitGTK and
WPEWebKit ports caught up. Read on for the crunchy details or skip to the end of
the post if you want to try this new&amp;nbsp;feature.&lt;/p&gt;
&lt;p&gt;As WebKitGTK and WPEWebKit already heavily use GStreamer for their multimedia
backends, it was natural for us to also use GStreamer to provide the video
ImageDecoder&amp;nbsp;implementation.&lt;/p&gt;
&lt;p&gt;The preliminary step is to hook our new decoder into the &lt;a class="reference external" href="https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/MIMETypeRegistry.cpp"&gt;MIMETypeRegistry&lt;/a&gt; and
into the &lt;a class="reference external" href="https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/graphics/ImageDecoder.cpp"&gt;ImageDecoder.cpp&lt;/a&gt; platform-agnostic module. This is where the main
decoder branches out to platform-specific backends. Then we need to add a new
class implementing WebKit&amp;#8217;s &lt;a class="reference external" href="https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/graphics/ImageDecoder.h"&gt;ImageDecoder&lt;/a&gt; virtual&amp;nbsp;interface.&lt;/p&gt;
&lt;p&gt;First you need to implement &lt;cite&gt;supportsMediaType()&lt;/cite&gt;. For this method we already
had all the code in place. WebKit scans the GStreamer plugin registry and
depending on the plugins available on the target platform, a mime-type cache is
built, by the &lt;a class="reference external" href="https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp"&gt;RegistryScanner&lt;/a&gt;. Our new image decoder just needs to hook into
this component (exposed as singleton) so that we can be sure that the decoder
will be used only for media types supported by&amp;nbsp;GStreamer.&lt;/p&gt;
&lt;p&gt;The second most important places of the decoder are its constructor and the
&lt;cite&gt;setData()&lt;/cite&gt; method. This is the place where the decoder receives encoded data,
as a SharedBuffer, and performs the decoding. Because this method is
synchronously called from a secondary thread, we run the GStreamer pipeline
there, until the video has been decoded entirely. Our pipeline relies on the
GStreamer decodebin element and WebKit&amp;#8217;s internal video sink. For the time being
hardware-accelerated decoding is not supported. We should soon be able to fix
this issue though. Once all samples have been received by the sink, the decoder
notifies its caller using a callback. The caller then knows it can request
decoded&amp;nbsp;frames.&lt;/p&gt;
&lt;p&gt;Last, the decoder needs to provide decoded frames! This is implemented using the
&lt;cite&gt;createFrameImageAtIndex()&lt;/cite&gt; method. Our decoder implementation keeps an internal
Map of the decoded samples. We sub-classed the &lt;a class="reference external" href="https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/graphics/gstreamer/MediaSampleGStreamer.h"&gt;MediaSampleGStreamer&lt;/a&gt; to provide
an &lt;cite&gt;image()&lt;/cite&gt; method, which returns the Cairo surface representing the decoded
frame. Again, here we don&amp;#8217;t support &lt;span class="caps"&gt;GL&lt;/span&gt; textures yet. Some more infrastructure
work is likely going to be needed in that area of our WebKit&amp;nbsp;ports.&lt;/p&gt;
&lt;p&gt;Our implementation of the video ImageDecoder lives in &lt;a class="reference external" href="https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.cpp"&gt;ImageDecoderGStreamer&lt;/a&gt;
which will be shipped in WebKitGTK and WPEWebKit 2.30, around September/October.
But what if you want to try this already? Well, building WebKit can be a tedious
task. We&amp;#8217;ve been hard a work at &lt;a class="reference external" href="https://igalia.com"&gt;Igalia&lt;/a&gt; to make this a bit easier using a &lt;a class="reference external" href="https://base-art.net/Articles/introducing-the-webkit-flatpak-sdk/"&gt;new Flatpak &lt;span class="caps"&gt;SDK&lt;/span&gt;&lt;/a&gt;.
So, you can either try this feature in Epiphany Tech Preview or
(surprise!) with our new tooling allowing to download and run nightly binaries
from the upstream WebKit build&amp;nbsp;bots:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ wget https://raw.githubusercontent.com/WebKit/webkit/master/Tools/Scripts/webkit-flatpak-run-nightly
$ chmod +x webkit-flatpak-run-nightly
$ python3 webkit-flatpak-run-nightly MiniBrowser https://colinbendell.github.io/webperf/img-mp4/
&lt;/pre&gt;
&lt;img src="https://base-art.net/png/WebKitGTK-video-img-tag.png"/&gt;&lt;p&gt;This script locally installs our new Flatpak-based developer &lt;span class="caps"&gt;SDK&lt;/span&gt; in
&lt;cite&gt;~/.cache/wk-nightly&lt;/cite&gt; and then downloads a zip archive of the build artefacts
from servers recently brought up by my colleague &lt;a class="reference external" href="http://blog.neutrino.es/"&gt;Carlos Alberto Lopez Perez&lt;/a&gt;,
many thanks to him :). The downloaded zip file is unpacked in &lt;cite&gt;/tmp&lt;/cite&gt; and kept
around in case you want to run this again without re-downloading the build
archive. Flatpak is then used to run the binaries inside a sandbox! This is a
nice way to run the bleeding edge of the web-engine, without having to build it
or install any distro&amp;nbsp;package.&lt;/p&gt;
&lt;p&gt;Implementing new features in WebKit is one of the many expertize domains we are
involved in at &lt;a class="reference external" href="https://igalia.com"&gt;Igalia&lt;/a&gt;. &lt;a class="reference external" href="https://www.igalia.com/technology/multimedia"&gt;Our multimedia team&lt;/a&gt; is always on the lookout to help
folks in their projects involving either GStreamer or WebKit or both! Don&amp;#8217;t
hesitate to reach&amp;nbsp;out.&lt;/p&gt;
</content><category term="misc"></category><category term="Projects"></category><category term="WebKit"></category><category term="GStreamer"></category></entry><entry><title>Introducing the WebKit Flatpak SDK</title><link href="https://base-art.net/Articles/introducing-the-webkit-flatpak-sdk/" rel="alternate"></link><published>2020-06-08T18:50:00+02:00</published><updated>2020-06-11T14:50:00+02:00</updated><author><name>Philippe Normand</name></author><id>tag:base-art.net,2020-06-08:/Articles/introducing-the-webkit-flatpak-sdk/</id><summary type="html">&lt;p&gt;Working on a web-engine often requires a complex build infrastructure. This post
documents our transition from JHBuild to &lt;a class="reference external" href="https://flatpak.org"&gt;Flatpak&lt;/a&gt; for the WebKitGTK and
WPEWebKit development&amp;nbsp;builds.&lt;/p&gt;
&lt;p&gt;For the last 10 years, &lt;a class="reference external" href="https://webkitgtk.org"&gt;WebKitGTK&lt;/a&gt; has been relying on a custom &lt;a class="reference external" href="https://developer.gnome.org/jhbuild/"&gt;JHBuild&lt;/a&gt;
moduleset to handle its dependencies and (try to) ensure a reproducible …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Working on a web-engine often requires a complex build infrastructure. This post
documents our transition from JHBuild to &lt;a class="reference external" href="https://flatpak.org"&gt;Flatpak&lt;/a&gt; for the WebKitGTK and
WPEWebKit development&amp;nbsp;builds.&lt;/p&gt;
&lt;p&gt;For the last 10 years, &lt;a class="reference external" href="https://webkitgtk.org"&gt;WebKitGTK&lt;/a&gt; has been relying on a custom &lt;a class="reference external" href="https://developer.gnome.org/jhbuild/"&gt;JHBuild&lt;/a&gt;
moduleset to handle its dependencies and (try to) ensure a reproducible test
environment for the build bots. When &lt;a class="reference external" href="https://wpewebkit.org"&gt;WPEWebKit&lt;/a&gt; was upstreamed several years
ago, a similar approach was used. We ended up with two slightly different
modulesets to maintain. The biggest problem with that is that we still depend on
the host &lt;span class="caps"&gt;OS&lt;/span&gt; for some dependencies. Another set of scripts was then written to
install those, depending on which distro the host is running&amp;#8230; This is a bit
unfortunate. There are more issues with JHBuild, when a moduleset is updated,
the bots wipe all the resulting builds and start a new build from scratch! Every
WebKitGTK and &lt;span class="caps"&gt;WPE&lt;/span&gt; developer is strongly advised to use this setup, so everybody
ends up building the&amp;nbsp;dependencies.&lt;/p&gt;
&lt;p&gt;In 2018, my colleague &lt;a class="reference external" href="https://blogs.gnome.org/tsaunier/"&gt;Thibault Saunier&lt;/a&gt; worked on a new approach, based on
Flatpak. WebKit could be built as a Flatpak app relying on the &lt;span class="caps"&gt;GNOME&lt;/span&gt; &lt;span class="caps"&gt;SDK&lt;/span&gt;. This
experiment was quite interesting but didn&amp;#8217;t work for several&amp;nbsp;reasons:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Developers were not really aware of this new&amp;nbsp;approach&lt;/li&gt;
&lt;li&gt;The &lt;span class="caps"&gt;GNOME&lt;/span&gt; &lt;span class="caps"&gt;SDK&lt;/span&gt; OSTree commits we were pinning we being removed from the
upstream repo periodically, triggering issues on our&amp;nbsp;side&lt;/li&gt;
&lt;li&gt;Developers still had to build all the WebKit &amp;#8220;app&amp;#8221;&amp;nbsp;dependencies&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In late 2019 I started having a look at this, with a different workflow. I
started to experiment with a custom &lt;span class="caps"&gt;SDK&lt;/span&gt;, based on the &lt;a class="reference external" href="https://freedesktop-sdk.io/"&gt;Freedesktop &lt;span class="caps"&gt;SDK&lt;/span&gt;&lt;/a&gt;. The
goal was to distribute this to WebKit developers, who wouldn&amp;#8217;t need to worry as
much about build dependencies anymore and just focus on building the damn&amp;nbsp;web-engine.&lt;/p&gt;
&lt;p&gt;I first learned about &lt;a class="reference external" href="https://docs.flatpak.org/en/latest/flatpak-builder.html"&gt;flatpak-builder&lt;/a&gt;, built a &lt;span class="caps"&gt;SDK&lt;/span&gt; with that, and started
playing with it for WebKit builds. I was almost happy with that, but soon
realized flatpak-builder is cool for apps packaging, but for big SDKs, it
doesn&amp;#8217;t really work out. Flatpak-builder builds a single recipe at a time and if
I want to update one, everything below in the manifest is rebuilt. As the
journey goes on, I found &lt;a class="reference external" href="https://buildstream.build/"&gt;Buildstream&lt;/a&gt;, which is actually used by the &lt;span class="caps"&gt;FDO&lt;/span&gt; and
&lt;span class="caps"&gt;GNOME&lt;/span&gt; folks nowadays. After converting my flatpak-builder manifest to
Buildstream I finally achieved happiness. Buildstream is bit like Yocto,
Buildroot and all the similar &lt;span class="caps"&gt;NIH&lt;/span&gt; sysroot builders. It was one more thing to
learn, but worth&amp;nbsp;it.&lt;/p&gt;
&lt;p&gt;The &lt;a class="reference external" href="https://github.com/WebKit/webkit/tree/master/Tools/buildstream"&gt;&lt;span class="caps"&gt;SDK&lt;/span&gt; build definitions&lt;/a&gt; are hosted in WebKit&amp;#8217;s repository. The resulting
Flatpak images are hosted on Igalia&amp;#8217;s server and locally installed in a custom
Flatpak UserDir so as to not interfere with the rest of the host &lt;span class="caps"&gt;OS&lt;/span&gt; Flatpak
apps. The usual mix of python, perl, ruby WebKit scripts rely on the &lt;span class="caps"&gt;SDK&lt;/span&gt; to
perform their job of building WebKit, running the various test suites (&lt;span class="caps"&gt;API&lt;/span&gt;
tests, layout tests, &lt;span class="caps"&gt;JS&lt;/span&gt; tests, etc). All you need to do&amp;nbsp;is:&lt;/p&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;clone the WebKit git&amp;nbsp;repo&lt;/li&gt;
&lt;li&gt;run &lt;cite&gt;Tools/Scripts/update-webkit-flatpak&lt;/cite&gt;&lt;/li&gt;
&lt;li&gt;run &lt;cite&gt;Tools/Scripts/build-webkit &amp;#8212;gtk&lt;/cite&gt;&lt;/li&gt;
&lt;li&gt;run build artefacts, like the MiniBrowser, &lt;cite&gt;Tools/Scripts/run-minibrowser &amp;#8212;gtk&lt;/cite&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Under the hood, the &lt;span class="caps"&gt;SDK&lt;/span&gt; will be installed in &lt;cite&gt;WebKitBuild/UserFlatpak&lt;/cite&gt; and
transparently used by the various build scripts. The sandbox is started using a
&lt;cite&gt;flatpak run&lt;/cite&gt; call which bind-mounts the WebKit checkout and build directory.
This is great! We finally have a unified workflow, not depending on specific
host distros. We can easily update toolchains, package handy debug tools like
&lt;a class="reference external" href="https://rr-project.org"&gt;rr&lt;/a&gt;, &lt;span class="caps"&gt;LSP&lt;/span&gt; tooling such as &lt;a class="reference external" href="https://github.com/MaskRay/ccls"&gt;ccls&lt;/a&gt;, etc and let the lazy developers actually focus
on development, rather than tooling&amp;nbsp;infrastructure.&lt;/p&gt;
&lt;p&gt;Another nice tool we now support, is &lt;a class="reference external" href="https://github.com/mozilla/sccache"&gt;sccache&lt;/a&gt;. By deploying a &amp;#8220;cloud&amp;#8221; of
builders in our &lt;a class="reference external" href="https://igalia.com"&gt;Igalia&lt;/a&gt; servers we can now achieve improved build times. The &lt;span class="caps"&gt;SDK&lt;/span&gt;
generates a custom sccache config based on the toolchains it includes (currently
&lt;span class="caps"&gt;GCC&lt;/span&gt; 9.3.0 and clang 8). You can optionally provide an authentication token and
you&amp;#8217;re set. Access to the Igalia build cloud is restricted to Igalians, but
folks who have their own sccache infra can easily set it up for WebKit. In my
home office where I used to wait more than 20 minutes for a build to complete, I
can now have a build done in around 12 minutes. Once we have Redis-powered cloud
storage we might reach even better results. This is great because the buildbots
should be able to keep the Redis cache warm enough. Also developers who can rely
on this won&amp;#8217;t need powerful build machines anymore, a standard workstation or
laptop should be sufficient because the heavy C++ compilation jobs happen in the&amp;nbsp;&amp;#8220;cloud&amp;#8221;.&lt;/p&gt;
&lt;p&gt;If you don&amp;#8217;t like sccache, we still support &lt;a class="reference external" href="https://github.com/icecc/icecream"&gt;IceCC&lt;/a&gt; of course. The main
difference is that IceCC works better on local&amp;nbsp;networks.&lt;/p&gt;
&lt;p&gt;Hacking on WebKit often involves hacking on its dependencies, such as &lt;span class="caps"&gt;GTK&lt;/span&gt;,
GStreamer, libsoup and so on. With JHBuild it was fairly easy to vendor patches
in the moduleset. With Buildstream the process is a bit more complicated, but
actually not too bad! As we depend on the &lt;span class="caps"&gt;FDO&lt;/span&gt; &lt;span class="caps"&gt;SDK&lt;/span&gt; we can easily &amp;#8220;patch&amp;#8221; the
junction file and also adding new dependencies from scratch is quite easy. Many
thanks to the Buildstream developers for the hard work invested in the&amp;nbsp;project!&lt;/p&gt;
&lt;p&gt;As a conclusion, all our WebKitGTK and WPEWebKit &lt;a class="reference external" href="https://build.webkit.org/"&gt;bots&lt;/a&gt; are now using the &lt;span class="caps"&gt;SDK&lt;/span&gt;.
JHBuild remains available for now, but on opt-in basis. The goal is to gently
migrate most of our developers to this new setup and eventually JHBuild will be
phased out. We still have some tasks pending, but we achieved very good progress
on improving the WebKit developer workflow. A few more things are now easier to
achieve with this new setup. Stay tuned for more! Thanks for&amp;nbsp;reading!&lt;/p&gt;
</content><category term="misc"></category><category term="Projects"></category><category term="WebKit"></category></entry><entry><title>HTML overlays with GstWPE, the demo</title><link href="https://base-art.net/Articles/html-overlays-with-gstwpe-the-demo/" rel="alternate"></link><published>2019-12-08T15:00:00+01:00</published><updated>2019-12-08T15:00:00+01:00</updated><author><name>Philippe Normand</name></author><id>tag:base-art.net,2019-12-08:/Articles/html-overlays-with-gstwpe-the-demo/</id><summary type="html">&lt;p&gt;Once again this year I attended the &lt;a class="reference external" href="https://gstreamer.freedesktop.org/conference/2019/"&gt;GStreamer conference&lt;/a&gt; and just before
that, &lt;a class="reference external" href="https://events19.linuxfoundation.org/events/embedded-linux-conference-europe-2019/"&gt;Embedded Linux conference Europe&lt;/a&gt; which took place in Lyon (France).
Both events were a good opportunity to demo one of the use-cases I have in mind
for &lt;a class="reference external" href="https://base-art.net/Articles/web-overlay-in-gstreamer-with-wpewebkit/"&gt;GstWPE&lt;/a&gt;, &lt;span class="caps"&gt;HTML&lt;/span&gt;&amp;nbsp;overlays!&lt;/p&gt;
&lt;p&gt;As we, at &lt;a class="reference external" href="https://igalia.com"&gt;Igalia&lt;/a&gt;, usually have a …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Once again this year I attended the &lt;a class="reference external" href="https://gstreamer.freedesktop.org/conference/2019/"&gt;GStreamer conference&lt;/a&gt; and just before
that, &lt;a class="reference external" href="https://events19.linuxfoundation.org/events/embedded-linux-conference-europe-2019/"&gt;Embedded Linux conference Europe&lt;/a&gt; which took place in Lyon (France).
Both events were a good opportunity to demo one of the use-cases I have in mind
for &lt;a class="reference external" href="https://base-art.net/Articles/web-overlay-in-gstreamer-with-wpewebkit/"&gt;GstWPE&lt;/a&gt;, &lt;span class="caps"&gt;HTML&lt;/span&gt;&amp;nbsp;overlays!&lt;/p&gt;
&lt;p&gt;As we, at &lt;a class="reference external" href="https://igalia.com"&gt;Igalia&lt;/a&gt;, usually have a booth at &lt;span class="caps"&gt;ELC&lt;/span&gt;, I thought a GstWPE demo would be
nice to have so we can show it there. The demo is a rather simple &lt;span class="caps"&gt;GTK&lt;/span&gt;
application presenting a live preview of the webcam video capture with an &lt;span class="caps"&gt;HTML&lt;/span&gt;
overlay blended in. The &lt;span class="caps"&gt;HTML&lt;/span&gt; and &lt;span class="caps"&gt;CSS&lt;/span&gt; can be modified using the embedded text
editor and the overlay will be updated accordingly. The final video stream can
even be streamed over &lt;span class="caps"&gt;RTMP&lt;/span&gt; to the main streaming platforms (Twitch, Youtube,
Mixer)! Here is a&amp;nbsp;screenshot:&lt;/p&gt;
&lt;img src="https://base-art.net/png/gst-wpe-broadcast-demo-screenshot.png"/&gt;&lt;p&gt;The code of the demo is available on &lt;a class="reference external" href="https://github.com/Igalia/gst-wpe-broadcast-demo"&gt;Igalia&amp;#8217;s GitHub&lt;/a&gt;. Interested people
should be able to try it as well, the app is packaged as a Flatpak. See the
instructions in the GitHub repo for more&amp;nbsp;details.&lt;/p&gt;
&lt;p&gt;Having this demo running on our booth greatly helped us to explain GstWPE and
how it can be used in real-life &lt;a class="reference external" href="https://gstreamer.freedesktop.org/"&gt;GStreamer&lt;/a&gt; applications. Combining the
flexibility of the Multimedia framework with the wide (wild) features of the Web
Platform will for sure increase the synergy and foster&amp;nbsp;collaboration!&lt;/p&gt;
&lt;p&gt;As a reminder, GstWPE is available in &lt;a class="reference external" href="https://gstreamer.freedesktop.org/"&gt;GStreamer&lt;/a&gt; since the 1.16 version. On the
roadmap for the mid-term I plan to add Audio support, thus allowing even better
integration between WPEWebKit and GStreamer. Imagine injecting &lt;span class="caps"&gt;PCM&lt;/span&gt; audio coming
from WPEWebKit into an audio mixer in your GStreamer-based application! Stay&amp;nbsp;tuned.&lt;/p&gt;
</content><category term="misc"></category><category term="Projects"></category><category term="GStreamer"></category><category term="WebKit"></category></entry><entry><title>Review of the Igalia Multimedia team Activities (2019/H1)</title><link href="https://base-art.net/Articles/review-of-the-igalia-multimedia-team-activities-2019h1/" rel="alternate"></link><published>2019-08-05T15:30:00+02:00</published><updated>2019-08-05T15:30:00+02:00</updated><author><name>Philippe Normand</name></author><id>tag:base-art.net,2019-08-05:/Articles/review-of-the-igalia-multimedia-team-activities-2019h1/</id><summary type="html">&lt;p&gt;This blog post takes a look back at the various Multimedia-related tasks the
&lt;a class="reference external" href="https://www.igalia.com/technology/multimedia"&gt;Igalia Multimedia team&lt;/a&gt; was involved in during the first half of&amp;nbsp;2019.&lt;/p&gt;
&lt;div class="section" id="gstreamer-editing-services"&gt;
&lt;h2&gt;GStreamer Editing&amp;nbsp;Services&lt;/h2&gt;
&lt;p&gt;Thibault added support for the &lt;a class="reference external" href="https://github.com/PixarAnimationStudios/OpenTimelineIO"&gt;OpenTimelineIO&lt;/a&gt; open format for editorial
timeline information. Having many editorial timeline information formats
supported by OpenTimelineIO reduces …&lt;/p&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;This blog post takes a look back at the various Multimedia-related tasks the
&lt;a class="reference external" href="https://www.igalia.com/technology/multimedia"&gt;Igalia Multimedia team&lt;/a&gt; was involved in during the first half of&amp;nbsp;2019.&lt;/p&gt;
&lt;div class="section" id="gstreamer-editing-services"&gt;
&lt;h2&gt;GStreamer Editing&amp;nbsp;Services&lt;/h2&gt;
&lt;p&gt;Thibault added support for the &lt;a class="reference external" href="https://github.com/PixarAnimationStudios/OpenTimelineIO"&gt;OpenTimelineIO&lt;/a&gt; open format for editorial
timeline information. Having many editorial timeline information formats
supported by OpenTimelineIO reduces vendor lock-in in the tools used by video artists in
post-production studios. For instance a movie project edited in Final Cut Pro
can now be easily reimported in the &lt;a class="reference external" href="https://pitivi.org"&gt;Pitivi&lt;/a&gt; free and open-source video editor.
This accomplishment was made possible by implementing an OpenTimelineIO &lt;span class="caps"&gt;GES&lt;/span&gt;
&lt;a class="reference external" href="https://github.com/PixarAnimationStudios/OpenTimelineIO/pull/412"&gt;adapter&lt;/a&gt; and &lt;a class="reference external" href="https://gitlab.freedesktop.org/gstreamer/gst-editing-services/merge_requests/67"&gt;formatter&lt;/a&gt;, both upstreamed respectively in OpenTimelineIO and &lt;span class="caps"&gt;GES&lt;/span&gt; by&amp;nbsp;Thibault.&lt;/p&gt;
&lt;img src="https://base-art.net/png/FcpAndPitivi.png"/&gt;&lt;p&gt;Another important feature for non-linear video editors is nested timeline
support. It allows teams to decouple big editing projects in smaller chunks that
can later on be assembled for the final product. Another use-case is about
pre-filling the timeline with boilerplate scenes, so that an initial version of
the movie can be assembled before all teams involved in the project have
provided the final content. To support this, Thibault implemented a &lt;a class="reference external" href="https://gitlab.freedesktop.org/gstreamer/gst-editing-services/blob/master/plugins/ges/gesdemux.c"&gt;&lt;span class="caps"&gt;GES&lt;/span&gt; demuxer&lt;/a&gt; which transparently enables
playback support for &lt;span class="caps"&gt;GES&lt;/span&gt; files (through &lt;a class="reference external" href="file://path/to/file.xges"&gt;file://path/to/file.xges&lt;/a&gt; URIs) in any GStreamer-based
media&amp;nbsp;player.&lt;/p&gt;
&lt;p&gt;As if this wasn&amp;#8217;t impressive enough yet, Thibault greatly improved the &lt;span class="caps"&gt;GES&lt;/span&gt;
unit-tests, fixing a lot of memory leaks, race conditions and generally
improving the reliability of the test suite. This is very important because the
Gitlab continuous integration now executes the tests harness for every submitted
merge&amp;nbsp;request.&lt;/p&gt;
&lt;p&gt;For more information about this, the curious readers can dive in &lt;a class="reference external" href="https://blogs.gnome.org/tsaunier/2019/04/22/gstreamer-editing-services-opentimelineio-support/"&gt;Thibault&amp;#8217;s blog post&lt;/a&gt;.
Thibault was invited to talk about these on-going efforts at &lt;a class="reference external" href="https://s2019.siggraph.org/"&gt;&lt;span class="caps"&gt;SIGGRAPH&lt;/span&gt;&lt;/a&gt; during
the &lt;a class="reference external" href="https://s2019.siggraph.org/presentation/?id=bof_124&amp;amp;sess=sess314"&gt;OpenTimelineIO &lt;span class="caps"&gt;BOF&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Finally, Thibault is mentoring &lt;a class="reference external" href="https://swaynethoughts.wordpress.com/"&gt;Swayamjeet Swain&lt;/a&gt; as part of the &lt;a class="reference external" href="https://summerofcode.withgoogle.com/"&gt;GSoC&lt;/a&gt; program,
the project is about adding nested timeline support in &lt;a class="reference external" href="https://pitivi.org"&gt;Pitivi&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="gstreamer-va-api"&gt;
&lt;h2&gt;GStreamer &lt;span class="caps"&gt;VA&lt;/span&gt;-&lt;span class="caps"&gt;API&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Víctor performed a good number of code reviews for GStreamer-&lt;span class="caps"&gt;VAAPI&lt;/span&gt; contributors,
he has also started investigating GStreamer-&lt;span class="caps"&gt;VAAPI&lt;/span&gt; bugs specific to the &lt;span class="caps"&gt;AMDGPU&lt;/span&gt;
Gallium driver, in order to improve the support of &lt;span class="caps"&gt;AMD&lt;/span&gt; hardware in multimedia&amp;nbsp;applications.&lt;/p&gt;
&lt;p&gt;As part of the on-going GStreamer community efforts to improve continuous
integration (&lt;span class="caps"&gt;CI&lt;/span&gt;) in the project, we purchased Intel and &lt;span class="caps"&gt;AMD&lt;/span&gt; powered devices
aimed to run validation tests. Running &lt;span class="caps"&gt;CI&lt;/span&gt; on real end-user hardware will help
ensure regressions remain under&amp;nbsp;control.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="servo-and-gstreamer-rs"&gt;
&lt;h2&gt;Servo and&amp;nbsp;GStreamer-rs&lt;/h2&gt;
&lt;p&gt;As part of our on-going involvement in the &lt;a class="reference external" href="https://servo.org/"&gt;Servo&lt;/a&gt; Mozilla project, &lt;a class="reference external" href="https://blogs.igalia.com/vjaquez"&gt;Víctor&lt;/a&gt; has
enabled zero-copy video rendering support in the GStreamer-based &lt;a class="reference external" href="https://github.com/servo/media"&gt;Servo-media&lt;/a&gt;
crate, along with &lt;a class="reference external" href="https://github.com/rust-windowing/glutin/pull/1082"&gt;bug fixes in Glutin&lt;/a&gt; and finally in &lt;a class="reference external" href="https://github.com/servo/servo/pull/23483"&gt;Servo itself&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A prior requirement for this major milestone was to enable gst-gl in the
GStreamer Rust bindings and after around 20 patches were merged in the
repository, we are pleased to announce Linux and Android platforms are
supported. Windows and macOS platforms will also be supported,&amp;nbsp;soon.&lt;/p&gt;
&lt;p&gt;The following screencast shows how hardware-accelerated video rendering performs
on Víctor&amp;#8217;s&amp;nbsp;laptop:&lt;/p&gt;
&lt;video controls src="https://s3.amazonaws.com/media-p.slid.es/videos/105177/rzteE40V/hwacceleration.mp4"/&gt;&lt;p&gt;Víctor also delivered a talk at the &lt;a class="reference external" href="https://www.meetup.com/MadRust/events/259059099/"&gt;MadRust&lt;/a&gt; meetup, about GStreamer-rs, the
&lt;a class="reference external" href="https://people.igalia.com/vjaquez/talks/madrust2019/"&gt;slides are available&lt;/a&gt; on his&amp;nbsp;website.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="webkit-s-media-source-extensions"&gt;
&lt;h2&gt;WebKit&amp;#8217;s Media Source&amp;nbsp;Extensions&lt;/h2&gt;
&lt;p&gt;As part of our on-going collaboration with various device manufacturers, &lt;a class="reference external" href="https://www.igalia.com/igalian/aboya"&gt;Alicia&lt;/a&gt;
and &lt;a class="reference external" href="https://www.igalia.com/igalian/eocanha"&gt;Enrique&lt;/a&gt; validated the &lt;a class="reference external" href="https://ytlr-cert.appspot.com/2019/main.html"&gt;Youtube &lt;span class="caps"&gt;TV&lt;/span&gt; &lt;span class="caps"&gt;MSE&lt;/span&gt; 2019 test suite&lt;/a&gt; in WPEWebKit-based&amp;nbsp;products.&lt;/p&gt;
&lt;p&gt;Alicia developed a new GstValidate plugin to improve GStreamer pipelines
testing, called &lt;a class="reference external" href="https://gstreamer.freedesktop.org/documentation/gst-devtools/plugins/validateflow.html?gi-language=c"&gt;validateflow&lt;/a&gt;. Make sure to read her &lt;a class="reference external" href="https://blogs.igalia.com/aboya/2019/05/14/validateflow-a-new-tool-to-test-gstreamer-pipelines/"&gt;blog post about it&lt;/a&gt;!.&lt;/p&gt;
&lt;p&gt;In her quest to further improve &lt;span class="caps"&gt;MSE&lt;/span&gt; support, especially seek support, Alicia
rewrote the GStreamer source element we use in WebKit for &lt;span class="caps"&gt;MSE&lt;/span&gt; playback. The code
&lt;a class="reference external" href="https://bugs.webkit.org/show_bug.cgi?id=199719"&gt;review is on-going in Bugzilla&lt;/a&gt; and on track for inclusion in WPEWebKit and
WebKitGTK 2.26. This new design of the &lt;span class="caps"&gt;MSE&lt;/span&gt; source element requires the playbin3
GStreamer element and at least GStreamer 1.16. Another feature we plan to work
on in the near future is multi-track support; stay&amp;nbsp;tuned!&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="webkit-webrtc"&gt;
&lt;h2&gt;WebKit&amp;nbsp;WebRTC&lt;/h2&gt;
&lt;p&gt;We announced &lt;a class="reference external" href="https://blogs.gnome.org/tsaunier/2018/07/31/webkitgtk-and-wpe-gains-webrtc-support-back/"&gt;LibWebRTC support for WPEWebKit and WebKitGTK&lt;/a&gt; one year ago.
Since then, Thibault has been implementing new features and fixing bugs in the
backend. Bridging between the WebAudio and WebRTC backend was implemented,
allowing tight integration of WebAudio and WebRTC web apps. More WebKit WebRTC
layout tests were unskipped in the buildbots, allowing better tracking of&amp;nbsp;regressions.&lt;/p&gt;
&lt;p&gt;Thibault also fixed various performance issues on Raspberry Pi platforms during
&lt;a class="reference external" href="https://appr.tc/"&gt;apprtc&lt;/a&gt; video-calls. As part of this effort he upstreamed a
&lt;a class="reference external" href="https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/commit/ee108d0ed20c376b5871b40108ba1cd54156baf9"&gt;GstUVCH264DeviceProvider&lt;/a&gt; in GStreamer, allowing applications to use
already-encoded H264 streams from webcams that provide it, thus removing the
need for applications to encode raw video&amp;nbsp;streams.&lt;/p&gt;
&lt;p&gt;Additionally, Thibault upstreamed a &lt;a class="reference external" href="https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/commit/ac5d0f7da688c1010ab2656f32c40e854e5b8bf2"&gt;device provider for &lt;span class="caps"&gt;ALSA&lt;/span&gt;&lt;/a&gt; in GStreamer,
allowing applications to probe for Microphones and speakers supported through
the &lt;span class="caps"&gt;ALSA&lt;/span&gt; kernel&amp;nbsp;driver.&lt;/p&gt;
&lt;p&gt;Finally, Thibault tweaked the GStreamer encoders used by the WebKit LibWebRTC
backend, in order to match the behavior of the Apple implementation and also
fixing a few performance and rendering issues on the&amp;nbsp;way.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="webkit-gstreamer-multimedia-maintenance"&gt;
&lt;h2&gt;WebKit GStreamer Multimedia&amp;nbsp;maintenance&lt;/h2&gt;
&lt;p&gt;The whole team is always keeping an eye on WebKit&amp;#8217;s Bugzilla, watching out for
multimedia-related bugs reported by the community members. &lt;a class="reference external" href="https://www.igalia.com/igalian/cturner"&gt;Charlie&lt;/a&gt; recently
fixed a few annoying &lt;a class="reference external" href="https://bugs.webkit.org/show_bug.cgi?id=197358"&gt;volume&lt;/a&gt; &lt;a class="reference external" href="https://bugs.webkit.org/show_bug.cgi?id=199505"&gt;bugs&lt;/a&gt; along with an issue related with &lt;a class="reference external" href="https://bugs.webkit.org/show_bug.cgi?id=197355"&gt;youtube&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I rewrote the &lt;a class="reference external" href="https://trac.webkit.org/changeset/243058/webkit"&gt;WebKitWebSrc&lt;/a&gt; GStreamer source element we use in WebKit to
download &lt;span class="caps"&gt;HTTP&lt;/span&gt;(S) media resources and feed the data to the playback pipeline.
This new element is now based on the GStreamer pushsrc base class, instead of
appsrc. A few seek-related issues were fixed on the way but unfortunately some
regressions also slipped in; those should all be fixed by now and shipped in
WPEWebKit/WebKitGTK&amp;nbsp;2.26.&lt;/p&gt;
&lt;p&gt;An initial version of the &lt;a class="reference external" href="https://w3c.github.io/media-capabilities/"&gt;MediaCapabilities&lt;/a&gt; &lt;a class="reference external" href="https://bugs.webkit.org/show_bug.cgi?id=191191"&gt;backend&lt;/a&gt; was also upstreamed in
WebKit. It allows web-apps (such as Youtube &lt;span class="caps"&gt;TV&lt;/span&gt;) to probe the user-agent for
media decoding and encoding capabilities. The GStreamer backend relies on the
GStreamer plugin registry to provide accurate information about the supported
codecs and containers. &lt;a class="reference external" href="https://bugs.webkit.org/show_bug.cgi?id=198569"&gt;H264 &lt;span class="caps"&gt;AVC1&lt;/span&gt; profile and level&lt;/a&gt; information are also&amp;nbsp;probed.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="wpeqt"&gt;
&lt;h2&gt;WPEQt&lt;/h2&gt;
&lt;p&gt;Well, this isn&amp;#8217;t directly related with multimedia, but I finally announced the
initial release of &lt;a class="reference external" href="https://base-art.net/Articles/introducing-wpeqt-a-wpe-api-for-qt5/"&gt;WPEQt&lt;/a&gt;. Any feedback is welcome, QtWebKit has phased out and
if anyone out there relies on it for web-apps embedded in native &lt;span class="caps"&gt;QML&lt;/span&gt; apps, now
is the time to try&amp;nbsp;WPEQt!&lt;/p&gt;
&lt;/div&gt;
</content><category term="misc"></category><category term="Projects"></category><category term="WebKit"></category><category term="GStreamer"></category></entry></feed>