Quinnquicsink sample code

can someone please help to create some sample code to use quinnquicsink ?

I would to stream a video using quinnquicsink over a quic server from: aioquic/examples/http3_server.py at main · aiortc/aioquic · GitHub

python3 examples/http3_server.py --host 0.0.0.0 --certificate tests/ssl_cert.pem --private-key tests/ssl_key.pem --port 4433

to my browser running as :

./Google\ Chrome --enable-experimental-web-platform-features \
  --ignore-certificate-errors-spki-list=somekey+DSNk2XTZ/MS6xCbo9qu++VdQ= \
  --origin-to-force-quic-on= localhost:4433 \
  https://localhost:4433/

my pipeline is:

GST_DEBUG=3 gst-launch-1.0 videotestsrc ! video/x-raw,width=1280,height=720,format=RGBx,framerate=60/1  \
       ! timeoverlay time-mode=running-time     ! queue     ! videoconvert     ! vp8enc target-bitrate=1000000 keyframe-max-dist=30    \
       ! video/x-vp8,framerate=60/1     ! rtpvp8pay    \
        ! quinnquicsink use-datagram=true bind-address="0.0.0.0" bind-port=6000 address="127.0.0.1" port=4433 \
        secure-connection=false       alpn-protocols="<\"http/1.1\",\"h2\",\"h3\">" certificate-file="aioquic/tests/ssl_cert.pem" \
        private-key-file="aioquic/tests/ssl_key.pem"'

my index.html

<!DOCTYPE html>
<html>
<head>
    <title>WebTransport Test</title>
    <style>
        video {
            width: 100%;
            height: auto;
            background-color: black;
        }
    </style>
</head>
<body>
    <h1>WebTransport Test</h1>
    <video id="video" controls autoplay></video>
    <script>
        async function connect() {
            try {
                const url = 'https://localhost:4433/wt';
                const transport = new WebTransport(url);
                await transport.ready;
                console.log('Connected.');

                let stream = await transport.createBidirectionalStream();
                let reader = stream.readable.getReader();
                let writer = stream.writable.getWriter();

                await writer.write(new Uint8Array([65, 66, 67]));
                let received = await reader.read();
                console.log('received', received);

                // Debugging messages
                transport.datagrams.readable.getReader().read().then(({ value, done }) => {
                    if (!done) {
                        console.log('Datagram received:', value);
                    }
                });

                transport.closed.then(() => {
                    console.log('Transport closed');
                }).catch((error) => {
                    console.log('Transport error:', error);
                });

            } catch (error) {
                console.error('Failed to connect:', error);
            }
        }

        connect();
    </script>
</body>
</html>

Everthing seems to be connected to the server happily but there is no video displayed
If I use :
use-datagram=true

there is errors on the server where can not handle the stream_id
logs:
Received datagram for unknown stream_id: 58810836

I have not looked at WebTransport but don’t think this is supposed to work like this. WebTransport uses HTTP/3 which in turn uses QUIC, but, that is different to using QUIC by itself.

The quinnquic plugins are only for QUIC. Also, if you are using secure-connection as false, then certificate and key file are not needed.

Since your index.html is looking to read datagrams, use-datagram needs to be true.

If you only want to test/work with QUIC, quinnquicsink can be used along with quinnquicsrc.

Adding to Sanchayan’s reply, I think the quinn elements are likely to be a test vehicle for us to try to realise different application layer protocols on top. Having a WebTransport (and RoQ, MoQ, …) implementation on top would be quite nice indeed, though it might take some steps to get there.

There was some discussion about this at New WebTransport sink/bin interface (#1571) · Issues · GStreamer / gstreamer · GitLab as well