WebRTC | Home Assistant custom component | Camera library
kandi X-RAY | WebRTC Summary
kandi X-RAY | WebRTC Summary
Home Assistant custom component for viewing IP cameras RTSP stream in real time using WebRTC and MSE technology. Starting with version 2 the component supports two protocols automatically and simultaneously. WebRTC in some cases may not work with remote access, then the video will play using MSE. As soon as WebRTC is able to connect - video will play through it, MSE will be stopped.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of WebRTC
WebRTC Key Features
WebRTC Examples and Code Snippets
Community Discussions
Trending Discussions on WebRTC
QUESTION
I'm encoding a video frame with the ffmpeg
libraries, generating an AVPacket
with compressed data.
Thanks to some recent advice here on S/O, I am trying to send that frame over a network using the WebRTC
library libdatachannel
, specifically by adapting the example here:
https://github.com/paullouisageneau/libdatachannel/tree/master/examples/streamer
I am seeing problems inside h264rtppacketizer.cpp
(part of the library, not the example) which are almost certainly to do with how I'm providing the sample data.
(I don't think that this is anything to do with libdatachannel specifically, it will be an issue with what I'm sending)
The example code reads each encoded frame from a file, and populates a sample
by setting the content of the file to the contents of the file:
sample = *reinterpret_cast *>(&fileContents);
sample
is just a std::vector;
I have naively copied the contents of an AVPacket->data
pointer into the sample
vector:
ANSWER
Answered 2022-Mar-31 at 09:16The input files of the streamer example for libdatachannel use 32-bit length as NAL unit separator. Therefore, the H264RtpPacketizer
instance is created with H264RtpPacketizer::Separator::Length
.
If I'm not mistaken the ffmpeg output will have 4-byte start sequences as NAL unit prefix instead (which is actually more common), so if you change the packetizer setting to H264RtpPacketizer::Separator::LongStartSequence
it should accept your sample.
QUESTION
I'm building a C++ GStreamer project with CMake which depends on GStreamer, GLIB, Libsoup and json-glib. I'm new to CMake and having trouble setting up my project. I've managed to include many of the dependencies but some seem to remain unresolved even though they are part of GStreamer. All GStreamer methods and types are resolved with the exception of SDP and WebRTC. They are, to my understanding, part of GStreamer and are also located inside of the directory which GMake correctly "finds".
These are the errors that are occurring when trying to build the project.
...ANSWER
Answered 2022-Mar-29 at 10:12I've managed to solve it by using a premade find script I found online.
https://chromium.googlesource.com/external/Webkit/+/master/Source/cmake/FindGStreamer.cmake
It creates all necessary defines which I then include and link.
These are the defaults as specified in the FindGStreamer.cmake file
QUESTION
I am trying to display received WebRTC frames using OpenCV imshow()
. WebRTC delivers frames as objects of webrtc::VideoFrame
and in my case, I can access webrtc::I420Buffer
from it. Now my question is how do I convert the data in webrtc::I420Buffer
to cv::Mat
, so that I can give it to imshow()
?
Thsi is what the definition of webrtc::I420Buffer
looks like
ANSWER
Answered 2022-Mar-24 at 22:35The main issue is converting from I420 color format to BGR (or BGRA) color format used by OpenCV.
Two good options for color conversion:
- Using
sws_scale
- part of the C interface libraries of FFmpeg. - Using IPP color conversion function like ippiYCbCr420ToBGR_709HDTV_8u_P3C4R.
We may also use cv::cvtColor with cv::COLOR_YUV2BGR_I420
argument.
This is less recommended, because the Y, U and V color channels must be sequential in memory - in the general case, it requires too many "deep copy" operations.
After the color conversion we may use cv:Mat constructor that "wraps" the BGR (or BGRA) memory buffer (without using "deep copy").
Example (the terms "step", "stride" and "linesize" are equivalent):
QUESTION
After upgrading to android 12, the application is not compiling. It shows
"Manifest merger failed with multiple errors, see logs"
Error showing in Merged manifest:
Merging Errors: Error: android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify an explicit value for
android:exported
when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. main manifest (this file)
I have set all the activity with android:exported="false"
. But it is still showing this issue.
My manifest file:
...ANSWER
Answered 2021-Aug-04 at 09:18I'm not sure what you're using to code, but in order to set it in Android Studio, open the manifest of your project and under the "activity" section, put android:exported="true"(or false if that is what you prefer). I have attached an example.
QUESTION
I am trying to build a webrtc flutter app on my m1 macbook air. But I got different issues both on android and ios. Latest one ^0.8.2 has error on both then ^0.7.0+hotfix.1 demo demo only works for android.
On iOS part 'Libyuv''s deployment target is set to 8.0 but min deployment target is 9.0 occurs. I set the deployment target above 10 then it still happens.
...ANSWER
Answered 2022-Feb-09 at 13:16For version ^0.8.2 following solutions work for me.
iOS
in ios/Podfile add following to end of file.
QUESTION
I have been reading a bit about WebRTC, and I'm not getting why we need a Turn Server if only 1 peer is using Symmetric NAT, and the other is using neither Symmetric nor Port Restricted NAT, so let’s say A is using Full Cone NAT, B is using Symmetric NAT:
STUN SERVER will send the correct IP address of B to A, and the correct IP + Port address of A to B.
A tries to connect to B (now A will be able to accept messages from B since it’s in the Dest Address Column).
B tries to connect to A, which will allow requests from A going to B (ofc A needs to update the port to the one received from B instead of the Sdp).
am I missing something, or is this correct (and implemented), or is this too complicated to be implemented?
And if this is correct, then theoretically, if I’m peer A and I'm using Full Cone NAT, any peer B can connect to me (as long as I send the connection request first), without needing a TURN server.
Thanks
...ANSWER
Answered 2021-Aug-01 at 18:09If the symmetric NAT environment only changes the port, you would be correct with regarding connectivity to Full Cone NAT. The hole punching step would work.
But many enterprise and mobile environments have complex routing schemes and crazy network environments that are different from a legacy home network router. These environments aren't just a little router box that hooks up to a cable modem. It's a complex array of routers and load balancers using a bank of IP addresses. And each outbound connection might get an IP address different from a previous connection. So it's technically "symmetric NAT".
And so after a node within this environment obtains an external IP/port pair from a STUN server, subsequent sends to a peer address might change both both the port and the IP address as well.
As such, the NATs see completely different IP addresses than expected when the UDP packets arrive during the hole punching step. Hence, a relay address (TURN) is needed here.
QUESTION
I have a task, but I can't seem to get it done. I've created a very simple WebRTC stream on a Raspberry Pi which will function as a videochat-camera. With ionic I made a simple mobile application which can display my WebRTC stream when the phone is connected to the same network. This all works.
So right now I have my own local stream which shows on my app. I now want to be able to broadcast this stream from my phone to a live server, so other people can spectate it.
I know how to create a NodeJS server which deploys my webcam with the 'getUserMedia' function. But I want to 'push' my WebRTC stream to a live server so I can retrieve a public URL for it.
Is there a way to push my local Websocket to a live environment? I'm using a local RTCPeerConnection to create a MediaStream object
...ANSWER
Answered 2021-Dec-10 at 16:54Is there a way to push my local Websocket to a live environment?
It's not straightforward because you need more than vanilla webrtc (which is peer-to-peer). What you want is an SFU. Take a look at mediasoup.
To realize why this is needed think about how the webrtc connection is established in your current app. It's a negotiation between two parties (facilitated by a signaling server). In order to turn this into a multi-cast setup you will need a proxy of sorts that then establishes separate peer-to-peer connections to all senders and receivers.
QUESTION
First, I want to mention that I am very new to WebRTC, so any advice would be very helpful.
Currently I am using aiortc
library to build my own WebRTC app.
Here is what I am trying to do.
I have 2 peers, one is web browser, which is written in javascript, and another one is python script, which is working as signaling server and peer at the same time. So If you access to my web page, you will send video frame to server and then the server will make modification of that then send it back.
So I finished testing my app on LAN environment and everything worked as I expected. But once I deployed my app to remote server (Google cloud run) , I encountered Ice connection state failing issue. And gets this log on remote server.
(I think it is due to disconnection between peers, not low memory problem. I tried with 16GB RAM and 4 cpus and still didn't work)
Then, I dig into more information, and found that TURN/STUN server is necessary to build WebRTC app over Internet. So I added google STUN server to my RTCPeerConnection
like this. [{'urls': 'stun:stun.l.google.com:19302'}, {'urls': 'stun:stun1.l.google.com:19302'}, {'urls': 'stun:stun2.l.google.com:19302'}]
(I added both side on javascript and python because both side is working as peer) Unfortunately, it still didn't work.
Now, I am planning to build my own TURN server, but I am afraid if TURN server wouldn't solve this problem. So I would like to have any advice from you since I am quite stuck within my situation.
p.s I have done SSL encryption.(So GetUserMedia
is working fine)
Sdp details(Offer/Answer):
SDP
Offer
...ANSWER
Answered 2021-Dec-10 at 15:13If everything work on local, and this ice server are set, verify that your gcloud server have the correct firewall for webrtc port (not only your signaling port, check the sdp/ice you exchange). also this Webrtc page allow you to check is a stun/turn work on your client
You will not need stun on your python side, as it's a server his ip may be public (unless you don't want to). Stun allow to find your public ip and allow the port to remain open.
On your server you need to open your signaling port (certainly the WS where you exchange the sdp) and the P2P port (candidate lines in the sdp), the media/data will go through this one. For each media (sdp m line) there are usually one used port.
QUESTION
I followed this post on Stackoverflow to disable Firefox WebDriver
detection.
Launch Geckodriver:
...ANSWER
Answered 2021-Nov-20 at 23:58BotD detects you because you do not override navigator.webdriver attribute.
I was able to override it with this code:
QUESTION
It has been discussed many times on Stackoverflow that by default WebRTC technology leaks your real IP even if your using a proxy to browse the web. What I haven't seen discussed is whether this requires the end user to click a button to enable this kind of leak or whether the leak occurs regardless of any action taken by the user.
For example, when you go to Express VPN they require you press a button to test for WebRTC leak. My question is - is this done for privacy reasons or somehow the button activates WebRTC tech so it can leak your IP?
In other words, assuming you never need to use WebRTC tech (just browser a blog or eCommerce shop) and all you do is click a few links - can a website still detect your real IP through WebRTC?
Thanks
...ANSWER
Answered 2021-Nov-16 at 18:59Yes, a browser can detect your public IP address using WebRTC.
No, the leak is not reliant on your button interaction.
Recently, I found an unpatched github repo webrtc-ip, which can leak a user's public IP address using WebRTC. This is powerful because you cannot trace it, as nothing is shown in the Networks tab.
Sadly, this leak does not work for private IPs, due to the gradual shift to mDNS (at least for WebRTC), which is described completely in this great blog. Anyways,a here's a working demo:
https://webrtc-ip.herokuapp.com/
I am not sure if this leaks your true IP address even if you are using a proxy, but feel free to test it out.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install WebRTC
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page