[FFmpeg-user] RGB-YUV color shift

Tim Nicholson nichot20 at yahoo.com
Tue Oct 23 08:59:12 CEST 2012


On 22/10/12 22:28, George L.P. Fitz wrote:
> 
> On Oct 19, 2012, at 9:58 AM, Carl Eugen Hoyos wrote:
> 
>> George L. P. Fitz <george <at> glpf.net> writes:
>>
>>> BEFORE:
>>> #define SWS_CS_ITU709         1
>>> #define SWS_CS_FCC            4
>>> #define SWS_CS_ITU601         5
>>> #define SWS_CS_ITU624         5
>>> #define SWS_CS_SMPTE170M      5
>>> #define SWS_CS_SMPTE240M      7
>>> #define SWS_CS_DEFAULT        5
>>>
>>> AFTER:
>>> #define SWS_CS_ITU709         1
>>> #define SWS_CS_FCC            4
>>> #define SWS_CS_ITU601         5
>>> #define SWS_CS_ITU624         5
>>> #define SWS_CS_SMPTE170M      5
>>> #define SWS_CS_SMPTE240M      7
>>> #define SWS_CS_DEFAULT        1
>>
>> Is your original problem only reproducible when encoding 
>> to prores or also if you encode with a yuv420p encoder?
>> (For example -vcodec mpeg4 -qscale 2)
>>
>> I wonder if the reason that changing the default has no 
>> effect is that it does not work for a 10bit colourspace.
> 
> I tried encoding to an 8 bit codec (mpeg4 as you suggested):
> 
> ffmpeg -f rawvideo -pix_fmt rgb24 -s 1920x1080 -r 23.976 -i c3yoz4vuuy.video.raw -vcodec mpeg4 -qscale 2 test_recompile.mp4
> 
> The resulting mpeg4 has the exact same color shift issue.  So it doesn't appear to be a 10bit vs 8bit issue.  So even though I changed SWS_CS_DEFAULT to be 1 and then recompiled, I can't tell where that has had any impact on this color shift issue whatsoever. 
> 
>

I have a vague recollection that there are a number of different
colourspace definitions.

you have:-
AVColorPrimaries
AVColorTransferCharacteristic
AVColorSpace

Which are all enum with the same valuer for each colourspace as well as
the SWS variants, so it may be you need to poke the code somewhere else
as well.



-- 
Tim




More information about the ffmpeg-user mailing list