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
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
  • 33.1k
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
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,504
4 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
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
  • 33.1k
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

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
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
  • 33.1k
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
  • 33.1k
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.4k
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,504
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
1 vote

Is smpte170m Color Space Compatible with 10 bit yuv420p10le? Color Space choice(x265)

Is smpte170m space even compatible with 10 bit such as yuv420p10le? There's no incompatibility - H.265 supports BT601-525 / SMPTE170m tagging. It depends on your player if colours are rendered ...
Gyan's user avatar
  • 33.1k
1 vote

How to fix a presumably HDR video file that displays super washed out in all video players?

Was the footage straight from a camera, or is it an edited, finished video? If it's from a camera, it may have been shot using a gamma curve, such as Slog3. This is where the image is recorded ...
tomh's user avatar
  • 7,757
1 vote

Using ffmpeg gdigrab to capture desktop output to h264 yuv420p. Color shift problem

You cannot go from BGR to YUV420p without having a shift in colors, a bug with a known workaround (accurate_rnd). https://trac.ffmpeg.org/ticket/979 You also did not tag the output. ffmpeg -f gdigrab -...
Валерий Заподовников's user avatar
1 vote

Confusion about Floating Point in Color Space Transforms

Linear vs log(arithmic) are shapes of curves. Floating point and integer are data types, I.e., different approaches to storing numbers on silicon. 32bit vs 16bit is bit depth, or how precise a number ...
Jason Conrad's user avatar
  • 4,504
1 vote
Accepted

Resolution loss by chromatic subsampling: is there a workaround?

No. Almost all video on the planet is limited YUV420 (all Blu-rays, even HEVC ones with Dolby Vision, all Youtube, only some satellite FEEDs not for consumers use 4:2:2). Sorry. Of course, there is ...
Валерий Заподовников's user avatar
1 vote

How can I know my if footage is rec.709 or not right out of the camera?

Knowing the details about what format your camera recorded is often as simple as consulting the manual. However, some cameras shoot multiple formats, and often, editors are given footage from unknown ...
Jason Conrad's user avatar
  • 4,504
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
  • 33.1k
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
  • 33.1k
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
  • 33.1k
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,564
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
  • 33.1k
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

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