GoPro MAX 360 Photo treated as flat photo

*nix specific usage questions
rolandturner
New Cone
New Cone
Posts: 4
Joined: 09 Dec 2022 02:50
Location: Singapore
Contact:

GoPro MAX 360 Photo treated as flat photo

Postby rolandturner » 09 Dec 2022 03:11

I understand that VLC is expected to be able to recognise "360°" photos (i.e. not just videos) and automatically enter the spherical viewer mode when it does so.

I've taken a (many...) "360 Photos" with a GoPro MAX. The photos contain apparently reasonable metadata to specify this. e.g.

Code: Select all

$ exiv2 -PX GS__0079.JPG Xmp.GPano.UsePanoramaViewer XmpText 4 True Xmp.GPano.CaptureSoftware XmpText 9 GoPro Max Xmp.GPano.StitchingSoftware XmpText 9 GoPro Max Xmp.GPano.ProjectionType XmpText 15 equirectangular Xmp.GPano.PoseHeadingDegrees XmpText 3 0.0 Xmp.GPano.PosePitchDegrees XmpText 3 0.0 Xmp.GPano.PoseRollDegrees XmpText 3 0.0 Xmp.GPano.InitialViewHeadingDegrees XmpText 3 0.0 Xmp.GPano.InitialViewPitchDegrees XmpText 3 0.0 Xmp.GPano.InitialViewRollDegrees XmpText 3 0.0 Xmp.GPano.InitialHorizontalFOVDegrees XmpText 3 0.0 Xmp.GPano.InitialVerticalFOVDegrees XmpText 3 0.0 Xmp.GPano.CroppedAreaLeftPixels XmpText 1 0 Xmp.GPano.CroppedAreaTopPixels XmpText 1 0 Xmp.GPano.CroppedAreaImageWidthPixels XmpText 4 5760 Xmp.GPano.CroppedAreaImageHeightPixels XmpText 4 2880 Xmp.GPano.FullPanoWidthPixels XmpText 4 5760 Xmp.GPano.FullPanoHeightPixels XmpText 4 2880 Xmp.GPano.FirstPhotoDate XmpText 19 2022:12:09 09:13:26 Xmp.GPano.LastPhotoDate XmpText 19 2022:12:09 09:13:26 Xmp.GPano.SourcePhotosCount XmpText 1 2 Xmp.GPano.ExposureLockUsed XmpText 5 False Xmp.GPano.InitialCameraDolly XmpText 3 0.0 $
Nonetheless, VLC displays the image as a flat one, with the entire projected image as a single rectangle and no ability to pan/tilt/zoom. Spherical videos from the same camera are successfully recognised by the same installation of VLC and the pan/tilt/zoom controls work as expected. My problem and question are about still 360 Photos only.

I have poked around and not been able to find documented what metadata VLC is looking for to cause it to enter the spherical viewer mode (I confess that I've not studied the source code). Is this documented somewhere? Is Xmp.GPano.ProjectionType an appropriate tag for this purpose? Have I missed a control or setting somewhere?

Code: Select all

$ vlc --version VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2) VLC version 3.0.16 Vetinari (3.0.13-8-g41878ff4f2) Compiled by buildd on lcy02-amd64-108.buildd (Mar 13 2022 08:00:10) Compiler: gcc version 11.2.0 (Ubuntu 11.2.0-18ubuntu1) This program comes with NO WARRANTY, to the extent permitted by law. You may redistribute it under the terms of the GNU General Public License; see the file named COPYING for details. Written by the VideoLAN team; see the AUTHORS file. $

rolandturner
New Cone
New Cone
Posts: 4
Joined: 09 Dec 2022 02:50
Location: Singapore
Contact:

Re: GoPro MAX 360 Photo treated as flat photo

Postby rolandturner » 10 Dec 2022 03:55

So, answering my own question: there would appear to some differences in how different tools encode the image metadata. Using exiv2 to merely set the same tag value that's already present resolves the problem:

Code: Select all

$ exiv2 -M 'set Xmp.GPano.ProjectionType equirectangular' mo GS__0079.JPG
After doing this, VLC goes into spherical viewer mode as expected.
I notice at least two differences in the file:
- The original file from the camera has the EXIF tags right at the top, while the modified file has them deeper into the file:

Code: Select all

000000 ff d8 ff e1 06 c7 68 74 74 70 3a 2f 2f 6e 73 2e >......http://ns.< 000010 61 64 6f 62 65 2e 63 6f 6d 2f 78 61 70 2f 31 2e >adobe.com/xap/1.< 000020 30 2f 00 0a 3c 78 3a 78 6d 70 6d 65 74 61 20 78 >0/..<x:xmpmeta x< 000030 6d 6c 6e 73 3a 78 3d 22 61 64 6f 62 65 3a 6e 73 >mlns:x="adobe:ns< 000040 3a 6d 65 74 61 2f 22 20 78 3a 78 6d 70 74 6b 3d >:meta/" x:xmptk=< 000050 22 41 64 6f 62 65 20 58 4d 50 20 43 6f 72 65 20 >"Adobe XMP Core < 000060 35 2e 31 2e 30 2d 6a 63 30 30 33 22 3e 0a 3c 72 >5.1.0-jc003">.<r< 000070 64 66 3a 52 44 46 20 78 6d 6c 6e 73 3a 72 64 66 >df:RDF xmlns:rdf<

Code: Select all

