
Maybe we could add this option instead to translate alpha values to binary b&w values for matte masking purposes on export, but that's just an idea worth exploring later. MOV (Usually with a PNG video codec or the ancient QT "Animation" codec).įor the other formats that do not support transparency people usually export an additional black & white video to serve as a "matte" where a 100% alpha value is recognized as pure black in compositing software.

Normally no-one even attempts to use those formats to get transparency, the most widely used format for that is Quicktime. Until we get some export format suitable for application to application transfer, I will leave this issue Awesome, thank you so much for looking into this. It should be very quick to implement so I will just make a PR for it right away and we can discuss it further there. mkv format which is a common container format for FFV1 and eliminates the confusion that would occur if avi was used instead. The FFV1 codec supports transparency, is one of the best lossless formats, and is well supported, making it ideal for this use case. Most people who need transparency are using it for transferring their animation from Pencil2D to some other application (ex. I think the best idea is to continue to use the same codecs for mp4 and avi, and add a new option for FFV1 export. To me that's a deal breakers since we do not want people thinking our program is broken because their players are unable to process our exported videos. For instance, Firefox views an mp4 file with a png codec as corrupt and cannot play it. However, the files it produces are much larger, there is no control over the quality of the result (always lossless I think), and it is less widely supported. mp4 files with transparency if we use a different codec, for example the png codec (different from apng) would work well for this purpose and can inside both avi and mp4 contains. Well h.264 technically does support transparency, but nobody actually uses it and as far as I can tell ffmpeg does not even support it. Both h.264 and mpeg4 do not support transparency. Currently we are using the h.264 codec for mp4 export and the mpeg4 codec for avi, which are both standard pairings from what I've seen. What's important to understand is that these are both flexible container formats for various codecs. Two currently supported formats still remain: MP4 and AVI. In order to get ffmpeg to recognize WebM transparency, you must use the libvpx-vp9 codec before importing like this: ffmpeg -c:v libvpx-vp9 myanimation.webm.

Obviously support for viewing the transparency will depend on the player you use to play back the exported file, but I have verified that the transparency channel works in Firefox and ffmpeg. I have just implemented transparency support for WebM and APNG export in bfd3d74.
