In the final part of this series, I convert a GoPro EAC projected frame into an equirectangular projection to be displayed in other software.
Last week I blended the overlapping pixels in .360 cubefaces. For the final step, I need to convert into equirectangular frames (the most widely understood projection type in software for 360 images).
Luckily, I discovered that Paul Bourke has published a significant amount of his work on converting to/from cubemaps, as well as lots of other related works.
Taking inspiration from this work and with the help of Paul himself, MAX2sphere takes the 2 GoPro EAC tracks and converts them to equirectangular (as well as performing the blending mentioned last week).
Used in its simplest form for what we need:
$ @SYSTEM_PATH/MAX2sphere track0/img1.jpg track5/img1.jpg
All that’s left to do now is add the correct metadata to the new equirectangular frame, all of which has been lost during processing.
For more details about injection metadata (most importantly telemetry), read this post, but at a minimum, we need to add the
projectiontype tag so the image is rendered correctly in 360 viewers.
exiftool -ProjectionType=equirectangular img1.jpg
And voila, we have a equirectangular frames from the
Now, many of you might want a video, not frames. That is, after all, what GoPro Studio outputs.
In this case, we can rebuild a video from all the frames extracted:
ffmpeg -i FRAMES/%d.jpg -c:v libx264 -framerate 1 -pix_fmt yuv420p GS070135.mp4
Note: I use a 1 second framerate, as we extracted 1 FPS at step one. Whatever framerate value selected during extraction should probably be used here.
Like the images, metadata will need to be written into the video to ensure video players read it correctly. Read my post, Turn 360 photos into 360 videos, to see how this can be done.
- Broke .360 down into 2 frames using ffmpeg (see part 2)
- Blended cubefaces in each frame with overlapping pixels (see part 3)
- Rebuilt each frame as a cubemap (see part 3)
- Converted each cubemap to equirectangular frames and added metadata (this post)
- Converted frames to a video and added metadata (this post)
One feature missing is GoPro Studio’s horizon leveling feature. It does this by automatically by analysing the frame and working out the horizon and then adjusting the roll, pitch, and yaw. This is what things like PtGui (and others) do too. It is something I’m considering adding in the future.
For now though, these two options will turn your images or videos with GoPro EAC projections into equirectangular ones…
1. MAX2sphere (EAC frames to equirectangular frames)
MAX2sphere takes a raw GoPro .360 frame (both tracks of EAC projection) and converts them to a more widely recognised equirectangular projection.
2. FFMpeg (EAC video to equirectangular video)
This fork of FFMpeg takes a .360 video and converts it to a h264
.mp4 with an equirectangular projection.