00ee20 73 3c 6f 32 67 20 a0 76 62 02 e3 08 4e 4f 23 d4 >s<o2g .vb...NO#.< 00ee30 d6 ae 6b 97 e2 eb d7 53 7c 24 94 67 3e 68 b7 78 >..k....S|$.g>h.x< 00ee40 5b 47 6b 6f af 9f a3 d0 ff d9 ff e1 0c 81 68 74 >[Gko..........ht< 00ee50 74 70 3a 2f 2f 6e 73 2e 61 64 6f 62 65 2e 63 6f >tp://ns.adobe.co< 00ee60 6d 2f 78 61 70 2f 31 2e 30 2f 00 3c 3f 78 70 61 >m/xap/1.0/.<?xpa< 00ee70 63 6b 65 74 20 62 65 67 69 6e 3d 22 ef bb bf 22 >cket begin="..."< 00ee80 20 69 64 3d 22 57 35 4d 30 4d 70 43 65 68 69 48 > id="W5M0MpCehiH< 00ee90 7a 72 65 53 7a 4e 54 63 7a 6b 63 39 64 22 3f 3e >zreSzNTczkc9d"?>< 00eea0 20 3c 78 3a 78 6d 70 6d 65 74 61 20 78 6d 6c 6e > <x:xmpmeta xmln< 00eeb0 73 3a 78 3d 22 61 64 6f 62 65 3a 6e 73 3a 6d 65 >s:x="adobe:ns:me< 00eec0 74 61 2f 22 20 78 3a 78 6d 70 74 6b 3d 22 58 4d >ta/" x:xmptk="XM< 00eed0 50 20 43 6f 72 65 20 34 2e 34 2e 30 2d 45 78 69 >P Core 4.4.0-Exi< 00eee0 76 32 22 3e 20 3c 72 64 66 3a 52 44 46 20 78 6d >v2"> <rdf:RDF xm< 00eef0 6c 6e 73 3a 72 64 66 3d 22 68 74 74 70 3a 2f 2f >lns:rdf="http://< 00ef00 77 77 77 2e 77 33 2e 6f 72 67 2f 31 39 39 39 2f >www.w3.org/1999/< 00ef10 30 32 2f 32 32 2d 72 64 66 2d 73 79 6e 74 61 78 >02/22-rdf-syntax< 00ef20 2d 6e 73 23 22 3e 20 3c 72 64 66 3a 44 65 73 63 >-ns#"> <rdf:Desc<
- The original file has each tag as — literally — a separate tag-pair (XML element). The modified file has each "tag" as an attribute on the rdf:Description element. I understand that both are valid XMP, and jpeg.c:jpeg_GetProjection() appears to have explicit support for both, so I assume that this difference is not the problem:

Code: Select all

<GPano:StitchingSoftware>GoPro Max</GPano:StitchingSoftware> <GPano:ProjectionType>equirectangular</GPano:ProjectionType> <GPano:PoseHeadingDegrees>0.0</GPano:PoseHeadingDegrees>

Code: Select all

<rdf:Description rdf:about="" xmlns:GPano="http://ns.google.com/photos/1.0/panorama/" GPano:UsePanoramaViewer="T rue" GPano:CaptureSoftware="GoPro Max" GPano:StitchingSoftware="GoPro Max" GPano:ProjectionType="equirectangular" GPano:PoseHeadingDegrees=" 0.0"

Code: Select all

/* Try to find the string "GSpherical:Spherical" because the v1 spherical video spec says the tag must be there. */ if (strcasestr(psz_rdf, "ProjectionType=\"equirectangular\"") || strcasestr(psz_rdf, "ProjectionType>equirectangular")) fmt->projection_mode = PROJECTION_MODE_EQUIRECTANGULAR;

User avatar
InTheWings
Developer
Developer
Posts: 1275
Joined: 07 Aug 2013 13:15
VLC version: crashing
Operating System: Linux
Contact:

Re: GoPro MAX 360 Photo treated as flat photo

Postby InTheWings » 13 Dec 2022 11:44

Code: Select all

while (cmarker) { if (cmarker->marker == EXIF_JPEG_MARKER) { if(cmarker->data_length >= 32 && !memcmp(cmarker->data, EXIF_XMP_STRING, 29)) { xmp_marker = cmarker; break; } } cmarker = cmarker->next; }
The reason is code stops on the first APP1 Exif marker.

Can you provide original file as sample ?
:!: If you want your problem to be solved :
* First read troubleshooting guide VSG:Main
* Always provide verbose LOGS ! (command line or from gui)
* Always check your issue against a developer build from Nightly Build of VLC
* Tell us when your problem is solved !

rolandturner
New Cone
New Cone
Posts: 4
Joined: 09 Dec 2022 02:50
Location: Singapore
Contact:

Re: GoPro MAX 360 Photo treated as flat photo

Postby rolandturner » 13 Dec 2022 13:32

Ah, that would do it. I did skim that code, but didn't stop to think about what it was [not] doing.

Yes, certainly. I gather that a can't upload media samples here, so have uploaded a temporary copy elsewhere. If you'd like to retain it as a test case then please save a copy. (assume CC-BY terms).

Image

User avatar
InTheWings
Developer
Developer
Posts: 1275
Joined: 07 Aug 2013 13:15
VLC version: crashing
Operating System: Linux
Contact:

Re: GoPro MAX 360 Photo treated as flat photo

Postby InTheWings » 13 Dec 2022 20:26

:!: If you want your problem to be solved :
* First read troubleshooting guide VSG:Main
* Always provide verbose LOGS ! (command line or from gui)
* Always check your issue against a developer build from Nightly Build of VLC
* Tell us when your problem is solved !

rolandturner
New Cone
New Cone
Posts: 4
Joined: 09 Dec 2022 02:50
Location: Singapore
Contact:

Re: GoPro MAX 360 Photo treated as flat photo

Postby rolandturner » 14 Dec 2022 02:05

Impressive response time, thank you!


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 12 guests