15 votes
Accepted

ffmpeg: explicitly tag h.264 as bt.601, rather than leaving unspecified?

PAL and NTSC have different color primaries, so NTSC = SMPTE 170M = BT 601 525 PAL = BT 470 BG = BT 601 625 See the rows for value 5 & 6 on the table on page 387 of the active H.264 standard. ...
Gyan's user avatar
  • 32.3k
9 votes
Accepted

Apply custom lut via ffmpeg?

You may want to use FFMPEG's lut3d filter. It requires you to provide a look-up table (a *.cube file). For example, if you have an ARRI camera you can generate these files using ARRI Color Tool or ...
Tony Sepia's user avatar
9 votes
Accepted

ffmpeg pixel format definitions

If your question was Where are these pixel formats defined? Go to http://ffmpeg.org/download.html and download the source of ffmpeg. Then unpack it tar -xavf FILENAME.tar.* and descend to the ...
erik's user avatar
  • 216
5 votes

What is the colour range of most videos?

Most videos are limited range i.e. luma goes from 16 to 235, and chroma from 16 to 240. Unless expressly set, FFmpeg does not scale the range from one to another. Whatever the source is, that's the ...
Gyan's user avatar
  • 32.3k
4 votes
Accepted

Do any iOS video apps record in log color space?

This announcement article dated January 11, 2017 indicates that there will be an upgrade to the app FiLMiC Pro which may accommodate what you are looking for. Note that the FiLMic Pro App Store web ...
MmmHmm's user avatar
  • 397
4 votes
Accepted

Is it safe to use the yuva420 pix_format option with ffmpeg to encode webm videos?

YUV color encoding with 4:2:0 chroma subsampling is the only widely safe pixel format for web playback, although for certain codecs, other pixel formats may be supported. FFmpeg auto-selects the ...
Gyan's user avatar
  • 32.3k
4 votes
Accepted

Why are there so many color spaces available?

There are a number of reasons why there are so many color spaces: Color resolution - sRGB and similar color spaces only cover a portion of the visible spectrum. This means that they can be ...
user1118321's user avatar
  • 2,156
4 votes
Accepted

How can I find out which chroma subsampling (if any) is used in a video file?

Mediainfo is a free, open source, cross-platform solution, available in 37 languages. https://en.m.wikipedia.org/wiki/MediaInfo When run from the command line it outputs chrome subsampling info by ...
Jason Conrad's user avatar
  • 4,414
4 votes

How can I find out which chroma subsampling (if any) is used in a video file?

Using the ffprobe command (part of FFmpeg, also a command line tool) ffprobe -show_entries stream=pix_fmt <VIDEO FILE> The output will look like this: ... [STREAM] pix_fmt=yuv420p [/STREAM] [...
Duvrai's user avatar
  • 803
3 votes
Accepted

What exactly is D-Cinelike?

“Is D-Cinelike just a flatter colour profile with less contrast (to capture more detail in shadows and highlights)?” Yes. It's closer to log color rather than linear. The big thing to be aware of ...
AJ Henderson's user avatar
  • 19.3k
3 votes
Accepted

Correct gamma for SMPTE ST-2084 EOTF

The short answer is: You don't pick a color space for your RAW material based on what kind of monitor you're using. A color pipeline is a very complicated series of mathematical conversions, which is ...
Jason Conrad's user avatar
  • 4,414
3 votes
Accepted

Is video output in YUY2 color space lossless if the input is sRGB?

It's a bit of a semantics game. The YUY2 video mode is not "compressed," but it won't result in a bit-exact copy of RGB input. The luminance is full resolution in that mode, but the ...
wrosecrans's user avatar
3 votes

How to preserve colorspace in ffmpeg

This command preserved the colorspace and also video didnt get darker after transcoding ffmpeg -i input.mp4 -color_primaries smpte170m -color_trc smpte170m -colorspace smpte170m -r 25 -crf 18 output....
mustafa candan's user avatar
3 votes
Accepted

Lossless color compression

Without knowing the video properties, my generic answer is ffmpeg -i in.mp4 -vf geq=lum='p(X,Y)':cb=128:cr=128 out.mp4 This will reset the color information, but pass the luma plane intact. Add -crf ...
Gyan's user avatar
  • 32.3k
3 votes
Accepted

FFmpeg BMP to YUV x264 color shift

Apparently FFmpeg doesn't set input color attributes correctly for BMP input (probably because the file doesn't contain that metadata) and the BMP decoder doesn't check for manually flagged attributes....
Gyan's user avatar
  • 32.3k
