Suppose I have a sequence of PNG image files which may or may not contain an alpha channel (assume those that do have an alpha channel actually utilize it). While PNG files themselves have their own lossless compression, I can usually get much smaller filesizes by using lossless video codecs, such as x264. For example:
ffmpeg -framerate 60 -i out%04d.png -c:v libx264rgb -qp 0 out.mp4
has given me significant file savings over storing the original PNG files separately (1.92GB video file vs 4.51GB separately). However, I do not believe that this supports alpha channels, so I can't always use this codec. Ideally, I could find one codec that works in both scenarios (alpha and no alpha).
Do you know of an alternative lossless codec I can use that would give similar space savings while still supporting alpha channels? If you do but it isn't perfectly lossless, I'm willing to look at near-lossless alternatives as well.