user20530: I have a PNG file with white on red and no antialiasing at all - each pixel is either white or red, but when I encode it to MP4 using ffmpeg -i test.png  -profile:v high444 -pix_fmt yuv444p  -loop 1 -crf 0 -framerate 30 -c:v libx264 -t 15  test444.mp4 the output gets dark pixels added and the white color gets changed.  See zoomed in screenshot below for before and after.  I played the mp4 file with ffplay btw.

Original PNG below:


user1871: It's a rendering artifact, not an actual error.
See
ffplay test444.mp4 -vf scale=iw*16:-1:flags=neighbor

and
ffmpeg -i test444.mp4 roundtrip.png

You should see no black pixels.
Update: ffplay downsamples YUV inputs to 420 before final conversion to RGB.
[swscaler @ 0000000005a82800] bicubic scaler, from yuv444p to yuv420p using MMXEXT

You can avoid artifacts by directly calling pixel format filter.
ffplay test444.mp4 -vf format=bgra


20530: <p>I have a PNG file with white on red and no antialiasing at all - each pixel is either white or red, but when I encode it to MP4 using <code>ffmpeg -i test.png  -profile:v high444 -pix_fmt yuv444p  -loop 1 -crf 0 -framerate 30 -c:v libx264 -t 15  test444.mp4</code> the output gets dark pixels added and the white color gets changed.  See zoomed in screenshot below for before and after.  I played the mp4 file with <code>ffplay</code> btw.</p>

<p><a href="https://i.stack.imgur.com/NNqfk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NNqfk.png" alt="enter image description here"></a></p>

<p>Original PNG below:</p>

<p><a href="https://i.stack.imgur.com/byjNh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/byjNh.png" alt="enter image description here"></a></p>
 1871: <p>It's a rendering artifact, not an actual error.</p>

<p>See</p>

<pre><code>ffplay test444.mp4 -vf scale=iw*16:-1:flags=neighbor
</code></pre>

<p>and</p>

<pre><code>ffmpeg -i test444.mp4 roundtrip.png
</code></pre>

<p>You should see no black pixels.</p>

<p><strong>Update</strong>: ffplay downsamples YUV inputs to 420 before final conversion to RGB.</p>

<pre><code>[swscaler @ 0000000005a82800] bicubic scaler, from yuv444p to yuv420p using MMXEXT
</code></pre>

<p>You can avoid artifacts by directly calling pixel format filter.</p>

<pre><code>ffplay test444.mp4 -vf format=bgra
</code></pre>
