<p>Without knowing the video properties, my generic answer is</p>

<pre><code>ffmpeg -i in.mp4 -vf geq=lum='p(X,Y)':cb=128:cr=128 out.mp4
</code></pre>

<p>This will reset the color information, but pass the luma plane intact. Add <code>-crf 0</code> for truly lossless re-encoding.</p>

<hr>

<p>This is the faster way,</p>

<pre><code>ffmpeg -i in.mp4 -vf extractplanes=y,format=yuv420p out.mp4
</code></pre>

<p>The luma plane is extracted, and then neutral chroma planes are added in the pixel format conversion. This 2nd step is added because otherwise ffmpeg will auto-convert pixel format to yuv444 which isn't widely compatible.</p>

CC BY-SA 3.0
2018-03-18T00:37:14.683Z
Awesome, that works. Is this the quickest way? If not, what information would need to know for a faster/better solution?
Stefan Popp
CC BY-SA 3.0
2018-03-18T08:18:02.480Z
There's one potentially quicker way but I have to check whether it alters the luma.
Gyan
CC BY-SA 3.0
2018-03-16T19:00:51.413Z
2018-03-19T12:57:51.923Z
2018-03-19T12:57:51.923Z
Gyan
<p>I need to reduce the file size of an mp4 video. I don't need color information at all but pixel brightness resolution must be preserved. Videos consist of white background with a few (important) black dots of about 5px diameter. I am confused about what the best method/output would be.</p>

<ffmpeg><codec><file-formats><colorspace>
Lossless color compression
Stefan Popp
# Lossless color compression

(Asked by: username_0 on 2018-03-16)

I need to reduce the file size of an mp4 video. I don't need color information at all but pixel brightness resolution must be preserved. Videos consist of white background with a few (important) black dots of about 5px diameter. I am confused about what the best method/output would be.

**Tags:** ffmpeg, codec, file-formats, colorspace


---

## 1 answers

### Answer by username_1 on 2018-03-16. Score: 3 | Accepted answer

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 0 for truly lossless re-encoding.

This is the faster way,
ffmpeg -i in.mp4 -vf extractplanes=y,format=yuv420p out.mp4

The luma plane is extracted, and then neutral chroma planes are added in the pixel format conversion. This 2nd step is added because otherwise ffmpeg will auto-convert pixel format to yuv444 which isn't widely compatible.

> **Comments:**
> **username_0**: Awesome, that works. Is this the quickest way? If not, what information would need to know for a faster/better solution?  
> **username_1**: There's one potentially quicker way but I have to check whether it alters the luma.  

---

