Blender video editor, when saving in any format with compression, changes the colors of the original video very much. #103422

Closed
opened 2022-12-22 23:41:11 +01:00 by Konstantin · 19 comments

System Information
Operating system: Arch Linux
Graphics card: 3070 Ti

Blender video editor, when saving in any format with compression, changes the colors of the original video very much.

I attach the image: "before" at the top, "after" at the bottom.

2022-12-23_01-26-44.png

Exact steps for others to reproduce the error
Add any video −> Render −> Render Animation.

P.S. If you save one picture, not video, the colors are not distorted.

**System Information** Operating system: Arch Linux Graphics card: 3070 Ti Blender video editor, when saving in any format with compression, changes the colors of the original video very much. I attach the image: "before" at the top, "after" at the bottom. ![2022-12-23_01-26-44.png](https://archive.blender.org/developer/F14084496/2022-12-23_01-26-44.png) **Exact steps for others to reproduce the error** Add any video −> Render −> Render Animation. P.S. If you save one picture, not video, the colors are not distorted.
Author

Added subscriber: @imlegr

Added subscriber: @imlegr

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'

What are these formats with compression?
The colors don't seem to have changed that much in my opinion.
Could it be that this is more a matter of output quality rather than compression?

I have not been able to replicate the problem.
VSE_format_compression_colors__bug.blend

What are these formats with compression? The colors don't seem to have changed that much in my opinion. Could it be that this is more a matter of output quality rather than compression? I have not been able to replicate the problem. [VSE_format_compression_colors__bug.blend](https://archive.blender.org/developer/F14084789/VSE_format_compression_colors__bug.blend)
Author

The colors change noticeably. All of them. I've been doing graphics for years and most clients simply refuse to accept work if there are changes they haven't asked for.

The picture becomes less contrasty. Try rendering the animation in this file and see what happens in the output. Exactly the video itself.

Test.blend

2022-12-23_04-23-36.png

The colors change noticeably. All of them. I've been doing graphics for years and most clients simply refuse to accept work if there are changes they haven't asked for. The picture becomes less contrasty. Try rendering the animation in this file and see what happens in the output. Exactly the video itself. [Test.blend](https://archive.blender.org/developer/F14084800/Test.blend) ![2022-12-23_04-23-36.png](https://archive.blender.org/developer/F14084807/2022-12-23_04-23-36.png)

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'
Author

What details do you need? I sent you the file.

What details do you need? I sent you the file.
Member

Added subscriber: @EAW

Added subscriber: @EAW
Member

Possibly a duplicate of #60947 (FFMpeg color offset)

Possibly a duplicate of #60947 (FFMpeg color offset)
Author

In #103422#1465232, @EAW wrote:
Possibly a duplicate of #60947 (FFMpeg color offset)

No. I think this is another error. If you look in the render window (F11) - everything is displayed there correctly. But after saving it already appears a strong distortion of colors.

There are 2 images in the archive. Open them in any editor and compare.

pic.zip

> In #103422#1465232, @EAW wrote: > Possibly a duplicate of #60947 (FFMpeg color offset) No. I think this is another error. If you look in the render window (F11) - everything is displayed there correctly. But after saving it already appears a strong distortion of colors. There are 2 images in the archive. Open them in any editor and compare. [pic.zip](https://archive.blender.org/developer/F14087092/pic.zip)

Added subscriber: @James-Glover

Added subscriber: @James-Glover

This comment was removed by @James-Glover

*This comment was removed by @James-Glover*

Added subscriber: @iss

Added subscriber: @iss

@imlegr I have rendered video from image you have provided and there is no such color offset. Can you check if this happens when you use video as input and not image? If so can you upload short video that I can use for testing?

@imlegr I have rendered video from image you have provided and there is no such color offset. Can you check if this happens when you use video as input and not image? If so can you upload short video that I can use for testing?

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Author

In #103422#1469026, @iss wrote:
@imlegr I have rendered video from image you have provided and there is no such color offset. Can you check if this happens when you use video as input and not image? If so can you upload short video that I can use for testing?

There are no distortions in the render window, they are when saving. The file I sent you has video.

> In #103422#1469026, @iss wrote: > @imlegr I have rendered video from image you have provided and there is no such color offset. Can you check if this happens when you use video as input and not image? If so can you upload short video that I can use for testing? There are no distortions in the render window, they are when saving. The file I sent you has video.

Ah thanks, did not notice packed video...
On surface this seems to be same issue as #60947. It is important to check result in other player, like VLC.

Input video is encoded in yuv420p(tv, bt709), but sequencer can only work in RGB. At this stage colors are fairly preserved (in preview). Then image has to be converted to YUV again, but here we don't specify any encoding.

I don't quite understand why when same rendered output is viewed in Blender vs ffplay for example, the image is different, since whole encoding/decoding pipeline is pretty much default.


Blender decoding source:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\John\Desktop\work\cut.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf59.27.100
  Duration: 00:00:10.10, start: 0.000000, bitrate: 19376 kb/s
  Stream #0:0[0x1](und), 1, 1/15360: Video: hevc (Main), 1 reference frame (hev1 / 0x31766568), yuv420p(tv, bt709, left), 2560x1440 [SAR 1:1 DAR 16:9], 0/1, 23844 kb/s, 60 fps, 60 tbr, 15360 tbn (default)

[swscaler @ 000002ca37edd040] bilinear scaler, from yuv420p to rgba using MMXEXT
[swscaler @ 000002ca37edd040] 2560x1440 -> 2560x1440
[swscaler @ 000002ca37edd040] lum srcW=2560 srcH=1440 dstW=2560 dstH=1440 xInc=65536 yInc=65536
[swscaler @ 000002ca37edd040] chr srcW=1280 srcH=720 dstW=2560 dstH=1440 xInc=32768 yInc=32768
[swscaler @ 000002ca37edd040] using unscaled yuv420p -> rgba special converter

Blender decoding render:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\John\Desktop\0001-0050.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    date            : 2023/01/05 07:28:12
    encoder         : Lavf59.27.100
  Duration: 00:00:00.85, start: 0.000000, bitrate: 20246 kb/s
  Stream #0:0[0x1](und), 1, 1/15360: Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(progressive, left), 2560x1440 [SAR 1:1 DAR 16:9], 0/1, 20477 kb/s, 60 fps, 60 tbr, 15360 tbn (default)

[swscaler @ 000002ca31d9ef40] bilinear scaler, from yuv420p to rgba using MMXEXT
[swscaler @ 000002ca31d9ef40] 2560x1440 -> 2560x1440
[swscaler @ 000002ca31d9ef40] lum srcW=2560 srcH=1440 dstW=2560 dstH=1440 xInc=65536 yInc=65536
[swscaler @ 000002ca31d9ef40] chr srcW=1280 srcH=720 dstW=2560 dstH=1440 xInc=32768 yInc=32768
[swscaler @ 000002ca31d9ef40] using unscaled yuv420p -> rgba special converter

All these cases have in common, that incorrect colorspace is assumed during encoding, even if colorspace is specified (not reflected by ffprobe so this may be done incorrectly). But not sure where this incorrect conversion happens exactly.

Ah thanks, did not notice packed video... On surface this seems to be same issue as #60947. It is important to check result in other player, like VLC. Input video is encoded in yuv420p(tv, bt709), but sequencer can only work in RGB. At this stage colors are fairly preserved (in preview). Then image has to be converted to YUV again, but here we don't specify any encoding. I don't quite understand why when same rendered output is viewed in Blender vs ffplay for example, the image is different, since whole encoding/decoding pipeline is pretty much default. ---- Blender decoding source: ``` Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\John\Desktop\work\cut.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf59.27.100 Duration: 00:00:10.10, start: 0.000000, bitrate: 19376 kb/s Stream #0:0[0x1](und), 1, 1/15360: Video: hevc (Main), 1 reference frame (hev1 / 0x31766568), yuv420p(tv, bt709, left), 2560x1440 [SAR 1:1 DAR 16:9], 0/1, 23844 kb/s, 60 fps, 60 tbr, 15360 tbn (default) [swscaler @ 000002ca37edd040] bilinear scaler, from yuv420p to rgba using MMXEXT [swscaler @ 000002ca37edd040] 2560x1440 -> 2560x1440 [swscaler @ 000002ca37edd040] lum srcW=2560 srcH=1440 dstW=2560 dstH=1440 xInc=65536 yInc=65536 [swscaler @ 000002ca37edd040] chr srcW=1280 srcH=720 dstW=2560 dstH=1440 xInc=32768 yInc=32768 [swscaler @ 000002ca37edd040] using unscaled yuv420p -> rgba special converter ``` Blender decoding render: ``` Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\John\Desktop\0001-0050.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 date : 2023/01/05 07:28:12 encoder : Lavf59.27.100 Duration: 00:00:00.85, start: 0.000000, bitrate: 20246 kb/s Stream #0:0[0x1](und), 1, 1/15360: Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(progressive, left), 2560x1440 [SAR 1:1 DAR 16:9], 0/1, 20477 kb/s, 60 fps, 60 tbr, 15360 tbn (default) [swscaler @ 000002ca31d9ef40] bilinear scaler, from yuv420p to rgba using MMXEXT [swscaler @ 000002ca31d9ef40] 2560x1440 -> 2560x1440 [swscaler @ 000002ca31d9ef40] lum srcW=2560 srcH=1440 dstW=2560 dstH=1440 xInc=65536 yInc=65536 [swscaler @ 000002ca31d9ef40] chr srcW=1280 srcH=720 dstW=2560 dstH=1440 xInc=32768 yInc=32768 [swscaler @ 000002ca31d9ef40] using unscaled yuv420p -> rgba special converter ``` All these cases have in common, that incorrect colorspace is assumed during encoding, even if colorspace is specified (not reflected by ffprobe so this may be done incorrectly). But not sure where this incorrect conversion happens exactly.

@iss What is the status here? So is that actually a confirmed report or a duplicate of #60947? Please update the status accordingly.

@iss What is the status here? So is that actually a confirmed report or a duplicate of #60947? Please update the status accordingly.

It is duplicate, I wanted to do bit deeper dive as I do think there is something incorrect going on there, but haven't got time yet.

Closing as duplicate of #60947.

It is duplicate, I wanted to do bit deeper dive as I do think there is something incorrect going on there, but haven't got time yet. Closing as duplicate of #60947.
Blender Bot added
Status
Archived
and removed
Status
Needs Information from User
labels 2023-05-13 01:18:50 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#103422
No description provided.