[FFmpeg-user] Grayscale x264 convertion

Roger Pack rogerdpack2 at gmail.com
Sun Aug 5 05:13:04 CEST 2012


On Fri, Aug 3, 2012 at 12:25 PM, James Darnley <james.darnley at gmail.com> wrote:
> On 2012-08-03 12:57, Andrew Gora wrote:
>> Would someone advice how to convert video to grayscale?
>>
>> For example, -pix_fmt gray returns:
>> Incompatible pixel format 'gray' for codec 'libx264', auto-selecting format 'yuvj420p'
>>
>> -pix_fmt gray16be returns:
>> Incompatible pixel format 'gray16be' for codec 'libx264', auto-selecting format 'yuv444p'
>> x264 [error]: high profile doesn't support 4:4:4
>
> x264 does not have a dedicated mode for encoding a single greyscale
> plane because I recall it was said to be not any more efficient than
> empty chroma planes.  So with greyscale input, any colour space (pixel
> format) will be greyscale.
>
> If you want to force a colour video to become greyscale, I don't know
> how you would do that using ffmpeg.

Maybe convert it to "gray" then to yuv444p or whatever works well there.

 -vf format=gray,format=yuv422p


More information about the ffmpeg-user mailing list