Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple video device support #51

Open
milmber opened this issue Mar 10, 2019 · 5 comments
Open

Multiple video device support #51

milmber opened this issue Mar 10, 2019 · 5 comments

Comments

@milmber
Copy link

milmber commented Mar 10, 2019

Support for multiple people to view streams using v4l2loopback

Iterate over multiple video devices if the first device is not available.

E.g. Try /dev/video1, if busy try /dev/video2, if busy try /dev/video3, etc.

This may be possible by adding the video device in use for streaming in the ongoingSessions array ?

this.ongoingSessions[sessionIdentifier] = ffmpeg

@moritzmhmk
Copy link
Owner

Great idea! Did you have any success so far?

@milmber
Copy link
Author

milmber commented Jun 26, 2019

Great idea! Did you have any success so far?

Struggling to find a way to detect if a video device is already in use. Any ideas?

@moritzmhmk
Copy link
Owner

as noted in #50 I do consider to aim for optimal Pi zero support from now on. The reason is that using h264_omx seems to be the better solution on newer Pis.

While with h264_omx one would redirect the raw stream to multiple video device endpoints we would need to redirect the h264 stream from the camera. This would require setting the resolution and for all clients to receive that same resolution (e.g. 720p).

Keeping track of the used video devices could be done with another array that just holds a boolean value and is set when stream starts/stops on a specific device. If you take a look at the develop branch on wich I did some refactoring you will see that there now is a separate StreamDelegate object which could be assigned a specific video device and make tracking them unnecessary.

@jankais3r
Copy link

This would require setting the resolution and for all clients to receive that same resolution (e.g. 720p).

What is prohibiting us running this multiplied stream through ffmpeg with corresponding parameters to resize the stream to match every device's requirements?

@moritzmhmk
Copy link
Owner

Check https://github.com/moritzmhmk/homebridge-camera-rpi/tree/feature-loopback for a possible solution.

Resizing each stream would cause a lot of cpu usage... might still work on a pi model 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants