How to convert an mp4 file with YUV color space to RGB or sRGB color space using ffmpeg? I am trying to upload my video to YouTube and I read somewhere that RGB video looks better than YUV one.


  • Might be worth mentioning that recompressing your video using a lossy codec cannot possibly improve its quality. If you have a lossless master then you could convert from that.
    – stib
    Aug 23, 2020 at 10:50

1 Answer 1

ffmpeg -y -i output.mp4 -c:v libx264rgb output_264.mp4
Output #0, mp4, to 'output_264.mp4':
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    encoder         : Lavf57.83.100
    Stream #0:0(und): Video: h264 (libx264rgb) (avc1 / 0x31637661), rgb24(progressive), 636x360 [SAR 1:1 DAR 53:30], q=-1--1, 27.05 fps, 13524 tbn, 27.05 tbc (default)
      handler_name    : VideoHandler
      encoder         : Lavc57.107.100 libx264rgb
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 69 kb/s (default)
      creation_time   : 2018-02-04T15:39:08.000000Z
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
      encoder         : Lavc57.107.100 aac
ffprobe output_264.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output_264.mp4':
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:07:50.02, start: 0.000000, bitrate: 1006 kb/s
    Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), gbrp(tv, gbr/unknown/unknown), 636x360 [SAR 1:1 DAR 53:30], 928 kb/s, 27.05 fps, 27.05 tbr, 13524 tbn, 54.10 tbc (default)
      handler_name    : VideoHandler

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.