How to create a transparent video for Minsar¶
A transparent video is like an image with an alpha channel, that is to say an image with a transparent background. To import a transparent image in Minsar, you have to make sure it has no background, and export it in ".PNG" from Photoshop or similar software. For a video, it is basically the same thing: you have to make sure that your video has no background first. In this tutorial, we are going to see how to do that in two different ways. The simplest one is through Ffmpeg, the other one is through After Effects.
But first, let's go get that nice bird transparent video!
Create your transparent video¶
In this tutorial, we will go and fetch a transparent video on the Internet. There are a lot of them for free.
1.1. Go to Videvo.
1.2. Click on "Video".
1.3. On the top right corner, type "Alpha" in the search bar.
1.4. You will see a certain amount of videos with a black background. Choose one you like. For our part, we liked the little bird.
1.5. Click on the video you want, and then on "Free Download". Save it on your computer.
As you can see in your explorer, the miniature of the video shows the bird on its black background. However, in order to interpret it correctly, Minsar needs the alpha channel to be separated from the RGB channel, and put right beside it so that Minsar can re-assemble it its own way.
In the end, to be processed correctly, your transparent video must look like the "alphabird_alpha.mp4" you can see below.
So how are we supposed to do that? Well, here is the first, simplest way.
Process your video¶
First Method : Ffmpeg¶
Ffmpeg is an amazing, free and open source little tool which enables you to do a multitude of operations on a video. Create a gif, rescale, rename, compress... without needing to re-render it through After Effects or any other video editing tool. However, it is not very user-friendly, so here is what you have to do.
2.2. When Ffmpeg is installed, go to the folder of the bird video you have downloaded in the first part of this tutorial. There, double click in the url address bar so as to delete everything and write "cmd" instead.
2.3. In the console, type this command, replacing "video_name.video_extension" by the actual name and extension of the video you have downloaded.
ffmpeg -i video_name.video_extension -vf "split [a], pad=iw*2:ih [b], [a] alphaextract, [b] overlay=w" -y final_name_alpha.mp4
Mind the caps and spaces!
Beware, this is a code instruction, that is to say you need to mind the exact caps and spaces while typing it. Moreover, the "final_name_alpha.mp4" can be renamed as you like, provided you keep the "_alpha.mp4" in the end, otherwise Minsar won't understand it is a transparent video.
If you are on Mac
If you are on Mac, for this part you can also rely on this tutorial (timecode about 3:30). You will have to navigate to your video using the cd command (if that seems too complicated for you, then move your video to your Desktop and follow exactly what the youtuber says). Then, instead of the command the youtuber writes at timecode 3:56, write the one we gave you at step 2.3.
Here is what your command window should like when you have typed the command.
2.4 Hit "Enter" and wait for Ffmpeg to work its magic :). This is what it should look like while working.
Once that done, you should see your new video with the correct separation of the RGB and alpha channels, as in step 1.5.
Second Method: After Effects CC 2018 and Media Encoder¶
If you don't feel like jumping into Ffmpeg and are more familiar with Adobe Suite, then here is what you can do. You will need After Effects CC 2018 and Media Encoder 2018, as in the latest After Effects releases you cannot export in .MP4 anymore. Yet, .MP4 is the only video format Minsar is able to read for now.
If you have a problem with Media Encoder
If for some reason you cannot use Media Encoder, we will show you another means of achieving what you want, through Ffmpeg. Don't worry, we will work you through it :)
If you are on Mac
The commands we are going to give you in this section are for Windows. If you don't know After Effects and need to know the shortkeys for Mac, you can check them out here.
2.1. Open Adobe After Effects CC. For this tutorial, we used the 2018 version (15.1.2).
2.2. Create a new project, and drag and drop your video on the left part of the screen.
2.3. Click on the video you have just imported, and hit "Ctrl + D" to duplicate it. Now Right-Click on the duplicate, and select "Rename" to rename the footage as "Alpha".
2.4. Now we are going to create a precomposition with this footage. To do that, simply drag and drop the footage to the "Create a new Composition" button at the bottom of the panel.
2.5. You now have your precomposition. Rename it something clear, like "Alpha_precomp". You should now have something like this.
All right, now we need to extract the alpha channel from this footage.
2.6. Create a "White Solid". To do that, go to the top menu bar, and select "Layer/New/Solid...".
2.7. In the Solid menu, change the color to pure white and hit "OK".
2.8. In your precomposition layer window, click on your "alpha" footage and drag and drop it above the White Solid you have just created.
2.9. Now, we are going to apply a mask so that the white layer only appears through the shape of the bird. To do that, you will certainly have to expand your layer options: click on the small button showing a circle and a cube, at the bottom of the panel. It says "Expand or Collapse the Transfer Controls pane". Once done, you should see a new "TrckMat" column next to your layers.
2.10. Now, click on your White Solid layer. In the dropdown menu of the TrckMatte column, select "Alpha Matte". Your image should go black and white, with the nice shape of your bird in white.
2.11. We now have our alpha information. Now we need to append it to the RGB information. Start by clicking on your original video in the assets panel, and note it's size and duration. In our case, if you have chosen the bird, the size is 1920x1080, and the duration 00:00:06:12.
2.12. Still in your assets panel, Right-Click and select "New Composition...".
2.13. In the composition creation menu, start by un-ticking the "Lock Aspect Ratio" option. Change the "width" to twice the original one. In our case, the video is 1920 wide. We will then enter 3840 in the width. Then, adjust the "Duration" to that of the video. In our case, 00:00:06:12. To finish, name your composition "Master", because it will be the composition you will render.
2.14. In your Master composition, drag and drop your original footage. In the main panel, move it so that it fits exactly on the left side of the image, by clicking it and dragging it while holding shift to the left. For more precision, you can also move it only by hitting the directional left arrow on your keyboard, until the image is exactly on the left side of the composition.
2.15. Now do the same thing for your alpha precomposition, except that you have to put it on the right this time.
Be careful, for your video to look good, the two images must be positioned exactly on the right and left side of your composition, so that they can then be re-assembled perfectly by overlapping each other. That is why you should be extremely precise in this operation.
All right, now our video is ready to be exported! If you have Media Encoder installed, proceed to 2.16. If not, proceed to Get a .MP4 video without Media Encoder.
2.16. Select your Master composition in the asset panel. Then go to "File/Export/Add to Adobe Media Encoder Queue...". Wait for Media Encoder to launch.
At this point, it would be a good idea to save your project :). Go to "File/Save as/Save as..." to do so.
2.17. Once you are in Media Encoder, you will see your Master composition in the right hand panel. Right-Click on it and go to "Export Settings...". Wait for the "Connecting to dynamic Link Server" to end, it can take a little while.
2.18. In the Export Settings, you want the format to be either "H.264" or "HEVC(H.265)". Here, we'll choose the latter. The Output Name should be "Master.mp4" in either way. By clicking on the name, you can choose where you want to save your final video. Make sure "Export Video" is ticked, and tick "Export Audio" if your video has audio in it. Don't touch anything else and hit "OK".
2.19. Now you have to launch the actual rendering of the video, by clicking on the green "Play" button at the top right corner of the window.
2.20. Once your video is rendered, there is a tiny thing left to do. Go to your exported video, and add "_alpha" at the end of the name, or else Minsar won't know it has to treat it as a transparent video. Note that you can also do that by directly renaming the output video in Media Encoder.
Here you are, you can now have your little birdie fly gleefully in Minsar!
Get a .MP4 video without Media Encoder¶
If for some reason you have a problem and cannot go through Media Encoder to render your video in .MP4, you are going to need to use ffmpeg. But first, you still have to **render your video from After Effects. **
2.16. Select your Master composition, and go to "File/Export/Add To Render Queue".
2.17. In the Render Queue, click on "Master.avi" to choose where you want to save your final output. Then click on "Lossless" in order to access the Output Module Settings.
2.18. In the Output Module Settings, choose "Quicktime" for the Format, and then click on "Format Options...".
2.19. By default, you should be in "Animation" codec. If not, find it in the drop down menu. Click "OK" when you are done, then "OK" again on the former window.
2.20. Hit "Render" and wait until the render is done.
2.21. Rename your output video by adding "_alpha" behind it. You should now have a video named "Master_alpha.mov".
We are now going to convert your video to .MP4 using ffmpeg. To do that, start by following the FFmpeg Method of this tutorial to know how you can install Ffmpeg. Then, instead of the command given at step 2.3. of the FFmpeg method section, write this one:
ffmpeg -i video_name.mov video_name.mp4.
In our case it should look like:
ffmpeg -i Master_alpha.mov Master_alpha.mp4.
If you want your video to be as optimized as possible without losing too much quality, you can also use this formula:
ffmpeg -i video_name.mov -pix_fmt yuv420p -crf 20 -r 25 video_name.mp4
**You can now put your video into one of our providers and import it directly in Minsar! **
Don't forget that once imported in Minsar, you will have to put no backside color, which is white by default. To get more information about the import process and other requisites, please see import a transparent video.