What is the best way to save video from faces of a cube? The render can produce 6 squares (90°x90°) of 1024x1024 resolution. Faces oriented along axies and only position is changed continuously. I want to save them into the video stream and then play back them into 360° panorama viewver by means of projection on the cube or using cubemap (OpenGL ES).

What is the best codec suitable and what is the best way to save video for above purposes? Is it better to use six separate synchronized video streams or, instead, to enclose all six faces into the one?

If cube is unfolded into six square bitmaps and composed into a 3x2 (or 2x3) rectangle, then it is possible to get artifacts on glued inner edges and on the outer edge of the resulting rectangle. I sure it may depend on codec used to compress/decompress resulting video.

In case of 6 separate video streams it is possible to render only 5 of 6 (or 3 of 6 in case of only pitch and yaw (but not roll) rotations are possible) faces of cube, i.e. only visible ones. But on the other hand it may be waste of resources to support six separate streams due to necessity of attendant metainformation handling.

What are expected performance issues inherent to different approaches?

The relevant platform is average home desktop PC.

  • $\begingroup$ There is a lack of 360 panorama, cubemap (!), codec and other relevant tags on computergraphics.stackexchange.com. $\endgroup$ Jul 28, 2017 at 13:40
  • $\begingroup$ If you do not use the mobile interface then you can make new tags if you wish. $\endgroup$
    – joojaa
    Jul 28, 2017 at 14:43

1 Answer 1


I would be tempted to use a solution which involves decoding a single rectangular video stream so you don't need any special video decoder. As you have said there will be performance penalties for decoding multiple seperate streams.

Something like octohedran cube maps might be a good offline way to convert 6 video streams into a single video stream while minimizing distortion. A relatively cheap pixel shader can be used to project the 'cube' map back to camera space.

Further reading here > http://www.vis.uni-stuttgart.de/~engelhts/paper/vmvOctaMaps.pdf

  • 1
    $\begingroup$ Non-pyramid view frustum is not supported by rasterisators, but we use ray-tracer and it may have sense in our case. Also pixel density can be adjusted to be one-to-one on resulting flat video, but still pixel density is not uniform in case of octamap. $\endgroup$ Jul 28, 2017 at 17:11
  • $\begingroup$ Currently "3x2-unfolded" video is used. The video looks seamless. No edges, no distortion on the first (and second) glance. Only four edges are glued and ten are onto the outer boundary. Currently used codec is randomly chosen and it is a luck, that there is no notable seams. (OpenGL supported) cubemap is a way to avoid geometry and filtering on glued and outer edges at all. It is interesting to try octamap, but presumably it have more distortion on the one hand and less glued and outer edges OTOH. Pixel to pixel mapping is impossible in case of non-cube Platonic solids. $\endgroup$ Jul 28, 2017 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.