Transparent background option does not write alpha channel [3.9.2, osx 14.2.1]

I am on ovito 3.9.2 and osx 14.2.1, with Ovito Pro installed via conda.
To reproduce, open ovito, select new python pipeline, and render with opengl with transparent background.
You can then check that the video has a black background.
For instance using ffmpeg -i test.mov check that it is written with the h264 coded which does not have an alpha channel. The gif, avi and mp4 formats also do not have an alpha channel.
Which video formats in which platforms support alpha channel?
Does it depend on the renderer chosen in ovito?
Has there been a regression in functionality?
This functionality is used by me and colleagues for presentations.

Hi!

We will look further into this question, but as far as I can tell OVITO never had the capability to produce transparent video files. I’ve tested old releases back to 3.5.4 and they all produce GIFs with a black background when “transparent” is selected as background color in the render settings. This does not depend on the rendering backend. For AVI and MP4 files, I am pretty sure, it is impossible to produce transparent videos in general. The codecs (e.g. h264) used with these video formats do not support transparency channels as far as I know.

For the time being, I recommend rendering your animation to a series of PNG image files and employing an external encoding tool (e.g. ffmpeg CLI) to generate the kind of video file you need.

We will look into the ffmpeg code of OVITO to see if transparent GIF animations are obtainable by configuring the encoder at the C-API level.

I see. My bad, I wrongly thought ovito had this functionality at some point.
On OSX I ended up finding out that QuickTime can convert a sequence of PNGs with alpha to HEVC with alpha, all done via the UI. It just a few extra steps so other people in the group are now using this method too.

Note for new readers: since ovito 3.10.2 there is now the possibility of creating transparent gifs. Cross-platform and easier to do than the quicktime conversion, but possibly creates larger files.

1 Like

I recommend rendering PNG first and using the excellent tool gifski to create gif files like this one:
pp