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

Adds RedisMpegVideoClass for a redis camera video-streamer #1100

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

HilbertCorsair
Copy link
Contributor

Adds a new class - RedisMpegVideo which acts as a HardwareObject that starts the vodeostreamer for a redis camera connectrd to a redis pub/sub channel.

@HilbertCorsair HilbertCorsair marked this pull request as draft January 13, 2025 09:56
@HilbertCorsair HilbertCorsair marked this pull request as ready for review January 13, 2025 09:56
@HilbertCorsair HilbertCorsair marked this pull request as draft January 13, 2025 09:57
@HilbertCorsair HilbertCorsair marked this pull request as ready for review January 13, 2025 09:59
Copy link
Contributor

@walesch-yan walesch-yan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general it looks good:).
However, I was wondering, since the code is very similar to the one for the TangoLimaMPEGVideoClass, if we could merge the two classes and just difference between them by a set flag? That way, we could prevent confusion that might come with multiple different camera classes. What do you think about the feasibility of this?

Comment on lines +129 to +131
"-irc",
"mxcubeweb",
# "-d",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the redis-channel should not be hardcoded but be configurable through the xml files, as it depends on the actual channel name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point ! I missed that one.

<username>Camera redis</username>
<host>localhost</host>
<uri>redis://localhost:6379</uri>
<cam_type>redis</cam_type>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is no cam_type parameter in the class, hence we might not need to add it to an example

Comment on lines +150 to +151
_s = size

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this can be removed as you are setting it below

from mxcubecore.BaseHardwareObjects import HardwareObject


class RedisMpegVideo(HardwareObject):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A solution that would result in less duplication and easier maintenance would be to merge this code with TangoLimaMpegVideo so that both functionalities can be achieved via configuration. It looks like the principal difference is the use of "-irc", "mxcubeweb" which could be added via configuration.

The resulting class could arguably be renamed, perhaps to MpegVideo , what do you think @walesch-yan

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing the comment above it looks like we had the same thought :), sorry for the repetition

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem at all:)
After some more investigation, one other important difference is that this class would directly inherit from hardwareobjects, where TangoLimaMPEGVideo inherits from TangoLimaVideo, which seems to contain some more properties, similar to the ones in the RedisMPEGVideoClass, but also some code for directly pulling images from a camera, instead of using the video-streamer, so we might have to check if this is still used

Copy link
Member

@marcus-oscarsson marcus-oscarsson Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure that the inheritance from TangoLimaVideo can be removed now, there might be some methods that needs to be moved but I think TangoLimaVideo can be retired soon. ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the inputs. I like the idea of merging the two classes into one MpegVideo class. I am looking into it.

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

Successfully merging this pull request may close these issues.

3 participants