2
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 :

1
  • I'm not seeing any significant difference, both look like the gamut is wrong. i.stack.imgur.com/d4Dgn.jpg Is your display calibrated to RGB or Rec709? Is your colour management set correctly? If you're aiming for YouTube, your video will be in 709, but on an sRGB display [which 99.9% of people will see it in, or a vague approximation of] you should compensate, YouTubers will always see the 'washed out' version, so you have to pre-empt it, or keep the entire workflow in sRGB.
    – Tetsujin
    Jul 28, 2022 at 7:55

1 Answer 1

1

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
2
  • That works very well! but the file size went upto 192+ MB for just 12 seconds of recording, is this normal? Any way to reduce the file size without compromosing smoothness in video + accurate colors?
    – siduck
    Jul 27, 2022 at 18:16
  • 1
    Of course it is normal, this is true lossless video. Jul 28, 2022 at 11:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.