kevin29a / angular-janus

Angular components for using the videoroom plugin from Janus Media Server
12 stars 4 forks source link

Future plans question #4

Open alg opened 4 years ago

alg commented 4 years ago

Hi mate. Great project!

I've got a question re the future of the project. What is your vision of it? Are you going to further enhance it and in which direction? We are building a streaming / room section in our web app and considering building a similar library ourselves.

Cheers.

kevin29a commented 4 years ago

Hey, thanks for reaching out. We don't yet have a formal roadmap of future features we're going to implement. Without giving any timelines or guarantees, there are 2 main areas of development right now. First is better handling of connection errors, e.g., retry ice connection errors. Second is providing better customization of the look/feel of the videoroom. If you look through the code, you can see 3 main visual components: default-video-room, self-video, and video-box. We're working to allow the user of the library to implement their own version of those and pass them into the top level janus-videoroom component. This would give users the ability to make very customized videorooms while still abstracting away most aspects of webrtc signalling.

Philosophically, the goal is to keep this library focused on webrtc signalling. We'll never put things like database access, user auth, etc. in the library. The library shouldn't need to know anything like that. While it is tightly coupled to janus and angular, we don't want it tightly coupled with any kind of backend stack. Most people you'll see in the janus community are interested in the low level details of webrtc, and that's great. However, my goal is to support people that don't want to build/maintain all of the signalling code, but still want a high performance videoroom in their application.

I'm curious to know what direction you would like to see the project move. It's obviously a new project, and the future isn't set in stone besides the philosophical vision.

alg commented 4 years ago

Thanks for getting back. We are building a pretty complex streaming web app with the rooms where instructor is having a mentoring session, private or public. We need to composite multiple video streams (invited instructor video / audio feed, second camera, shared screen, external video / audio feed from OBS and alike) using a set of predefined layouts. Our students initially won't share their feeds and will be in read-only mode so to speak, but over time, we'll "give them voice".

Now to the library. Our front-end developer works with Angular and she was very impressed and surprised to see such a timely submission. When we first reviewed what's there for Janus in Angular space two or three weeks ago, there was nothing. A week later she decides to look again and comes over this project that was initially committed just 5 days ago. Luck? I don't think so. :)

We now see that your course is pretty much what we had in mind, but the feature set is a tad different. Our current plan is to be compositing everything to a canvas and sending it over to the room from the publisher side (just like in the official Janus Canvas Capture demo). We have quality concerns and if it won't be enough considering shifting compositing to the Janus plugin. So it'll be given several streams and instructions on how to merge them.

kevin29a commented 4 years ago

I see. That's a slightly different use case. In the guts of janus-angular we draw the video onto the canvas and then transmit the canvas stream. This makes it easier to handle different camera dimensions as we do the complex stuff on capture and then all transmitted video feeds are the same aspect ratio. It also has the side effect of making the library a little closer to your use case than it might appear at first.

You could have a different janus-videoroom element for each of the different feeds on the instructor side. Then the instructor client would be publishing multiple different streams and the students would be receiving multiple streams. That would work right now, but might not be exactly what you're looking for.

Alternatively, we could add an option to our library to not draw on the canvas itself at all. In that case, you'd need to implement your own self-video component and draw on the canvas yourself. You're going to have to do canvas drawing anyways, and the adding that feature to the library would be a very small lift for us. The gotcha here is that we're still working on the ability to supply your own self-video component. Once that's done, I think you'd have a good path forward. This is why I see the ability to supply your own display components as a high priority for the project.

I'm not sure what your timing is. Realistically, we're probably looking at end of the year for these features to be developed internally. This isn't anybody's full time job, and there are a lot of internal pieces to document before I'd feel good releasing anything.

btw, so far as performance when composing several streams onto canvas, I think you'll be fine if you're on a laptop. An older mobile device could struggle.

alg commented 4 years ago

Great stuff. Thanks for all the insights. We'll keep following the project. In the mean time, our frontend developer took it for a ride in its present state and building a prototype on top of it. Itching to see what she comes up with!

kevin29a commented 3 years ago

Hey, quick update on where we're at. I just pushed a beta release that supports specifying a custom component for use rendering the videoroom. I think this will give you a tremendous amount of freedom to customize while still keeping the vast majority of WebRTC signalling abstracted away. Not ready for production yet, but certainly good enough to kick the tires.

Docs aren't completely where they need to be yet. You can look through the the sample app here: https://github.com/kevin29a/angular-janus-sample-app. The feature/custom-self-video branch has a page for demonstrating how to specify a custom videoroom component. I'll get some tutorials up on medium in the coming days and fill out more details in the docs.

Would love to hear your feedback. Still some time to tweak things before that becomes the main live branch.

alg commented 3 years ago

Hi @kevin29a! Thanks for the heads up. I'll pass it on to our frontend developer.

Qvatra commented 3 years ago

Hi @kevin29a ! thanks for the great lib. I wasnt able to find any mentioning in docs regarding video recording.

Is there a plan to add it? or this falls under Create/edit/delete operations on janus rooms are not supported?

kevin29a commented 3 years ago

To me video recording is a backend issue that imo is out of scope for this library. You could use this library as is with a janus videoroom that is configured to record.

Qvatra commented 3 years ago

@kevin29a that is definetly the case that video saving is happening on server but I was thinking that angular component can have dynamic property that will initiate recording of a room. The following props exist in Janus VideoRoom plugin room config:

        record = true|false (whether this room should be recorded, default=false)
        rec_dir = <folder where recordings should be stored, when enabled>

I'm just thinking if I use your components how I can initiate recording by changing room config? Is there any helpers in your lib that can help me with that? Just dont know where to start actually. Sorry that my knowledge about low level janus api is limited but thats the whole point of using abstractions I believe :)

kevin29a commented 3 years ago

I understand. I don't have plans to include that kind of functionality in the near future. I have some custom code in my own projects that create/destroy/modify existing videorooms. It's not super complicated to roll code following the docs here: https://janus.conf.meetecho.com/docs/videoroom.html

Alternatively, I haven't used this library myself but this package looks like it abstracts some of the functionality away to at least create a videoroom with the options you want, which could include recording: https://github.com/sipwise/janus-client