[FFmpeg-user] Text and icons in video appears blurry after converting from rgb to yuv420p
Pavel Koshevoy
pkoshevoy at gmail.com
Fri Jun 22 00:10:12 EEST 2018
On Thu, Jun 21, 2018 at 2:26 PM Bolik Bom <bolikbom at mail.com> wrote:
>
> Hello everyone,
>
> I have recorded my screen with some recording software, and encoded the video as lossless h.264, rgb.
>
> I've saved the file as "source_lossless_rgb.mp4", and then lossy encoded it:
> ffmpeg -i source_lossless_rgb.mp4 -c:v libx264rgb rgb.mp4
>
> And I've created another lossy version, in yuv420p format:
> ffmpeg -i source_lossless_rgb.mp4 -c:v libx264 -pix_fmt yuv420p yuv420p.mp4
>
> When playing the two videos using Media Player Classic / VLC,
> text and icons in the yuv420 video are a little blurry.
> Is it possible to create an exact translation from rgb to yuv420,
> so no blur will be introduced?
YUV 4:2:0 will downsample the chroma channel by a factor of two (for
every 2x2 luma samples there is only one U and one V sample).
YUV 4:2:2 downsamples chroma by a factor of 2, but only horizontally
(2x1 luma samples, one U, one V samples)
YUV 4:4:4 does not downsample chroma at all, so this is more
appropriate for screen capture
If you still have to use 4:2:0 sampling then you can work around the
downsampling by upscaling the video by a factor of 2 horizontally and
vertically before encoding, then there will be no chroma loss due to
chroma downsampling
Pavel.
More information about the ffmpeg-user
mailing list