1

I have small project which uses blend filter of FFmpeg library.

I read the examples of this document https://ffmpeg.org/ffmpeg-filters.html#blend_002c-tblend

But I'm not clearly understand about it.

X, Y : the coordinates of the current sample

W, H : the width and height of currently filtered plane

What are the sample and filtered plane? Is there any document about these things.

Community
  • 1
  • 1
tainguyen
  • 85
  • 1
  • 14

1 Answers1

3

In the context of an image, a sample refers to an individual pixel. However, a pixel usually has multiple components, like RGB (red, green and blue) or YUV (luma and two chroma units). So 'sample' here refers to the individual stores of value, i.e. a Magenta RGB pixel is defined by three samples (255,0,255).

Pixels of a frame can be stored packed (R1G1B1R2G2B2..) or planar ([R1R2...RN][G1G2..GN][B1B2..BN]). The blend filter works on planar formats only.

In YUV format images, the UV is typically subsampled and so the width and height of UV planes is lower than that of the luma plane.

Gyan
  • 85,394
  • 9
  • 169
  • 201
  • 1/ Are there any relationship between the width and height of these planes and image's size. 2/ If UV planes's size is lower than luma plane, how can they composed into 1 frame, and X Y are coordinates of either luma's sample or chroma's sample. 3/ Is there any document or book talking these things in detail? – tainguyen Jun 08 '18 at 13:53
  • Luma plane size is the same as the image size. Typically, the ratio of luma plane dimension to chroma plane dimension is a power of two (1,2,4...). There are many books on the matter. Start with the wiki link and explore. See the citations in those articles for sources. – Gyan Jun 08 '18 at 14:08
  • thank for your reply @Gyan, I have another question, ffmpeg will extract input files (A, B) into planes then blend Ay with By, Au with Bu, Av with Bv, and compose them, isn't it. – tainguyen Jun 08 '18 at 14:32
  • Can I have your skype or email ? – tainguyen Jun 08 '18 at 14:38
  • @Gyan From where do you know that the `blend` filter only works with planar inputs? I couldn't find anything about this in `ffmpeg -help filter=blend` or on ffmpeg.org. – Cubi73 Feb 21 '22 at 19:07
  • Its not documented. You have to examine the source. – Gyan Feb 22 '22 at 04:02