Examples of handling a WebRTC stream?
yosemitebandit opened this issue · comments
I've been able to create an SDP file (with pointers from #115) and successfully get a response from my device (nest wired doorbell) via:
$ poetry run google_nest --project_id="${PROJECT_ID}" generate_web_rtc_stream DEVICE_ID /path/to/offer.sdp
but I get errors when I try to play:
$ sudo ffplay -protocol_whitelist file,udp,rtp -loglevel debug -i /tmp/answer.sdp
ffplay version 7.0 Copyright (c) 2003-2024 the FFmpeg developers
...
[udp @ 0x600002a74280] bind failed: Address already in use
[AVIOContext @ 0x1342056e0] Statistics: 2335 bytes read, 0 seeks
/tmp/answer-py.sdp: Invalid data found when processing input
are there examples of working with the answer SDP data using python / ffmpeg or something else? Ultimately I'd like to extract a frame from the stream.
I have only experience using it through a browser based webrtc implementation. Here is the context and a writeup of all that I learned about how webrtc works home-assistant/architecture#640 with a browser player https://github.com/home-assistant/frontend/blob/dev/src/components/ha-web-rtc-player.ts
I am not aware that it works out of the box with ffmpeg or anything like that. You maybe could try looking at the go samples in https://github.com/pion/example-webrtc-applications
I won't really be able to help you make a non-browser based webrtc player. Happy to share what i know on the browser side though.
Thank you for the great resources, I'll start there!