steveseguin / vdo.ninja

VDO.Ninja is a powerful tool that lets you bring remote video feeds into OBS or other studio software via WebRTC.
https://vdo.ninja
Other
2.81k stars 798 forks source link

mp4+pcm & (room vs direct link) #881

Open jonnyfisher opened 3 years ago

jonnyfisher commented 3 years ago

1) Is it possible to record locally to MP4 + PCM (uncompressed PCM for post-processing). I mean directly - without convert.html? 2) If we don't connect through the room, the video and sound quality is fine and we can choose the bitrate
For example: https://vdo.ninja/?push=first&vb=2500&ab=320&aec=1&s&dn=0&ag=0&codec=vp8&q=0&fps=25&record&pcm&ptz&view=second,third https://vdo.ninja/?push=second&vb=2500&ab=320&aec=1&s&dn=0&ag=0&codec=vp8&q=0&fps=25&record&pcm&ptz&view=first,third https://vdo.ninja/?push=third&vb=2500&ab=320&aec=1&s&dn=0&ag=0&codec=vp8&q=0&fps=25&record&pcm&ptz&view=second,first

But when we connect through the room, the video quality is lower. How do I set up my room for optimal video and sound quality? Or does the room adaptively adjust to the overall bitrate? For example: https://vdo.ninja/?room=my&totalroombitrate=5000&ab=320&aec=1&s&dn=0&ag=0&codec=vp8&q=0&fps=25&record&pcm&ptz

steveseguin commented 3 years ago

background: Since vdo.ninja doesn't use central video servers to route video traffic, groups of users share video via a mesh-approach, which can use up a lot of CPU and bandwidth. Since the purpose of the service is for production, guests are assumed to be unimportant, and so their video allowances are very restricted by default. This frees up their CPU and bandwidth for the director, so they can capture the highest quality video possible, and still have the service be free to access.

&totalroombitrate can be used to increase the video quality of a room however. The default is 500kbps, which is the total allowed video bandwidth for that guest. If 5 remote videos are being viewed by a guest, then each would have 100-kbps of video bandwidth allowed each. This approach tries to ensure a constant load on a guest's computer, despite varying levels of other guests joining or leaving the room. &totalroombitrate can be set by either the director (via their URL), or added to each guest's link.

If you use direct links, and not the room, the rules imposed on the room are not enforced. I call these self-made rooms using direct links only 'faux rooms', and they do work fine if you limit the total guests to just a few people. They don't scale very well though.

Another option is to have , lets say , OBS output the virtual camera to the room using &broadcast mode. Since the guests will only be seeing one video, &trb won't be divided up and quality is more predictable. As well, a service like https://meshcast.io can then share the mixed video to the group at a higher bitrate; 2500 to 4000kbps lets say.

As for higher audio quality, you can explicitly control that I think via the URL, but &stereo=1 (instead of just &stereo) would also have the guest's send and receive high quality audio if available.

As for MP4 / PCM, at the moment the container that Chrome allows me to save media to is WebM, even though I can put H264 or PCM into it. It might be possible for me to add convert.html to the work flow automatically, to convert from webM to Mp4 while the file is being saved, but the added complexity of that wasn't worth the risk I thought. It's something I can explore, but there are existing issues that need to be resolved first. Convert.html uses FFmpeg.js, and it's a bit finicky and won't work on many private deployments, adding to the complexity of the issue.

I do think there is a solution, but convert.html is all I had time for so far.

I'll be on Discord if you are seeking support questions; I mainly use Github for issue tracking. discord.vdo.ninja

-steve