Closed neilyoung closed 4 years ago
It's missing CxxPtr submodule.
Use git submodule update --init --recursive
to fix.
But you don't need build it yourself. You can use https://snapcraft.io/janus-plus-gstreamer-plugin
You will need sudo snap install janus-plus-gstreamer-plugin --edge
. Config files will be available at /var/snap/janus-plus-gstreamer-plugin/common/etc
Thanks. I would like to be able to build from scratch.
Your hint fixed the problem. Maybe it should also be documented so.
But I ran into the next:
pi@janus:~/janus-gstreamer-plugin $ make
Making all in plugins/gstreamer
make[1]: Entering directory '/home/pi/janus-gstreamer-plugin/plugins/gstreamer'
CXX libjanus_gstreamer_la-Session.lo
In file included from Session.h:5,
from Session.cpp:1:
MountPoint.h:7:10: fatal error: janus/plugins/plugin.h: No such file or directory
#include "janus/plugins/plugin.h"
^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:512: libjanus_gstreamer_la-Session.lo] Error 1
Even though my configuration looks so
./configure --prefix=/home/pi/janus-gateway/
it seems, the wrong path is included (?)
Do you have Janus built and installed to /home/pi/janus-gateway/
?
Yepp... BTW: It should also be ./autgen.sh instead of just autogen.sh. Just a minor thing.
Yes. I compiled Janus from scratch and it is up and running in ~/janus-gateway.
Hm... let me check...
Can you please check, if you have /home/pi/janus-gateway/include/janus/plugins/plugin.h
file
No, that does not exist
Then I'm afraid your Janus was not properly installed. But it doesn't matter. It looks like plugin build is anyway broken since Janus API was changed. Investigating.
I cannot find this directory in the janus-gateway repo either.
The repo was cloned as they describe it:
git clone https://github.com/meetecho/janus-gateway.git cd janus-gateway
prefix
should point to directory where Janus was installed, not sources directory.
Ah, sorry, my bad. You documented it like so.
Yes there is such a file in /opt/janus/ and it compiles for a while, but then I guess the changed API you mentioned kicked in:
pi@janus:~/janus-gstreamer-plugin $ make
Making all in plugins/gstreamer
make[1]: Entering directory '/home/pi/janus-gstreamer-plugin/plugins/gstreamer'
CXX libjanus_gstreamer_la-Session.lo
CXX libjanus_gstreamer_la-Media.lo
CXX libjanus_gstreamer_la-RtspMedia.lo
CXX libjanus_gstreamer_la-LaunchMedia.lo
CXX libjanus_gstreamer_la-MountPoint.lo
MountPoint.cpp: In member function ‘void MountPoint::onBuffer(int, const void*, gsize)’:
MountPoint.cpp:259:67: error: invalid conversion from ‘int’ to ‘janus_plugin_rtp*’ [-fpermissive]
janusSession.get(), RestreamAs::Video == s.restreamAs ? TRUE : FALSE,
MountPoint.cpp:260:30: error: too many arguments to function
(char*)data, size);
^
make[1]: *** [Makefile:540: libjanus_gstreamer_la-MountPoint.lo] Error 1
make[1]: Leaving directory '/home/pi/janus-gstreamer-plugin/plugins/gstreamer'
make: *** [Makefile:390: all-recursive] Error 1
please pull latest version. I've fixed build, but don't sure if it works yet.
Great. Pulled, made and installed. Let's see how far I come. Thanks for your quick help on a Sunday :)
FYI, you should use https://github.com/RSATom/janus-gstreamer-plugin/tree/master/html/demo with something like python -m SimpleHTTPServer 8000
to test it.
Yepp. Having seen this already. Thanks anyway.
Even though a bit off topic now, but Janus refuses to load. Shall I open a new issue?
[Sun Aug 30 11:47:02 2020] [janus_gstreamer.cpp:create:66] >>>> Gstreamer plugin: create
[Sun Aug 30 11:47:02 2020] [janus_gstreamer.cpp:Init:136] >>>> Gstreamer plugin: Init
[Sun Aug 30 11:47:02 2020] Version: 1 (0.0.1)
[Sun Aug 30 11:47:02 2020] [janus.plugin.gstreamer] Gstreamer plugin
[Sun Aug 30 11:47:02 2020] Gstreamer plugin
[Sun Aug 30 11:47:02 2020] Plugin API version: 15
[Sun Aug 30 11:47:02 2020] [WARN] The 'janus.plugin.gstreamer' plugin doesn't implement any callback for RTP/RTCP/data... is this on purpose?
I think you need copy https://github.com/RSATom/janus-gstreamer-plugin/blob/master/conf/janus.plugin.gstreamer.jcfg to janus configs folder
It is there
pi@janus:~/janus-gateway $ ls /opt/janus/etc/janus/janus.plugin.gstreamer.jcfg /opt/janus/etc/janus/janus.plugin.gstreamer.jcfg
Then it should load. Did you try html demo?
No not yet. I was just observing the janus log. There is no hint that it has been loaded except this error message. Will try the demo now
OK, despite the error message the plugin is loaded. I could not reach the big buck bunny link, so I replaced it with one which worked for me:
rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov
I changed to WebSockets, somehow HTTP REST did not work for me (maybe I have disabled it, don't remember).
However, just a spinning wheel in the "stream" window and a crash of janus after a while.
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] WebSocket connection opened from 192.168.188.24
[Sun Aug 30 12:26:39 2020] Checking if 192.168.188.24 is allowed to contact janus interface
[Sun Aug 30 12:26:39 2020] Yep
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] WebSocket connection accepted
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] -- Ready to be used!
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] Got 47 bytes:
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] First fragment: 47 bytes, 0 remaining
[Sun Aug 30 12:26:39 2020] {"janus":"create","transaction":"TjCgo7L92oTs"}
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] Done, parsing message: 47 bytes
[Sun Aug 30 12:26:39 2020] Got a Janus API request from janus.transport.websockets (0x72c4c318)
[Sun Aug 30 12:26:39 2020] Creating new session: 5865244931402929; 0x718021d0
[Sun Aug 30 12:26:39 2020] Sending Janus API response to janus.transport.websockets (0x72c4c318)
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] Re-allocating to 123 bytes (was 0, response is 107 bytes)
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] Sending WebSocket message (107 bytes)...
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] -- Sent 107/107 bytes
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] Got 152 bytes:
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] First fragment: 152 bytes, 0 remaining
[Sun Aug 30 12:26:39 2020] {"janus":"attach","plugin":"janus.plugin.gstreamer","opaque_id":"streamingtest-X64EZjtkxqZq","transaction":"iLw8LmLys2ar","session_id":5865244931402929}
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] Done, parsing message: 152 bytes
[Sun Aug 30 12:26:39 2020] Got a Janus API request from janus.transport.websockets (0x72c4c318)
[Sun Aug 30 12:26:39 2020] Creating new handle in session 5865244931402929: 3182593777311106; 0x718021d0 0x71802630
[Sun Aug 30 12:26:39 2020] [janus_gstreamer.cpp:CreateSession:164] >>>> Gstreamer plugin: CreateSession
[Sun Aug 30 12:26:39 2020] Sending Janus API response to janus.transport.websockets (0x72c4c318)
[Sun Aug 30 12:26:39 2020] [3182593777311106] Handle thread started; 0x71802630
[Sun Aug 30 12:26:39 2020] [ice.c:janus_ice_handle_thread:1164] [3182593777311106] Looping...
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] Re-allocating to 158 bytes (was 123, response is 142 bytes)
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] Sending WebSocket message (142 bytes)...
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] -- Sent 142/142 bytes
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] Got 133 bytes:
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] First fragment: 133 bytes, 0 remaining
[Sun Aug 30 12:26:39 2020] {"janus":"message","body":{"request":"list"},"transaction":"t77xHok3GtTW","session_id":5865244931402929,"handle_id":3182593777311106}
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] Done, parsing message: 133 bytes
[Sun Aug 30 12:26:39 2020] Got a Janus API request from janus.transport.websockets (0x72c4c318)
[Sun Aug 30 12:26:39 2020] Transport task pool, serving request
[Sun Aug 30 12:26:39 2020] [3182593777311106] There's a message for Gstreamer plugin
[Sun Aug 30 12:26:39 2020] [janus_gstreamer.cpp:HandleMessage:228] >>>> Gstreamer plugin: HandleMessage
[Sun Aug 30 12:26:39 2020] [janus_gstreamer.cpp:HandleMessage:232] message:
{
"request": "list"
}
[Sun Aug 30 12:26:39 2020] [janus_gstreamer.cpp:HandleMessage:251] Gstreamer plugin: Request::List
[Sun Aug 30 12:26:39 2020] Creating plugin result...
[Sun Aug 30 12:26:39 2020] Sending Janus API response to janus.transport.websockets (0x72c4c318)
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] Re-allocating to 594 bytes (was 158, response is 578 bytes)
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] Sending WebSocket message (578 bytes)...
[Sun Aug 30 12:26:39 2020] [WSS-0x72c49c58] -- Sent 578/578 bytes
[Sun Aug 30 12:26:39 2020] Destroying plugin result...
[Sun Aug 30 12:26:50 2020] [WSS-0x72c49c58] Got 141 bytes:
[Sun Aug 30 12:26:50 2020] [WSS-0x72c49c58] First fragment: 141 bytes, 0 remaining
[Sun Aug 30 12:26:50 2020] {"janus":"message","body":{"request":"watch","id":1},"transaction":"nL5s3S4qBzst","session_id":5865244931402929,"handle_id":3182593777311106}
[Sun Aug 30 12:26:50 2020] [WSS-0x72c49c58] Done, parsing message: 141 bytes
[Sun Aug 30 12:26:50 2020] Got a Janus API request from janus.transport.websockets (0x72c4c318)
[Sun Aug 30 12:26:50 2020] Transport task pool, serving request
[Sun Aug 30 12:26:50 2020] [3182593777311106] There's a message for Gstreamer plugin
[Sun Aug 30 12:26:50 2020] [janus_gstreamer.cpp:HandleMessage:228] >>>> Gstreamer plugin: HandleMessage
[Sun Aug 30 12:26:50 2020] [janus_gstreamer.cpp:HandleMessage:232] message:
{
"request": "watch",
"id": 1
}
[Sun Aug 30 12:26:50 2020] [janus_gstreamer.cpp:HandleMessage:254] Gstreamer plugin: Request::Watch
[Sun Aug 30 12:26:50 2020] Creating plugin result...
[Sun Aug 30 12:26:50 2020] [PluginMain.cpp:HandleClientMessage:247] Gstreamer plugin: HandlePluginMessage. Request::Watch
[Sun Aug 30 12:26:50 2020] Sending Janus API response to janus.transport.websockets (0x72c4c318)
[Sun Aug 30 12:26:50 2020] Destroying plugin result...
[Sun Aug 30 12:26:50 2020] [WSS-0x72c49c58] Sending WebSocket message (90 bytes)...
[Sun Aug 30 12:26:50 2020] [WSS-0x72c49c58] -- Sent 90/90 bytes
[Sun Aug 30 12:26:50 2020] RtspMedia::Private::OnSdp.
v=0
o=- 1849947133 1849947133 IN IP4 3.84.6.190
s=BigBuckBunny_115k.mov
c=IN IP4 3.84.6.190
t=0 0
a=sdplang:en
a=range:npt=0- 596.48
a=control:*
m=audio 0 RTP/AVP 96
a=rtpmap:96 mpeg4-generic/12000/2
a=fmtp:96 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1490
a=control:trackID=1
m=video 0 RTP/AVP 97
a=rtpmap:97 H264/90000
a=fmtp:97 packetization-mode=1;profile-level-id=42C01E;sprop-parameter-sets=Z0LAHtkDxWhAAAADAEAAAAwDxYuS,aMuMsg==
a=cliprect:0,0,160,240
a=framesize:97 240-160
a=framerate:24.0
a=control:trackID=2
[Sun Aug 30 12:27:04 2020] [WSS-0x72c49c58] Got 80 bytes:
[Sun Aug 30 12:27:04 2020] [WSS-0x72c49c58] First fragment: 80 bytes, 0 remaining
[Sun Aug 30 12:27:04 2020] {"janus":"keepalive","session_id":5865244931402929,"transaction":"EEKMQn6jSn1C"}
[Sun Aug 30 12:27:04 2020] [WSS-0x72c49c58] Done, parsing message: 80 bytes
[Sun Aug 30 12:27:04 2020] Got a Janus API request from janus.transport.websockets (0x72c4c318)
[Sun Aug 30 12:27:04 2020] Got a keep-alive on session 5865244931402929
[Sun Aug 30 12:27:04 2020] Sending Janus API response to janus.transport.websockets (0x72c4c318)
[Sun Aug 30 12:27:04 2020] [WSS-0x72c49c58] Sending WebSocket message (90 bytes)...
[Sun Aug 30 12:27:04 2020] [WSS-0x72c49c58] -- Sent 90/90 bytes
(janus:1019): GLib-ERROR **: 12:27:23.490: Creating pipes for GWakeup: Too many open files
Trace/breakpoint trap (core dumped)
pi@janus:~/janus-gateway $
Also, the clock pipeline did not work for me, that might be due to a missing GST plugin on my side.
pi@janus:~/janus-gateway $ gst-launch-1.0 -v videotestsrc pattern=blue ! clockoverlay halignment=center valignment=center shaded-background=true font-desc=\"Sans, 36\" ! x264enc ! video/x-h264, profile=baseline ! rtph264pay pt=99 config-interval=1 name=videopay
WARNING: erroneous pipeline: no element "clockoverlay"
I could make it run with this pipeline, but it takes > 30 secs before something happens in the output window and the bandwidth is somehow reduced to 25 kBit/s, so the ball is moving in slomo.
Edit: Here the pipeline
"videotestsrc pattern=ball ! video/x-raw,width=1280,height=720 ! x264enc ! video/x-h264, profile=baseline ! rtph264pay pt=99 config-interval=1 name=videopay"
Can you confirm, that the stream setup takes that long? If so, I can stop here. This contradicts all my KMS experiences and would render this solution obsolete.
No, it should work faster (at least it was working faster). It's possible there are some compatibility issue with latest Janus versions.
I didn't touch this plugin long time since there are no interest to it, and I don't use it myself anymore.
I fully understand. Thanks so far.
Greetings
I'll try to investigate it anyway...
This is a pipeline which does it pretty perfectly. Usual connection setup time, normal bandwidth and movement of the ball
"videotestsrc is-live=true pattern=ball ! video/x-raw,width=1280,height=720 ! videoconvert ! queue ! vp8enc deadline=1 ! queue ! rtpvp8pay ! queue ! capsfilter caps=application/x-rtp,media=video,encoding-name=VP8,payload=97 name=videopay"
Is there some README about what this plugin does? I see that you seemingly have copied parts of the streaming plugin and re-used it, but I'm not quite sure, what it does.
What I would need is a plugin, which makes raw frames from RTP input, analyzes and annotates it and just reflects it to the sender. Kind of higher media reflector. This is not currently, what the plugin, does, right?
...and also this one:
"videotestsrc is-live=true pattern=smpte ! video/x-raw,width=1280,height=720 ! videoconvert ! queue ! x264enc ! rtph264pay ! capsfilter caps=application/x-rtp,media=video,encoding-name=H264,payload=96 name=videopay"
I think a potential boost could be brought by the use of the unconventional "candidates complete" message. I'm using trickle ICE and it seems, that the ICE negotiation is running unnecessarily long.
I've created this plugin to extend supported input formats. Janus Streaming plugin is limited in supported input sources. So I've decided use GStreamer just to add flexibility.
OK, thanks. Let me try to understand: The browser is establishing a connection with the plugin, which then chooses to either feed the browser from big buck bunny RTSP or from a GStreamer pipe, right?
So this is what I'm doing basically, but on client side. I'm having a python script, which utilizes GStreamer's webrtcbin plugin. The raw input for this plugin is either the RPI CSI camera or a test stream, like the bouncing balls. Then I'm using a browser solution, which subscribes to the feed sent by the python script. Both meet in a video room. More subscribers can join.
I would need a way to convert the RTSP stream (in a plugin) to YUV or RGB frames in order to be able to analyze and alter these frames and re-convert it to RTSP. So basically a filter on the way from the client to the room.
I was thinking your plugin would help me, but it turns out, it does not. Unfortunately...
This plugin is just convertor from formats supported by GStreamer to WebRTC. Nothing more. You can add some frames processing if you will create some new GStreamer element with desired behavior and use it inside pipeline attached to plugin. Also there are some GStreamer plugins intended to interact with OpenCV. I think you can use it too, but I've never used it myself.
btw, if you already know how to work with webrtcbin - you can do all you need with GStreamer and use webrtcbin to stream result to Janus videoroom. Don't think you need RTSP there.
No. Thanks. I need fully server side processing.
Sergey Radionov notifications@github.com schrieb am So. 30. Aug. 2020 um 16:29:
btw, if you already know how to work with webrtcbin - you can do all you need with GStreamer and use webrtcbin to stream result to Janus videoroom. Don't think you need RTSP there.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/RSATom/janus-gstreamer-plugin/issues/2#issuecomment-683427377, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFSPDHLXOWZXI7CZVNTXETSDJO23ANCNFSM4QPRHJ3A .
-- Sent from my iPhone
Then I don't sure understand what exactly you want to achieve...
I want to port a solution I‘m already having (Kurento based) to Janus. Turns out it is not that simple.
Sergey Radionov notifications@github.com schrieb am So. 30. Aug. 2020 um 16:31:
Then I don't sure understand what exactly you want to achieve...
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/RSATom/janus-gstreamer-plugin/issues/2#issuecomment-683427677, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFSPDBHS7F2LEUWILW43QLSDJPFFANCNFSM4QPRHJ3A .
-- Sent from my iPhone
Just curious, why do you want switch from Kurento?
But to give you an idea: We have a Visual SLAM engine running in the cloud. External cams and monitors are connected via WebRTC. The server terminates the cam connections and does the SLAM in a customized Kurento OpenCV filter. Runs like a charm. I just wanted to see, if something like this could be pictured with Janus. For that a kind of an Echo plugin would be required with means to intercept and alter the incoming video. And send it back of course.
I think this should be the way to investigate for me: See how echo works and go into the RTP callbacks, convert, process and re-encode the video.
Neil Young foreverneilyoung@googlemail.com schrieb am So. 30. Aug. 2020 um 16:33:
I want to port a solution I‘m already having (Kurento based) to Janus. Turns out it is not that simple.
Sergey Radionov notifications@github.com schrieb am So. 30. Aug. 2020 um 16:31:
Then I don't sure understand what exactly you want to achieve...
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/RSATom/janus-gstreamer-plugin/issues/2#issuecomment-683427677, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFSPDBHS7F2LEUWILW43QLSDJPFFANCNFSM4QPRHJ3A .
-- Sent from my iPhone
-- Sent from my iPhone
I think I would not leave Kurento. It works great. I was simply just curious how Janus performs. It is pretty lightweight and easy to install on smaller platforms. There’s really no need to leave Kurento for this particular use case.
Sergey Radionov notifications@github.com schrieb am So. 30. Aug. 2020 um 16:38:
Just curious, why do you want switch from Kurento?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/RSATom/janus-gstreamer-plugin/issues/2#issuecomment-683428413, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFSPDDZ5JZJU3RS6AUXFALSDJP6RANCNFSM4QPRHJ3A .
-- Sent from my iPhone
Yes, don't think Janus is the right choice for your use case. At least without some hacking involved...
Do you have an idea, what's missing here? Is it the missing m4?