Color change on export, probably a codec issue

Hello, I am a long time user and fan! My latest project involves doing animation in Krita, exporting it to mp4, then piecing these files together in Shotcut. The files look great while editing, but the colors change dramatically on export. Surely this is a codec issue. First, the basics…

My system:
Release Linux Mint 19.1 Tessa 64-bit, MATE 1.20.1
Kernel Linux 4.15.0-99-generic x86_64
RAM: 6.8 GiB
Processor: AMD PRO A6-9500E R5, 6 COMPUTE CORES 2C+4G × 2

About Shotcut
Shotcut 20.04.12
Mode: Automatic
Display: OpenGL
Automatic settings for export, no hardware acceleration.

More about Krita
I don’t think it matter much, but the animation is done in HSY colorspace. Krita uses FFMPEG to make mp4 files and the process is a little opaque. I don’t know how to adjust it (or even know if I can). I used the tool mediainfo to generate the following report of a source file:

Complete name                            : 000.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 259 KiB
Duration                                 : 5 s 875 ms
Overall bit rate                         : 361 kb/s
Writing application                      : Lavf57.83.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Baseline@L3.1
Format settings                          : 3 Ref Frames
Format settings, CABAC                   : No
Format settings, ReFrames                : 3 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 5 s 875 ms
Bit rate                                 : 360 kb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 24.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.016
Stream size                              : 258 KiB (99%)
Writing library                          : x264 core 152 r2854 e9a5903
Encoding settings                        : cabac=0 / ref=3 / deblock=1:0:0 / 
analyse=0x1:0x111 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 /
mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / 
deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / 
lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / 
bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=250 / 
keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / 
mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / 
ip_ratio=1.40 / aq=1:1.00

EDIT: I just found ffprobe output in the Properties sub-menu:

# ffprobe output

[streams.stream.0]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=Constrained Baseline
codec_type=video
codec_time_base=1/48
codec_tag_string=avc1
codec_tag=0x31637661
width=1280
height=720
coded_width=1280
coded_height=720
has_b_frames=0
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
level=31
color_range=unknown
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=left
field_order=unknown
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=24/1
avg_frame_rate=24/1
time_base=1/12288
start_pts=0
start_time=0:00:00.000000
duration_ts=72192
duration=0:00:05.875000
bit_rate=359.539000 Kbit/s
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=141
nb_read_frames=N/A
nb_read_packets=N/A

[streams.stream.0.disposition]
default=1
dub=0
original=0
comment=0
lyrics=0
karaoke=0
forced=0
hearing_impaired=0
visual_impaired=0
clean_effects=0
attached_pic=0
timed_thumbnails=0

[streams.stream.0.tags]
language=und
handler_name=VideoHandler
    
[format]
filename=/home/USER/Desktop/then yesterday/render/000.mp4
nb_streams=1
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=0:00:00.000000
duration=0:00:05.875000
size=259.213867 Kibyte
bit_rate=361.443000 Kbit/s
probe_score=100

[format.tags]
major_brand=isom
minor_version=512
compatible_brands=isomiso2avc1mp41
encoder=Lavf57.83.100
Completed successfully in 00:00:00

I tried several different export settings but none of them worked. In the screenshot below, the right side is the desired output and the left side is what was rendered.

I regret I do not know more about video codec to solve this problem myself. I will be extremely grateful for help since I’ve been working on this project for six months and this is the final step!

then-yesterday-2.mlt (69.0 KB)

I do not think the codec will make that large of a difference as you show. You are showing the result as a PNG. Why? Is that how you exported it? How does it look when you view the export in Shotcut?
If still a problem do this to establish some baseline:

  1. Open the video Krita created in a new project
  2. Put it on the timeline and trim it down to only about 10 seconds to make less work
  3. Export > Export File (use all defaults)
  4. When done, double-click the export job to open the export result in Shotcut

How does it look now?

EDIT: The problem was VLC. The export is fine. I am a dummy, you are so nice and patient.

Thanks for continuing to work on the best consumer level video editor there is!

1 Like

VLC is not that great.
It has some serious bugs.
I too have noticed that it does not always display the correct colours with some videos.

Other problems:

Although it says it can play certain codecs, sometimes there is video only, others audio only.
To a large extent, it depends on OS.

On XDCAMHD with pcm audio and a OP1a MXF, it has massive amounts of crackling noises on the audio, even though the video is smooth, could also be on other codecs and wrappers.

Never trust VLC alone, personally, I think it’s been going downhill with each new version.
There are much better players available like Xplayer, SMplayer (windows only I think) and
even ffplay, although not available on all OS’es.

Of course, there is always Shotcut, it makes for a good player as well.
It just sometimes struggles with webm, but it could be that I’m not running the very latest
version.

Shotcut includes/installs ffmpeg, ffprobe, and ffplay command line utilities for your convenience.

That’s good news, thank you @shotcut

This topic was automatically closed after 90 days. New replies are no longer allowed.