Pano2VR 7 Docs / Embedded Video

Embedded Video

Learn how to embed videos into panoramas which allows for a seamless integration of live-action video in a still panorama.

An embedded video differs from a pinned video in that an embedded video is blended in to the image and a pinned video is “attached” to the image. Embedded video when compared to a full 360º video, has the advantage of producing smaller file sizes.

https://vimeo.com/344045767

When taking the 360º panorama image, record a regular, flat video as well. Try to keep the action in the center where there is lens distortion. You will need an image editor that supports video as well. In the tutorial, we use Photoshop to blend the video and image.

Extract a Patch Image

  1. Add the panorama to a Pano2VR project.
  2. Set the default view to the portion of the panorama that will have the video.
  3. Add a patch over the area where the video will be. Make it a little larger than video area, to make it easier to blend the edges.
  4. Extract an image patch. Use PSD to have the patch open in your default editor for PSD files. We are using Photoshop in our example.

Match the Patch Image and Video

The next step is to line up the video with the patch image.

  1. In Photoshop (or other editor), drag in the video, creating a second layer with the patch image as the background layer and the video above the patch image.
  2. Select the Transform tool.
  3. Change the opacity of the video layer to make it easier to see the patch image under it.
  4. Resize the video layer to best match the patch image. It won’t be a perfect match if different cameras were used. In our example files, the video was captured with a phone camera, so the distortion is different from the patch image. Try using the Warp Tool to do fine distortion correction.

Create a Looping Video

If your video is like our example, a fountain/running water, then it makes sense to put this video on loop to give the appearance constant water flow.

If your video is non-repetitive, like a person speaking, then it makes more sense to simply edit the beginning and ending of the video clip so when the video does repeat it is seamless. You will not need to edit the clip like we have in the following instructions.

Still in Photoshop:

  1. Go to Window > Timeline and create Video Timeline.
  2. Set the video layer’s opacity back to 100%.
  3. Trim the video as necessary to capture the best portion. In our example, we cut the video where there was minimal camera movement. This will create a new video track.
  4. Cut the video at about 2 seconds in from the end. Then move that region to the front of the video clip. Now the video will loop, but edit in the middle will jump.
  5. Use a dissolve to tidy this edit. Click the video transition button in the video timeline and choose Cross Fade.

The video clips are now visible as two layers in a Video Group.

Blend the Video into the Patch Image

Now we add a mask to blend in the video to the patch. This removes the area outside of the video area and lets the patch image show through.

Still in Photoshop:

  1. Select the Video Group.
  2. Add a layer mask.
  3. Adjust the brush to have low harshness and begin to mask out the area around the video. Tip: Alt-click the mask layer to see the entire mask and then use the Bucket tool to mask out the area. (See the video tutorial at about 9:25.)

It’s now obvious that the image and video have different color spaces. We can fix this using an adjustment layer. Still in Photoshop:

  1. Add an Adjustment Layer.
  2. Select, Exposure. Make sure to limit the adjustment just to the layer directly below. Adjust the Gamma Correction slider.
  3. Change the color temperature if needed. For our example, we are using another adjustment layer, Photo Filter, to change the video’s color temperature.

Export to Video

  1. File > Export > Render Video.
  2. For size, make sure the video size is under 1080px and divisible by 16. This will will make the video device-friendly.
  3. Render.

Convert to Pinned Video

Go to back to Pano2VR:

  1. Select the original patch.
  2. In the patch’s parameters, click Convert to Pinned Video and then select the looping video you just created.
  3. In the Pinned Video parameters, add audio if needed. We used Directional Rectangular.
  4. Add a Web Output and generate the project.

Adding an image mask

Mask toggled on and off.
Mask toggled on and off.

Sometimes the edges of the video are visible in the panorama. This is usually caused by the differences in the color spaces that images and videos use. Adjusting Gamma can help, but on high contrast scenes it might not be enough. Adding an image mask to the patched area will help eliminate the video’s edges. You can see an example here.

The following steps mimic the steps in the video tutorial above but add a few extra steps that are needed for masking. Masking helps the video match the panorama. You can either have Pano2VR generate the mask or you can create a mask in your photo editor for more precision.

Using the mask generated by Pano2VR:

  1. Extract the patch.
  2. In your editor of choice, add the video clip and transform and edit as needed.
  3. Back in Pano2VR, find the original patch and convert it to a pinned video.
  4. Select the video you created in Step 2.
  5. In the video’s properties, click the Generate Image Mask button for Image Mask File.
  6. In the dialog that appears, define the amount of feathering.
  7. Save and export the project.

If you need a more precise mask, create your own using the following steps.

Creating a mask in Photoshop (or any editor that supports a video layer):

  1. Extract the patch.

  2. Copy that patch in List View.

  3. In Photoshop (or your editor of choice), add the video and the original patch image to the video timeline.

  4. Add a mask to the video layer. Paint out the unnecessary parts, as in the video above.

  5. Export the video with the mask.

  6. Then drag the mask from the video layer to the image patch layer.

  7. Invert the mask using Control-I or Command-I.

  8. Hide the video layer.

  9. Export the image patch out as PNG.

  10. In Pano2VR, select the top patch and convert it to a pinned video. Then in the Patch properties, choose the masked video as the patch.

  11. Select the second patch and covert it to a pinned image. Change its file to the inverted patch (the image with the inverted mask).

  12. Save and export the project.

These steps are shown in the video below at about 34:00.

Webinar – Embedding Video

Take a deeper dive into the workflow of embedded videos with this webinar (with Project Files) recorded in October 2020. You’ll find project files to work with on the webinar page.

https://vimeo.com/463810496

See also…

Last modified: Feb 13, 2023