nextcloud / files_photospheres

Nextcloud app for viewing Google PhotoSphere 360° images (panorama-images)
GNU Affero General Public License v3.0
29 stars 2 forks source link

VR180 file format & VR toggle support? #1

Closed R0Wi closed 2 years ago

R0Wi commented 5 years ago

Great app, thanks for creating this.

Would be nice if the new VR180 format would be supported (as used by the Lenovo Daydream camera), and ideally also to have a VR toggle to look at VR and 360° photos that way.

It seems like the new v4 version of the library used is supporting some of this: https://photo-sphere-viewer.js.org/v4/

Thanks for considering!

(NOTE:: this issue was moved from https://github.com/R0Wi/Nextcloud-PhotoSphereViewer/issues/1)

R0Wi commented 5 years ago

Actually the version 4 of the libary is still in beta state. So we won't manage to integrate it at the moment.

poVoq commented 3 years ago

Any news on this? Looks like v4 is stable now: https://photo-sphere-viewer.js.org/guide/migration-v3.html

R0Wi commented 3 years ago

Sounds interesting. Migrating towards the new viewer version shouldn't be too hard. But i don't have any VR180 data. If i upgrade the component would you test the new app version?

poVoq commented 3 years ago

Yes I have some VR180 images from the DaydreamVR camera that I can share as test material.

R0Wi commented 3 years ago

Ok sounds good to me 👍 I added this to my ToDo list and will inform you on any news

R0Wi commented 3 years ago

@poVoq i implemented the update. If you like you can test it by manually installing the app from https://github.com/nextcloud/files_photospheres/suites/2770953847/artifacts/61382672 (first unzip and then untar the files_photospheres folder into you NC apps folder).

Would be happy to get some feedback :+1:

poVoq commented 3 years ago

20181111-114246129 vr I'll try in a bit, but this photo was taken with the DaydreamVR camera and you can use it to test. I hope Github does not convert them somehow.

R0Wi commented 3 years ago

@poVoq i have some news: seems like your sample can be correctly shown inside the app. The problem in your sample is, that it's missing the mandatory GPano:ProjectionType attribute (see https://developers.google.com/vr/reference/cardboard-camera-vr-photo-format). It also doesn't contain the GPano:UsePanoramaViewer metadata so currently the image will be opened inside the regular image viewer. These two metadata tags control if the photosphere viewer or the regular image viewer will be opened.

Is this file directly copied from your camera? If yes regarding to the specs the metadata is incomplete. You can inspect the metadata on your own if you just open the file in a regular text-editor like nano.

You can download the current testing version for this branch via https://github.com/nextcloud/files_photospheres/suites/2875375155/artifacts/64279786

Would be glad to get some feedback :-)

poVoq commented 3 years ago

Yes strait from the camera, and I now double checked if Github might have stripped some metadata, which doesn't seem to be the case.

This is quite odd, as the Lenovo Daydream camera is pretty much the reference implementation for the VR180 format. I don't think any other such cameras were ever produced.

R0Wi commented 3 years ago

Unfortunately i cannot find any specs for this format. Nevertheless we'd need a clear decision if the jpg file to be shown is a VR180 or not. I think we need further investigation in the metadata of this format.

poVoq commented 3 years ago

This seems to have some details on the format: https://github.com/google/spatial-media/blob/master/docs/vr180.md Although I am not sure how the VR180 images related to the VR180 video format.

R0Wi commented 3 years ago

I did some research and regarding to the specs i found here, the GImage:Mime type should always be set in VR180 files. It's also set in your sample and in the samples provided here. So i changed the backend logic to signalize files which contain the GImage:Mime="image/jpeg" to be opended by this app.

The current version can be downloaded here: https://github.com/nextcloud/files_photospheres/suites/2880576389/artifacts/64428192 . For me it works with your sample and some other regular photosphere images i have in my personal store. Let me know you results :-)

xausy commented 2 years ago

Is there anything new related to the VR switch? I would be happy if I could view 360-degree images directly in the NextCloud with my smartphone and Cardboard. That should be possible with the new version of photo-sphere. By the way: A great addon!

R0Wi commented 2 years ago

Well i prepared the update to version 4 of photosphere viewer js. Could you imagine testing the new version?

xausy commented 2 years ago

Many thanks for the quick response. I would like to test the new version. But unfortunately I can't manage to install it in my test system.

git clone --branch feature/update-ppviewer-js4 https://github.com/nextcloud/files_photospheres.git

The directory is copied and visible.

chown www-data:www-data -R ./files_photospheres No mistakes.

As soon as I call up the frontend again, I get the error that the apps need to be updated. After that I have the "old" version of the viewer again.

I tried to set the dependency to max-version="23" under /appinfo/info.xml. That without success, too.

What to do, to test the new version?

R0Wi commented 2 years ago

I created a quick package rebased on the current master branch

https://github.com/nextcloud/files_photospheres/suites/5178736840/artifacts/157252866

Hope this works, didn't have the time to test it unfortunately :-D

xausy commented 2 years ago

Many thanks for the quick response. Now I was able to install the app and test it with many browsers. It works without any problems. Unfortunately, the gyro sensor and the VR view / cardboard view do not work. This probably requires activating the GyroscopePlugin and the StereoPlugin from Photo Sphere Viewer.js. Unfortunately, I can't find the specific place in your source code where I can add this. https://photo-sphere-viewer.js.org/plugins/

R0Wi commented 2 years ago

The viewer is created at https://github.com/nextcloud/files_photospheres/blob/911b1dac124c2bf3358772fa25b64d1f7514098c/js/init.js#L28 so i think that would be the correct place.

Currently there are no plugins involved but i could imagine to include some plugins hard-wired as "default" or to make them configurable, maybe?

xausy commented 2 years ago

Unfortunately, I still haven't found the place or the code to activate the plugins. It would be great if they were enabled by default (or configurable). That will be a perfect way using VR mode within NextCloud. My technical knowhow doesn't seem to be enough for adapting your source code though, unfortunately. So I hope that you will add this soon. Thanks a lot.

R0Wi commented 2 years ago

I updated to the latest photosphere viewer version (4.6) and added the gyroscope and stereo plugins. You can download the app version at https://github.com/nextcloud/files_photospheres/suites/6058044292/artifacts/209044322 (compatible to NC23)

Please note, that you'll have to serve your NC via https for this to work (see https://krpano.com/forum/wbb/index.php?page=Thread&threadID=16784)

Feedback would be really appreciated.

R0Wi commented 2 years ago

@xausy did you already have the possibility to check this out?

R0Wi commented 2 years ago

New viewer version integrated in v1.23.1 and v1.24.0.