mxcube / mxcubeweb

MXCuBE-Web
http://mxcube.github.io/mxcubeweb/
GNU Lesser General Public License v3.0
25 stars 39 forks source link

Sample View image not displayed for mockup config #1495

Open laispc opened 1 week ago

laispc commented 1 week ago

Hi,

Probably a simple issue/doubt: when running the mockup config (mxcubeweb/demo), the example video image mxcube_sample_snapshot.jpeg set in md_camera.xml is never displayed on the UI (the sample view widget is always black).

On the core side (MDCameraMockup.py), the image path is found and the image is emitted (with the imageReceived signal), but it's not handled by sampleview.py on the Web side (e.g., method_new_frame_received()` is never called apparently). No error message appears in the log regarding this.

Is this the expected behavior? Does tha camera have to be enabled manually? Would be nice to have the image showing, so we can have a base for new camera implementations (which is what I am trying to do :grin: ). Thanks!

walesch-yan commented 1 week ago

It could be that ffmpeg is not correctly installed, if I remember correctly it is not a direct dependency of mxcubeweb, however the video-streamer. Could you try installing ffmpeg, re-run the mockup-server and see if that resolves the issue?

laispc commented 1 week ago

Version used: mxcubeweb v4.231.0 + core v1.188.0 (forgot to include in the description).

laispc commented 1 week ago

Great, @walesch-yan , thanks a lot! I installed ffmpeg with pip and apt (in Ubuntu) and now I have an image on the UI. :fireworks:

The funny thing for me is that the image I get is the fakeimg.jpg and not the mxcube_sample_snapshot.jpeg. I am trying to understand why. :laughing:

walesch-yan commented 1 week ago

You're welcome!:) That is actually the way it is intended, the mockup version uses the 'TestCamera' from video-streamer, which will always only use the fakeimg.jpg. The mxcube_sample_snapshot.jpg is used for the snapshot routinein the mockup, i.e. if you press the Take Snapshot button on the mockup UI, your browser will download that image (overlayed with the shapes you drew on the SampleView)

walesch-yan commented 1 week ago

If you want to change the image that is displayed on the mockup you would have to clone the mxube/video-streamer repository change the picture in here and from the root of the repository use pip install -e .

axelboc commented 5 days ago

It could be that ffmpeg is not correctly installed, if I remember correctly it is not a direct dependency of mxcubeweb, however the video-streamer. Could you try installing ffmpeg, re-run the mockup-server and see if that resolves the issue?

I suggest we document this, and the part about which image is used for display/snapshot, somewhere. I couldn't remember it either when I recently re-installed MXCuBE.

marcus-oscarsson commented 5 days ago

I would advocate adding ffmpeg as a dependency to the mxcubeweb conda-environment.yml ? and yes documenting would also be good :)