user38939: ffmpeg -f x11grab -framerate 60 -probesize 42M -i $DISPLAY -preset ultrafast -pix_fmt yuv420p  vid.mp4

I use this currently and the video recording is smooth but colors are not accurate, they are dimmed. If I remove yuv420p pix_fmt then ffmpeg will use yuv444p (which is default right) , then the colors look accurate but the output video is laggy :/
How do I get smooth video output + accurate colors? Been trying to fix this since yesterday, help!
Check these :
yuv420p : 


yuv444p : 



user26140: As wiki of ffmpeg recommends
ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i :0.0 -c:v libx264rgb -crf 0 -preset ultrafast -color_range 2 output.mkv

This will give you lossless output but also lossless RGB, the same format used in the operating system.
https://trac.ffmpeg.org/wiki/Capture/Desktop
Edit :  this worked
ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i $DISPLAY -c:v libx264rgb -crf 0 -preset ultrafast -color_range 2 output.mkv


38939: <pre><code>ffmpeg -f x11grab -framerate 60 -probesize 42M -i $DISPLAY -preset ultrafast -pix_fmt yuv420p  vid.mp4
</code></pre>
<p>I use this currently and the video recording is smooth but colors are not accurate, they are dimmed. If I remove yuv420p pix_fmt then ffmpeg will use yuv444p (which is default right) , then the colors look accurate but the output video is laggy :/</p>
<p>How do I get smooth video output + accurate colors? Been trying to fix this since yesterday, help!</p>
<p>Check these :</p>
<p>yuv420p : <div class="youtube-embed"><div>
                <iframe width="640px" height="395px" src="https://www.youtube.com/embed/GUeP-TNPa3E?start=0"></iframe>
            </div></div></p>
<p>yuv444p : <div class="youtube-embed"><div>
                <iframe width="640px" height="395px" src="https://www.youtube.com/embed/S17dYMGJ0As?start=0"></iframe>
            </div></div></p>
 26140: <p>As wiki of ffmpeg recommends</p>
<pre><code>ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i :0.0 -c:v libx264rgb -crf 0 -preset ultrafast -color_range 2 output.mkv
</code></pre>
<p>This will give you lossless output but also lossless RGB, the same format used in the operating system.</p>
<p><a href="https://trac.ffmpeg.org/wiki/Capture/Desktop" rel="nofollow noreferrer">https://trac.ffmpeg.org/wiki/Capture/Desktop</a></p>
<p>Edit :  this worked</p>
<pre><code>ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i $DISPLAY -c:v libx264rgb -crf 0 -preset ultrafast -color_range 2 output.mkv
</code></pre>
