webrtc-streamer 0.8.20 → 0.8.21
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/README.md +8 -8
- package/h264.mkv +0 -0
- package/libv4l2cpp/README.md +2 -2
- package/libv4l2cpp/main.cpp +17 -5
- package/package.json +1 -1
- /package/libv4l2cpp/{LICENSE → UNLICENSE} +0 -0
package/README.md
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
# WebRTC-Streamer
|
|
3
3
|
<a href="https://wiki.friendlyelec.com/wiki/index.php/NanoPi_NEO_Air"><img alt="A picture of a Nano PI NEO Air" src="images/nanopi.jpg" width="500"></a>
|
|
4
4
|
|
|
5
|
-
[](https://circleci.com/gh/mpromonet/webrtc-streamer)
|
|
6
5
|
[](https://snapcraft.io/webrtc-streamer)
|
|
7
|
-
|
|
8
6
|
[](https://github.com/mpromonet/webrtc-streamer/actions/workflows/cpp-linux.yml)
|
|
9
7
|
[](https://github.com/mpromonet/webrtc-streamer/actions/workflows/cpp-windows.yml)
|
|
10
8
|
[](https://github.com/mpromonet/webrtc-streamer/actions/workflows/cpp-macos.yml)
|
|
@@ -21,10 +19,14 @@ Experimentation to stream WebRTC media sources like capture devices, screen capt
|
|
|
21
19
|
|
|
22
20
|
*** Notice *** Live demo are stopped till I migrate to a european web hosting.
|
|
23
21
|
|
|
22
|
+
## Mirrors:
|
|
23
|
+
* https://codeberg.org/mpromonet/webrtc-streamer.git
|
|
24
|
+
* https://gitlab.com/mpromonet/webrtc-streamer.git
|
|
25
|
+
|
|
24
26
|
## Artefacts
|
|
25
27
|
|
|
26
28
|
* packages are available from https://github.com/mpromonet/webrtc-streamer/releases/latest
|
|
27
|
-
* container image are available from https://hub.docker.com/r/mpromonet/webrtc-streamer
|
|
29
|
+
* container image are available from https://hub.docker.com/r/mpromonet/webrtc-streamer and https://github.com/mpromonet/webrtc-streamer/pkgs/container/webrtc-streamer
|
|
28
30
|
|
|
29
31
|
|
|
30
32
|
## Usage
|
|
@@ -82,7 +84,7 @@ of civetweb, allowing use of the civetweb syntax like `-H8000,9000` or
|
|
|
82
84
|
Using `-o` allows storing compressed frame data from the backend stream using
|
|
83
85
|
`webrtc::VideoFrameBuffer::Type::kNative`. This hacks the stucture
|
|
84
86
|
`webrtc::VideoFrameBuffer` storing data in a override of the i420 buffer. This
|
|
85
|
-
allows forwarding H264 frames from V4L2 device or RTSP stream to WebRTC stream.
|
|
87
|
+
allows forwarding H264/H265 frames from V4L2 device or RTSP stream to WebRTC stream.
|
|
86
88
|
It uses less CPU, but has less features (resize, codec, and bandwidth are
|
|
87
89
|
disabled).
|
|
88
90
|
|
|
@@ -400,7 +402,7 @@ dependencies above:
|
|
|
400
402
|
3. Build WebRTC Streamer
|
|
401
403
|
|
|
402
404
|
```sh
|
|
403
|
-
export PATH
|
|
405
|
+
export PATH=`realpath ../webrtc/src/third_party/llvm-build/Release+Asserts/bin`:$PATH
|
|
404
406
|
cmake -DCMAKE_C_COMPILER=clang .
|
|
405
407
|
make
|
|
406
408
|
```
|
|
@@ -420,9 +422,7 @@ following architectures:
|
|
|
420
422
|
|
|
421
423
|
- x86_64 on Ubuntu
|
|
422
424
|
- armv7 crosscompiled (this build is running on Raspberry Pi2 and NanoPi NEO)
|
|
423
|
-
- armv6+vfp crosscompiled (this build is running on Raspberry PiB and should run
|
|
424
|
-
on a Raspberry Zero)
|
|
425
425
|
- arm64 crosscompiled
|
|
426
|
-
- Windows x64
|
|
426
|
+
- Windows x64
|
|
427
427
|
- MacOS
|
|
428
428
|
|
package/h264.mkv
ADDED
|
Binary file
|
package/libv4l2cpp/README.md
CHANGED
|
@@ -12,7 +12,7 @@ V4L2 Capture
|
|
|
12
12
|
-------------
|
|
13
13
|
- create a V4L2 Capture interface using MMAP interface:
|
|
14
14
|
|
|
15
|
-
V4L2DeviceParameters param("/dev/video0", V4L2_PIX_FMT_*, width, height, fps, IOTYPE_MMAP
|
|
15
|
+
V4L2DeviceParameters param("/dev/video0", V4L2_PIX_FMT_*, width, height, fps, IOTYPE_MMAP);
|
|
16
16
|
V4l2Capture* videoCapture = V4l2Capture::create(param);
|
|
17
17
|
|
|
18
18
|
- data are available :
|
|
@@ -30,7 +30,7 @@ V4L2 Output
|
|
|
30
30
|
|
|
31
31
|
- To create a V4L2 Output interface using MMAP interface:
|
|
32
32
|
|
|
33
|
-
V4L2DeviceParameters param("/dev/video0", V4L2_PIX_FMT_*, width, height, fps, IOTYPE_MMAP
|
|
33
|
+
V4L2DeviceParameters param("/dev/video0", V4L2_PIX_FMT_*, width, height, fps, IOTYPE_MMAP);
|
|
34
34
|
V4l2Output* videoOutput = V4l2Output::create(param);
|
|
35
35
|
|
|
36
36
|
- data could be written :
|
package/libv4l2cpp/main.cpp
CHANGED
|
@@ -40,9 +40,9 @@ int main(int argc, char* argv[])
|
|
|
40
40
|
int width = 0;
|
|
41
41
|
int height = 0;
|
|
42
42
|
int fps = 0;
|
|
43
|
-
|
|
43
|
+
int framecount = 0;
|
|
44
44
|
int c = 0;
|
|
45
|
-
while ((c = getopt (argc, argv, "hv:" "G:f:r")) != -1)
|
|
45
|
+
while ((c = getopt (argc, argv, "x:hv:" "G:f:r")) != -1)
|
|
46
46
|
{
|
|
47
47
|
switch (c)
|
|
48
48
|
{
|
|
@@ -50,12 +50,15 @@ int main(int argc, char* argv[])
|
|
|
50
50
|
case 'r': ioTypeIn = IOTYPE_READWRITE ; break;
|
|
51
51
|
case 'G': sscanf(optarg,"%dx%dx%d", &width, &height, &fps) ; break;
|
|
52
52
|
case 'f': format = V4l2Device::fourcc(optarg) ; break;
|
|
53
|
+
case 'x': sscanf(optarg,"%d", &framecount) ; break;
|
|
53
54
|
case 'h':
|
|
54
55
|
{
|
|
55
56
|
std::cout << argv[0] << " [-v[v]] [-G <width>x<height>x<fps>] [-f format] [device] [-r]" << std::endl;
|
|
57
|
+
std::cout << "\t -G <width>x<height>x<fps> : set capture resolution" << std::endl;
|
|
56
58
|
std::cout << "\t -v : verbose " << std::endl;
|
|
57
59
|
std::cout << "\t -vv : very verbose " << std::endl;
|
|
58
60
|
std::cout << "\t -r : V4L2 capture using read interface (default use memory mapped buffers)" << std::endl;
|
|
61
|
+
std::cout << "\t -x <count> : read <count> frames and save them in current dir." << std::endl;
|
|
59
62
|
std::cout << "\t device : V4L2 capture device (default "<< in_devname << ")" << std::endl;
|
|
60
63
|
exit(0);
|
|
61
64
|
}
|
|
@@ -71,7 +74,7 @@ int main(int argc, char* argv[])
|
|
|
71
74
|
initLogger(verbose);
|
|
72
75
|
|
|
73
76
|
// init V4L2 capture interface
|
|
74
|
-
V4L2DeviceParameters param(in_devname, format, width, height, fps, ioTypeIn
|
|
77
|
+
V4L2DeviceParameters param(in_devname, format, width, height, fps, ioTypeIn);
|
|
75
78
|
V4l2Capture* videoCapture = V4l2Capture::create(param);
|
|
76
79
|
|
|
77
80
|
if (videoCapture == NULL)
|
|
@@ -81,7 +84,7 @@ int main(int argc, char* argv[])
|
|
|
81
84
|
else
|
|
82
85
|
{
|
|
83
86
|
timeval tv;
|
|
84
|
-
|
|
87
|
+
|
|
85
88
|
LOG(NOTICE) << "Start reading from " << in_devname;
|
|
86
89
|
signal(SIGINT,sighandler);
|
|
87
90
|
while (!stop)
|
|
@@ -100,7 +103,16 @@ int main(int argc, char* argv[])
|
|
|
100
103
|
}
|
|
101
104
|
else
|
|
102
105
|
{
|
|
103
|
-
LOG(NOTICE) << "size:" << rsize;
|
|
106
|
+
LOG(NOTICE) << "size:" << rsize << " buffersize:" << videoCapture->getBufferSize();
|
|
107
|
+
static int stop_count = 0;
|
|
108
|
+
if(framecount and stop_count < framecount){
|
|
109
|
+
std::string filename = "Frame" + std::to_string(stop_count) + '.' + V4l2Device::fourcc(videoCapture->getFormat());
|
|
110
|
+
stop_count++;
|
|
111
|
+
FILE *fp = fopen(filename.c_str(), "wb");
|
|
112
|
+
fwrite(buffer, 1, rsize, fp);
|
|
113
|
+
fclose(fp);
|
|
114
|
+
LOG(NOTICE) << "saved:\t" << filename;
|
|
115
|
+
}
|
|
104
116
|
}
|
|
105
117
|
}
|
|
106
118
|
else if (ret == -1)
|
package/package.json
CHANGED
|
File without changes
|