|
49 | 49 | "</GSpherical:StitchingSoftware>"\ |
50 | 50 | "<GSpherical:ProjectionType>equirectangular</GSpherical:ProjectionType>" |
51 | 51 |
|
| 52 | +NOT_SPHERICAL_XML_CONTENTS = \ |
| 53 | + "<GSpherical:Spherical>false</GSpherical:Spherical>"\ |
| 54 | + "<GSpherical:Stitched>false</GSpherical:Stitched>"\ |
| 55 | + "<GSpherical:StitchingSoftware>"\ |
| 56 | + "Spherical Metadata Tool"\ |
| 57 | + "</GSpherical:StitchingSoftware>"\ |
| 58 | + "<GSpherical:ProjectionType>rectangular</GSpherical:ProjectionType>" |
| 59 | + |
52 | 60 | SPHERICAL_XML_CONTENTS_TOP_BOTTOM = \ |
53 | 61 | "<GSpherical:StereoMode>top-bottom</GSpherical:StereoMode>" |
54 | 62 | SPHERICAL_XML_CONTENTS_LEFT_RIGHT = \ |
@@ -176,6 +184,7 @@ def mpeg4_add_spherical(mpeg4_file, in_fh, metadata): |
176 | 184 | mpeg4_file.resize() |
177 | 185 | return True |
178 | 186 |
|
| 187 | + |
179 | 188 | def mpeg4_add_spatial_audio(mpeg4_file, in_fh, audio_metadata, console): |
180 | 189 | """Adds spatial audio metadata to the first audio track of the input |
181 | 190 | mpeg4_file. Returns False on failure. |
@@ -433,7 +442,7 @@ def inject_metadata(src, dest, metadata, console): |
433 | 442 | console("Unknown file type") |
434 | 443 |
|
435 | 444 |
|
436 | | -def generate_spherical_xml(stereo=None, crop=None): |
| 445 | +def generate_spherical_xml(projection="equiretangular", stereo=None, crop=None): |
437 | 446 | # Configure inject xml. |
438 | 447 | additional_xml = "" |
439 | 448 | if stereo == "top-bottom": |
@@ -499,7 +508,8 @@ def generate_spherical_xml(stereo=None, crop=None): |
499 | 508 | cropped_offset_left_pixels, cropped_offset_top_pixels) |
500 | 509 |
|
501 | 510 | spherical_xml = (SPHERICAL_XML_HEADER + |
502 | | - SPHERICAL_XML_CONTENTS + |
| 511 | + (SPHERICAL_XML_CONTENTS if projection == "equirectangular" |
| 512 | + else NOT_SPHERICAL_XML_CONTENTS) + |
503 | 513 | additional_xml + |
504 | 514 | SPHERICAL_XML_FOOTER) |
505 | 515 | return spherical_xml |
|
0 commit comments