Is it possible to control/change remote peerconnection's constraints/record footage using webrtc? - webrtc

I'm trying to build an web app where there's a broadcaster of a camera stream, and viewers who can watch and control the stream. Is it possible for a viewer to control the constraints of the camera (exposure, brightness, etc.) and possibly pause, rewind, and record footage, being used to broadcast the stream using webrtc? Wanted to know before I decide to use webrtc as the way to accomplish this task. Based on my reading of the webrtc guide and example pages, I think recording is possible. But I wasn't sure about a remote peerconnection changing the local peerconnection's settings or vice versa.

Related

Access basler camera through IP address

How can get live stream from basler camera through IP address?
I am following the basler documentation
https://docs.baslerweb.com/overview-of-the-pylon-ip-configurator
if by live stream you mean RTSP compressed stream or similar, then Basler pylon does not give you such direct possibility.
Pylon SDK is meant to be used for Basler's industrial grade cameras that operate with uncompressed image buffers via pylon API (C++, .NET, ect). So pylon gives you access to camera and image data as such and does not do much more.
To address RSTP streaming, with pylon you can generally create a custom worker application that connects and runs camera on the one hand, creates and maintains RTSP stream with use of i.e. FFmpeg/FF on the other, and feeds this stream with incoming image buffers.
Some related links:
https://docs.baslerweb.com/pylonapi/
https://trac.ffmpeg.org/wiki/StreamingGuide/
Or, if you just want to initialize camera & have live image preview on screen - use pylon Viewer, it has fullscreen function.
IP Configurator is the tool for matching device IP with your NIC card for GigE based Basler cameras. Tutorial how to set up GigE cameras and make them visible in Pylon Viewer:
https://docs.baslerweb.com/assigning-an-ip-address-to-a-camera

Does Google webrtc native implementation have support for SFU?

Does Google WebRTC Native implementation has support for SFU?
Does Google WebRTC Native implementation support for integrating custom/hardware encoder/decoder?
Not without alteration.
Internally WebRTC's internal audio/video pipelines are directly tied to encoder/decoders.
PeerConnectionFactory allows you to provide a video decoder/encoder factory, so you can short circuit the logic here, and grab the encoded frames, mock up a stream, and feed them directly into it as a relay, creating a new PeerConnection and setting those streams onto it.
The audio end is more difficult. There isn't a codec factory, so you will have to short circuit the logic there probably by alteration of libwebrtc.
The final question is RTCP termination, and how to override the mechanisms for quality/bandwidth control to not create a "One goes out, they all go out." situation.
Since libwebrtc will be the SFU, it will receive RTCP feedback from its remote peer for the content it is proxying, and vice versa.
For a 1-1 situation, it needs to be able to forward the RTCP feedback to the remote peer.
For multipoint, it needs to perform some logic to determine if one of the peers is problematic, and stop sending it video, switch off its video feed, or attempt to switch to a lower bitrate video stream. Basically it needs to act as a conduit that attempts to predict why/how packet loss is occurring, and keep as many audio/video feeds operating normally at at the highest possible quality for each peer.
How exactly to hijack the RTCP feedback mechanisms in libwebrtc, I think that again will likely require some customization/hooks into libwebrtc
I think it will be easier to try with GStreamer implementation of WebRTC. Although it is still in "Bad Plugins" it is way easier to get or provide encoded audio and video. Actually it is implemented in that in mind - to make implementation of MFU and SFU easier.

Stream html5 camera output

does anyone know how to stream html5 camera output to other users.
If that's possible should I use sockets, images and stream them to the users or other technology.
Is there any video tutorial where I can take a look about it.
Many thanks.
The two most common approaches now are most likely:
stream from the source to a server, and allow users connect to the server to stream to their devices, typically using some form of Adaptive Bit Rate streaming protocol (ABR - basically creates multiple bit rate versions of your content and chunks them, so the client can choose the next chunk from the best bit rate for the device and current network conditions).
Stream peer to peer, or via a conferencing hub, using WebRTC
In general, the latter is more focused towards real time, e.g. any delay should be below the threshold which would interfere with audio and video conferences, usually less than 200ms for audio for example. To achieve this it may have to sacrifice quality sometimes, especially video quality.
There are some good WebRTC samples available online (here at the time of writing): https://webrtc.github.io/samples/

Server side real time analysis of video streamed from client

I'm trying to build a system for real-time analysis on server for video streamed from the client using WebRTC.
Here is what I currently have in mind. I would capture the webcam video stream from the client and send it (compressed using H.264?) to my server.
On my server, I would receive the stream and every raw frame to my C++ library for analysis.
The output of the analysis (box coordinates to draw) would then be sent back to the client via WebRTC or a separate WebSocket connection.
I've been looking online and found open-source media server like Kurento and Mediasoup but, since I only need to read the stream (no dispatch to other clients), do I really need to use an existing server? Or could I build it myself and if so, where to start?
I'm fairly new to the WebRTC and video streaming world in general so I was wondering, does this whole thing sound right to you?
That depends on how real-time your requirements are. If you want 30-60fps and near-realtime, getting the images to the server via RTP is the best solution. And then you'll need things like a jitter buffer, depacketization etc, video decoders, etc.
If you require only one image per second, grabbing it from the canvas and sending it via Websockets or HTTP POST is easier. https://webrtchacks.com/webrtc-cv-tensorflow/ shows how to do that in Python.

rtmp live AND RTMP FLV

how to interrupt rtmp flv broadcast and publish live rtmp broadcast on red5?
I am using osmf strobe player. I have my flv playlist working but when I broadcast live from my webcam what is the formula to stop the flv streams, then play flv countdown video then connect live broadcast from web cam?
Here is how I would do it, from a high-level since I don't have the code for what you're asking and "easy" transitions between streams isn't built-in to the server.
First, create a signaling or event system within your app to accept actions triggered by your broadcaster. Using the signaling system, transition your subscribers / viewers by sending triggered events telling their players to stop playing a current video and start a new one. I suggest using Shared Objects for this when passing signals around. Use server-side methods called by your broadcaster to send the signals on the Share Object. The "play" functionality is the easy part since you simply provide the stream name in your signal / event.