1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] GStreamer pipeline using WebRTC

Discussão em 'Python' iniciado por Stack, Outubro 1, 2024 às 06:23.

  1. Stack

    Stack Membro Participativo

    I'm now working on a project where I need to stream video in real time and save photos every a couple of minutes so I've started learning about GStreamer. I currently have a working pipeline using udpsink but I'm struggling a lot with WebRTC (I'm now trying to migrate to a web base application). I understand how WebRTC works but whenever I try to build something I failed misserably. I've found this repo: https://github.com/imdark/gstreamer-webrtc-demo/tree/master

    I have problems making it work but I found it easier to ask for a specific code that I suppose works that building my own from 0. I can't find any tutorials and readme files aren't helping much. I'm building my project with python so I tried to use that part of the repo but I always encounter problems. I've used Docker before but not with anything showing on screen. When I make docker compose with the gst (that calls executable in C not Python but to try) doesnt show anything on screen. Then if I start simple server on signalling folder it loads correctly but when I launch the clients I always get errors like this one:

    ./session-client.py
    Our uid is 'ws-test-client-a7e4e8'
    Traceback (most recent call last):
    File "/home/grius/Downloads/gstreamer-webrtc-demo-master/signalling/./session-client.py", line 81, in <module>
    asyncio.get_event_loop().run_until_complete(hello())
    File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
    File "/home/grius/Downloads/gstreamer-webrtc-demo-master/signalling/./session-client.py", line 48, in hello
    async with websockets.connect(SERVER_ADDR, ssl=sslctx) as ws:
    File "/home/grius/.local/lib/python3.10/site-packages/websockets/legacy/client.py", line 635, in __aenter__
    return await self
    File "/home/grius/.local/lib/python3.10/site-packages/websockets/legacy/client.py", line 654, in __await_impl__
    _transport, protocol = await self._create_connection()
    File "/usr/lib/python3.10/asyncio/base_events.py", line 1103, in create_connection
    transport, protocol = await self._create_connection_transport(
    File "/usr/lib/python3.10/asyncio/base_events.py", line 1133, in _create_connection_transport
    await waiter
    File "/usr/lib/python3.10/asyncio/selector_events.py", line 862, in _read_ready__data_received
    data = self._sock.recv(self.max_size)
    ConnectionResetError: [Errno 104] Connection reset by peer
    grius@grius:~/Downloads/gstreamer-webrtc-demo-master/signall


    So basically I would need a brief tutorial on make this works, if this repo really works. Or another tutorial using Python for gstreamer and webrtc. Thanks in advance and have you all a great day :)

    Continue reading...

Compartilhe esta Página