The MP4 format doesn't support an Alpha channel. The question you've asked is very broad, and I've tried to answer to a certain extent below. However you may need to decide what route you're going to try and then researching that route or asking further, more specific questions.
The file types that currently support an Alpha (transparency) channel are FLV, F4V, AVI, Quicktime, and WebM. If you're using free programs, you may find they can export in these formats. Often, there will be a named codec for an Alpha channel within the settings of these, or a PNG option. Firstly, I would see if there's an option to export video within your PyMOL software in any of these formats - try exporting them in different ways to see if they have the Alpha channel.
Alternatively, if it's a one off video, you could use the free trial of Premiere Pro or After Effects to create and export your video, although it can be a learning curve if it's a complex project and you have never used Adobe Creative Cloud before. Lastly, you could export your video and try and remove the background in a video editor. (If you want to use WebM, you need a third-party WebM codec for Adobe Media Encoder.)
PNG import /export
You could import the png sequence into either After Effects or Premiere Pro (free trials available for each). I'm sure several free programs can import a PNG sequence automatically, or you could manually arrange the images on the timeline, one image per frame.
I mainly use Premiere Pro so below I've listed a couple of ways I can use it to export a transparent video directly from Premiere. HOWEVER - there are likely to be similar options in other programs - most video programs will export in a variety of formats / codecs.
###Export a movie file with an alpha channel in Premiere Pro ###
- Select the sequence.
- Choose File > Export > Media.
- In the Export Settings dialog box, choose one of the following
options:
Option 1 - QuickTime
- Select "QuickTime" in the file format
- Select "PNG" from the video codecs
- Under Channels, select "RGB + Alpha"
Option 2 - Microsoft AVI
- Select "AVI" in the file format
- Select "RGBA + " from the video codecs
- Under Channels, select "RGB + Alpha"
- Once you have changed settings as per one of the sets of options above, continue to set other settings and click Export or Queue to export as you normally would.
Remove background
Another option is that if the background is a consistent colour - white, grey, green etc, most advanced video editors will have options to remove the background using a colour match.
In Premiere Pro, this is done using the Chroma key effect. In essence, add the effect to the video, take a sample of the background colour, and the background should be removed, it's just left for you to export the video in one of the methods mentioned previously.