haidahaida
haidahaida

Reputation: 229

Is there a way to use ffmpeg for RGB to true YUV (not YCbCr) conversion?

As far as I can see in the documentation, all conversions involving YUV actually use YCbCr. There are slight differences though, and I would like to convert to the actual YUV format. Is there any way at all using ffmpeg? As an afterthought, is there any other way that is as fast as ffmpeg?

charts Image source

Upvotes: 2

Views: 3576

Answers (2)

No, it is not possible. YUV is PAL ITU-R BT.470 standard as used for analog TV, it is not in use anymore. You can use https://github.com/fsphil/hacktv with software defined radio instead.

https://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavutil/pixfmt.h;h=d41d1ca12fd381058df41cddfb74fa8e21ad13b0;hb=HEAD#l62

These do not use YCbCr or YUV, those are pixel formats, not color matrices.

Upvotes: 1

haidahaida
haidahaida

Reputation: 229

It turns out it is possible: for example when processing an AVFrame using an AVCodecContext,

All links are relative to release 3.2.

Edit: I believe the actual mathematical conversions are in yuv2rgb.c.

Upvotes: 2

Related Questions