webrtc-streamer 0.8.14 → 0.8.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/c_cpp_properties.json +1 -0
- package/README.md +12 -4
- package/docs/class-diagram.md +103 -0
- package/html/admin.html +4 -1
- package/html/libs/whep-video.component.js +1 -1
- package/html/styles.css +2 -1
- package/html/webrtc-streamer-element.html +20 -5
- package/html/whep.html +12 -10
- package/package.json +2 -2
- package/cxxopts/src/example.cpp +0 -202
- package/libv4l2cpp/inc/V4l2Access.h +0 -51
- package/libv4l2cpp/inc/V4l2Capture.h +0 -35
- package/libv4l2cpp/inc/V4l2Device.h +0 -126
- package/libv4l2cpp/inc/V4l2MmapDevice.h +0 -50
- package/libv4l2cpp/inc/V4l2Output.h +0 -37
- package/libv4l2cpp/inc/V4l2ReadWriteDevice.h +0 -31
- package/libv4l2cpp/inc/logger.h +0 -79
- package/libv4l2cpp/src/V4l2Access.cpp +0 -20
- package/libv4l2cpp/src/V4l2Capture.cpp +0 -90
- package/libv4l2cpp/src/V4l2Device.cpp +0 -253
- package/libv4l2cpp/src/V4l2MmapDevice.cpp +0 -307
- package/libv4l2cpp/src/V4l2Output.cpp +0 -106
- package/libv4l2cpp/src/V4l2ReadWriteDevice.cpp +0 -29
- package/libv4l2cpp/src/logger.cpp +0 -14
package/README.md
CHANGED
|
@@ -65,6 +65,8 @@ Usage:
|
|
|
65
65
|
-s, --stun [=arg(=0.0.0.0:3478)]
|
|
66
66
|
Use an external STUN server
|
|
67
67
|
-R, --udp-range arg Set the webrtc udp port range
|
|
68
|
+
-e, --extra-host arg Add extra ICE candidate address (for
|
|
69
|
+
Docker/NAT)
|
|
68
70
|
-W, --trials arg Set the webrtc trials fields
|
|
69
71
|
-a, --audio-layer [=arg(=)] Specify audio capture layer to use (omit
|
|
70
72
|
value for dummy audio)
|
|
@@ -149,18 +151,22 @@ The container entry point is the webrtc-streamer application, then you can:
|
|
|
149
151
|
- run the container registering a RTSP url:
|
|
150
152
|
|
|
151
153
|
```sh
|
|
152
|
-
docker run -p 8000:8000 -it mpromonet/webrtc-streamer -n raspicam -u rtsp://pi2.local:8554/unicast
|
|
154
|
+
docker run --name webrtc -d -p 8000:8000 -it mpromonet/webrtc-streamer -n raspicam -u rtsp://pi2.local:8554/unicast
|
|
153
155
|
```
|
|
154
156
|
- run the container giving config.json file:
|
|
155
157
|
|
|
156
158
|
```sh
|
|
157
|
-
docker run -p 8000:8000 -v $PWD/config.json:/usr/local/share/webrtc-streamer/config.json mpromonet/webrtc-streamer
|
|
159
|
+
docker run --name webrtc -d -p 8000:8000 -v $PWD/config.json:/usr/local/share/webrtc-streamer/config.json mpromonet/webrtc-streamer
|
|
158
160
|
```
|
|
159
161
|
|
|
160
162
|
- run the container using network host:
|
|
161
163
|
|
|
162
164
|
```sh
|
|
163
|
-
docker run --net host mpromonet/webrtc-streamer
|
|
165
|
+
docker run --name webrtc -d --net host mpromonet/webrtc-streamer
|
|
166
|
+
```
|
|
167
|
+
- run the container adding extrahost
|
|
168
|
+
```sh
|
|
169
|
+
docker run --name webrtc -d -p 8000:8000 --add-host host.docker.internal:host-gateway mpromonet/webrtc-streamer -e host.docker.internal
|
|
164
170
|
```
|
|
165
171
|
|
|
166
172
|
## Using embedded STUN/TURN server behind a NAT
|
|
@@ -395,7 +401,9 @@ dependencies above:
|
|
|
395
401
|
3. Build WebRTC Streamer
|
|
396
402
|
|
|
397
403
|
```sh
|
|
398
|
-
|
|
404
|
+
export PATH=$PATH:`realpath ../webrtc/src/third_party/llvm-build/Release+Asserts/bin`
|
|
405
|
+
cmake -DCMAKE_C_COMPILER=clang .
|
|
406
|
+
make
|
|
399
407
|
```
|
|
400
408
|
|
|
401
409
|
It is possible to specify cmake parameters `WEBRTCROOT` &
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# webrtc-streamer class diagram
|
|
2
|
+
|
|
3
|
+
```mermaid
|
|
4
|
+
classDiagram
|
|
5
|
+
direction LR
|
|
6
|
+
|
|
7
|
+
class CapturerFactory {
|
|
8
|
+
<<factory>>
|
|
9
|
+
+GetVideoCaptureDeviceList()
|
|
10
|
+
+GetAudioCaptureDeviceList()
|
|
11
|
+
+GetAudioPlayoutDeviceList()
|
|
12
|
+
+CreateVideoSource(videourl, opts, publishFilter, peerConnectionFactory, videoDecoderFactory)
|
|
13
|
+
+CreateAudioSource(audiourl, opts, publishFilter, peerConnectionFactory, audioDecoderFactory, audioDeviceModule)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
class PeerConnectionManager {
|
|
17
|
+
+InitializePeerConnection()
|
|
18
|
+
+CreateVideoSource(videourl, opts)
|
|
19
|
+
+CreateAudioSource(audiourl, opts)
|
|
20
|
+
+AddStreams(peerConnection, videourl, audiourl, options)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
class PeerConnectionObserver
|
|
24
|
+
class PeerConnectionFactoryInterface
|
|
25
|
+
class PeerConnectionInterface
|
|
26
|
+
|
|
27
|
+
%% VIDEO SIDE
|
|
28
|
+
class VideoTrackSourceInterface
|
|
29
|
+
class VideoTrackSource
|
|
30
|
+
class VideoSourceInterfaceFrame
|
|
31
|
+
|
|
32
|
+
class TrackSource {
|
|
33
|
+
<<template>>
|
|
34
|
+
+Create(videourl, opts, videoDecoderFactory)
|
|
35
|
+
+GetStats(stats)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
class VideoSource {
|
|
39
|
+
+AddOrUpdateSink(sink, wants)
|
|
40
|
+
+RemoveSink(sink)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
class VideoDecoder {
|
|
44
|
+
+AddOrUpdateSink(sink, wants)
|
|
45
|
+
+RemoveSink(sink)
|
|
46
|
+
+Decoded(decodedImage)
|
|
47
|
+
+PostFrame(content, ts, frameType)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
class DesktopCapturer
|
|
51
|
+
class ScreenCapturer
|
|
52
|
+
class WindowCapturer
|
|
53
|
+
class VcmCapturer
|
|
54
|
+
class V4l2Capturer
|
|
55
|
+
class LiveVideoSource
|
|
56
|
+
class RTSPVideoCapturer
|
|
57
|
+
class FileVideoCapturer
|
|
58
|
+
class RTPVideoCapturer
|
|
59
|
+
class RtmpVideoSource
|
|
60
|
+
|
|
61
|
+
VideoTrackSourceInterface <|.. VideoTrackSource
|
|
62
|
+
VideoTrackSource <|-- TrackSource
|
|
63
|
+
VideoSourceInterfaceFrame <|.. VideoSource
|
|
64
|
+
VideoSourceInterfaceFrame <|.. VideoDecoder
|
|
65
|
+
VideoSource <|-- DesktopCapturer
|
|
66
|
+
DesktopCapturer <|-- ScreenCapturer
|
|
67
|
+
DesktopCapturer <|-- WindowCapturer
|
|
68
|
+
VideoSource <|-- VcmCapturer
|
|
69
|
+
VideoSource <|-- V4l2Capturer
|
|
70
|
+
VideoDecoder <|-- LiveVideoSource
|
|
71
|
+
LiveVideoSource <|-- RTSPVideoCapturer
|
|
72
|
+
LiveVideoSource <|-- FileVideoCapturer
|
|
73
|
+
LiveVideoSource <|-- RTPVideoCapturer
|
|
74
|
+
VideoDecoder <|-- RtmpVideoSource
|
|
75
|
+
|
|
76
|
+
%% AUDIO SIDE
|
|
77
|
+
class AudioSourceInterface
|
|
78
|
+
class LiveAudioSource {
|
|
79
|
+
+AddSink(sink)
|
|
80
|
+
+RemoveSink(sink)
|
|
81
|
+
+onNewSession(...)
|
|
82
|
+
+onData(...)
|
|
83
|
+
}
|
|
84
|
+
class RTSPAudioSource
|
|
85
|
+
class FileAudioSource
|
|
86
|
+
|
|
87
|
+
AudioSourceInterface <|.. LiveAudioSource
|
|
88
|
+
LiveAudioSource <|-- RTSPAudioSource
|
|
89
|
+
LiveAudioSource <|-- FileAudioSource
|
|
90
|
+
|
|
91
|
+
PeerConnectionManager o-- PeerConnectionFactoryInterface : owns
|
|
92
|
+
PeerConnectionManager *-- PeerConnectionObserver : manages
|
|
93
|
+
PeerConnectionObserver o-- PeerConnectionInterface : observes
|
|
94
|
+
PeerConnectionManager ..> CapturerFactory : uses
|
|
95
|
+
|
|
96
|
+
CapturerFactory ..> TrackSource : creates
|
|
97
|
+
TrackSource *-- VideoSourceInterfaceFrame : owns source
|
|
98
|
+
CapturerFactory ..> VideoTrackSourceInterface : returns
|
|
99
|
+
CapturerFactory ..> AudioSourceInterface : returns
|
|
100
|
+
PeerConnectionManager ..> AudioSourceInterface : attaches stream
|
|
101
|
+
|
|
102
|
+
class VideoSourceInterfaceFrame["VideoSourceInterface<VideoFrame>"]
|
|
103
|
+
```
|
package/html/admin.html
CHANGED
|
@@ -35,6 +35,9 @@
|
|
|
35
35
|
{ headerName: "PeerId" , field: "peerid", cellClass: "cell", headerClass: "cell" },
|
|
36
36
|
{ headerName: "StreamId", field: "streamid", cellClass: "cell", headerClass: "cell" },
|
|
37
37
|
{ headerName: "Size", field: "size", cellClass: "cell", headerClass: "cell" },
|
|
38
|
+
{ headerName: "Duration (s)", field: "duration_ms", cellClass: "cell", headerClass: "cell", valueFormatter: (p) => p.value != null ? (p.value / 1000).toFixed(1) + " s" : "" },
|
|
39
|
+
{ headerName: "Bytes Sent", field: "bytes_sent", cellClass: "cell", headerClass: "cell", valueFormatter: (p) => p.value != null ? (p.value / 1024).toFixed(1) + " kB" : "" },
|
|
40
|
+
{ headerName: "BW Sent", field: "bandwidth_sent_bps", cellClass: "cell", headerClass: "cell", valueFormatter: (p) => p.value != null ? (p.value / 1000).toFixed(1) + " kbps" : "" },
|
|
38
41
|
{ headerName: "Ice State", field: "ice_state", cellClass: "cell", headerClass: "cell" },
|
|
39
42
|
{ headerName: "Nb Candidates", field: "nbCandidates", cellClass: "cell", headerClass: "cell" },
|
|
40
43
|
{ headerName: "PC State", field: "pc_state", cellClass: "cell", headerClass: "cell" },
|
|
@@ -89,7 +92,7 @@
|
|
|
89
92
|
});
|
|
90
93
|
}
|
|
91
94
|
|
|
92
|
-
rowData.push({peerid: Object.keys(item)[0] , streamid, size:frameHeight+"x"+frameWidth, action:"hangup", nbCandidates: Object.values(item)[0]
|
|
95
|
+
rowData.push({peerid: Object.keys(item)[0] , streamid, size:frameHeight+"x"+frameWidth, action:"hangup", nbCandidates: Object.values(item)[0]?.candidateList?.length, ... Object.values(item)[0] })
|
|
93
96
|
});
|
|
94
97
|
gridOptions.api.setRowData(rowData);
|
|
95
98
|
}
|