umlaeute / Gem

Graphics Environment for Multimedia (official repository)
https://gem.iem.at
Other
103 stars 30 forks source link

[pix_chroma_key]: Linux OK, same patch on Mac failed #282

Closed jamshark70 closed 2 years ago

jamshark70 commented 2 years ago

With the pictured patch, Linux correctly renders the green background of the video transparent, but when I took it into the classroom (Mac lab) -- no transparency, with an identical patch and video file. (Perhaps not an identical Gem version... under time pressure, I'm afraid I didn't check.)

I can imagine two possible explanations (not ruling out others):

  1. Perhaps the Linux codec is serving up RGBA while the Mac codec gave YUV by default.
  2. Or perhaps it's a bug that manifests in Mac only.

Any ideas?

Oh, curiously, in Linux I had to set "direction 1" for the left image to be treated as the key source (though the help patch suggests otherwise). In Mac, neither direction 0 or 1 got the right result.

pd-chromakey-2

Ant1r commented 2 years ago

I think you should try adding an [alpha] in your chain, for example just before the [rectangle].

umlaeute commented 2 years ago

Perhaps the Linux codec is serving up RGBA while the Mac codec gave YUV by default.

this.

add a [pix_rgba] before the [pix_chroma_key]. or use the [colorspace( message to [pix_film]. or use both ([pix_rgba]` won't do anything if the colorspace is already RGBA).

the philosophy is: if a specific colorspace is required, add code that ensures that it is. the default colorspace might target optimized playback rather than compatibility.

i'm closing this as intended behaviour (i don't want to make YUV the default colorspace; and Mac people have always been very verbose that this is the only sane colorspace form them)

jamshark70 commented 2 years ago

I see... unfortunately, I didn't think of this until after the fact (one isn't optimally clearheaded when one has five minutes before the start of class, and the patch didn't work, and there are 40 students sitting there waiting).

I do think, however, that the philosophy should be documented. There is no hint in either [pix_film] or [pix_chroma_key] help that, for the same patch, the color space may vary by OS.

I can go ahead and do a quick PR for that -- just noting that, while it may be intended behavior, it's also currently undocumented behavior.

umlaeute commented 2 years ago

i agree that this should be documented :-)