3 votes
Accepted

ffmpeg bgr vs rgb and other similiar pixel formats

The order of the components in RGB32 seems to do with endianness: PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA color is put together as: (A << 24) | (R << 16) | (G &...
Gyan's user avatar
  • 32.3k
3 votes

ffmpeg bgr vs rgb and other similiar pixel formats

While I always guessed that the big / little endian was more a matter of patents rather than performance, Nope little endian was developed as a performance optimization whern moving to multi byte ...
SlimSCSI's user avatar
  • 1,060
2 votes
Accepted

Record raw video with ffmpeg keeping the full color range

In this case, the problem didn't come from ffmpeg/avconv. The rawvideo source I use offers different color formats to be used: argb32 rgb24 bgr24 yuv444 yuv420 [...] When I extract a png file (...
Nippey's user avatar
  • 151
1 vote

How to manage colour in After Effects to get precisely a desired colour in h264 output

Since I cannot use hyperlinks in comments, here is the gist of my research: This answer on a reddit post suggests, that the reason for the color-shift is the way illegal and legal colors are handled. ...
Florian Claaßen's user avatar
1 vote

Which color space to use in camera while shooting video? RGB or YCbCr?

The question is impossible to answer in a general way. If a camera offers to record in RGB, it is likely using a completely different codec that could be better or worse. Very few cameras will ...
wrosecrans's user avatar
1 vote

"Canon RGB" color space *shift* to broadcast range with FFMPEG

You can use the geq filter to remap the pixel value ranges. ffmpeg -i input -vf "geq=lum='(p(X,Y)-16)/(255-16)*(235-16)+16':cb='(p(X,Y)-16)/(255-16)*(240-16)+16'" -c:v libx264 -c:a copy out.mp4 ...
Gyan's user avatar
  • 32.3k
1 vote
Accepted

ffmpeg prores alpha channel not present when colormatrix and colorspace operations are performed

The colorspace and colormatrix filters don't handle alpha pixel formats, so those get stripped off. The workaround is to extract the alpha and then reattach it. ffmpeg -f image2 -framerate 24.0 -i ...
Gyan's user avatar
  • 32.3k
1 vote
Accepted

ffmpeg colormatrix operations only for 8bpc?

Yes, as it says a couple of lines above, colormatrix supports only 8bpc (8-bit per component) pixel formats. So, when a 16-bit input is filtered with colormatrix, it will be converted to 8-bits. And ...
Gyan's user avatar
  • 32.3k
1 vote
Accepted

What is the file size difference between 8 bit and 10 bit raw video?

Instead of 8 bits per every channel and per every pixel you need 10 bits, which is 25 % increase of the raw footage. Since the size of 8-bit raw footage is as such huge enough, 25 % of it is high ...
MarianD's user avatar
  • 1,494
1 vote

Color shift FFmpeg raw RGBA images to YUV format

In the end I add to use the following options and tell ffmpeg wich colorSpace i am using and how to decode it to display on screen. ffmpeg -f rawvideo -r 30 -pix_fmt rgba -s 1920x1017 -i - -threads 0 ...
Paltoquet's user avatar
  • 143
1 vote
Accepted

Doubts about color spaces and chroma subsampling

Are YUV and YCbCr the same thing? → strictly, no. The former is applied to analog signals, and the latter to digital. But media apps (like Mediainfo) use YUV as the designated term. It doesn't make ...
Gyan's user avatar
  • 32.3k
1 vote

Colors look different after export

I have this issue forever...found a solution thanks to this website https://isaac-molina.com/downloads/ download his luts aplly the correct lut to an adjustment layer placed on top of you project (in ...
Algoet Stijn's user avatar
1 vote

Colors look different after export

You may need to perform a “trim pass” to export to Rec709 colour space. See: https://images.apple.com/final-cut-pro/docs/Wide_Color_Gamut.pdf Matching colors in Rec. 2020 and Rec. 709 masters When ...
SaltySub2's user avatar
  • 151

Only top scored, non community-wiki answers of a minimum length are eligible