B&W Black & White Graysale AVI video shows as green instead of gray

Server Version#: 1.32.5.7328
Player Version#: 1.32.5.7328 / Unknown (Latest ROKU)
When playing video encoded as grayscale / black & white AVI, it displays as green or yellow, and too brightly, on my ROKU 3, and on my Plex Media Server on Linux (Ubuntu 22.04 w/AMD graphics)
If I use VLC to play the same content, it correctly displays as grayscale and at the correct brightness level.

This is what it looks like in Plex.

Screenshot_20230728_235851

This is what it looks like in VLC and TOTEM

@Heebie

Go into Transcoder Settings – Turn off HDR when you’re using AMD
(it’s SDR only right now)

I just tried that, and it made no difference. :frowning:

I’ve determined that this seems to be just about any .AVI media, not just black & white files.

I will test

The issue is with the AMD HW transcoding.
(Don’t forget this is the initial release please)

I can confirm Intel and Nvidia are ok;



Continuing to test other container types

Confirmed the issue seems to be the AVI container decoding.

It’s easy to work around this if you wish:

  1. mkvmerge -o filename.mkv filename.avi
  2. Place the mkv file where the avi file is
  3. Move the AVI.

A new file made by mkvmerge as above did not make a difference, it still displayed as green, sadly. :frowning: Perhaps that works with color files, but not with B&W.

I found it. The XVID codec is the problem. (this happens with these older encodings)

  1. XVID support is being dropped in many products due to age & standardization
  2. The transcode is forced. The XVID decode codec fails to map the B&W color space spec to H264 correct.y.
  3. We get ‘green’.

Solution

  1. Retire the XVID .

  2. Encode to H264 – Black & white preserved as it should be on AMD

[chuck@lizum Season 1930.2027]$ ffmpeg -i *S1930E02* -c:v h264 -b:v 1536k -c:a copy "Loony Tunes - S1930E07 - RE-ENCODED to H264 E02.mkv"
ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, matroska,webm, from 'Looney Tunes - S1930E02 - Congo Jazz.avi':
  Metadata:
    title           : 
    encoder         : libebml v1.3.4 + libmatroska v1.4.5
    creation_time   : 2021-06-21T20:56:53.000000Z
  Duration: 00:06:20.97, start: 0.007000, bitrate: 1493 kb/s
    Stream #0:0(eng): Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 624x448 [SAR 1:1 DAR 39:28], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
    Stream #0:1(eng): Audio: ac3, 48000 Hz, mono, fltp, 192 kb/s (default)
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[libx264 @ 0x5640041c2a40] using SAR=1/1
[libx264 @ 0x5640041c2a40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x5640041c2a40] profile High, level 3.0
[libx264 @ 0x5640041c2a40] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=1536 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, matroska, to 'Loony Tunes - S1930E07 - RE-ENCODED to H264 E02.mkv':
  Metadata:
    title           : 
    encoder         : Lavf58.29.100
    Stream #0:0(eng): Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 624x448 [SAR 1:1 DAR 39:28], q=-1--1, 1536 kb/s, 23.98 fps, 1k tbn, 23.98 tbc (default)
    Metadata:
      encoder         : Lavc58.54.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/1536000 buffer size: 0 vbv_delay: -1
    Stream #0:1(eng): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, mono, fltp, 192 kb/s (default)
frame= 9134 fps=221 q=-1.0 Lsize=   81587kB time=00:06:20.89 bitrate=1754.7kbits/s speed=9.22x    
video:72511kB audio:8928kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.182034%
[libx264 @ 0x5640041c2a40] frame I:59    Avg QP:18.58  size: 25540
[libx264 @ 0x5640041c2a40] frame P:3490  Avg QP:21.05  size: 12212
[libx264 @ 0x5640041c2a40] frame B:5585  Avg QP:25.23  size:  5394
[libx264 @ 0x5640041c2a40] consecutive B-frames:  1.5% 49.8%  3.2% 45.5%
[libx264 @ 0x5640041c2a40] mb I  I16..4:  9.7% 78.7% 11.6%
[libx264 @ 0x5640041c2a40] mb P  I16..4:  1.7% 11.6%  2.3%  P16..4: 40.0% 19.8% 15.1%  0.0%  0.0%    skip: 9.5%
[libx264 @ 0x5640041c2a40] mb B  I16..4:  0.7%  3.3%  0.9%  B16..8: 45.1% 11.9%  3.9%  direct: 4.3%  skip:30.0%  L0:43.0% L1:36.4% BI:20.6%
[libx264 @ 0x5640041c2a40] final ratefactor: 20.83
[libx264 @ 0x5640041c2a40] 8x8 transform intra:72.4% inter:78.8%
[libx264 @ 0x5640041c2a40] coded y,uvDC,uvAC intra: 69.9% 0.6% 0.4% inter: 31.2% 0.1% 0.0%
[libx264 @ 0x5640041c2a40] i16 v,h,dc,p: 23% 28% 28% 21%
[libx264 @ 0x5640041c2a40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 24% 34%  4%  3%  3%  4%  4%  6%
[libx264 @ 0x5640041c2a40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 18% 20%  7%  8%  7%  9%  6%  7%
[libx264 @ 0x5640041c2a40] i8c dc,h,v,p: 99%  1%  0%  0%
[libx264 @ 0x5640041c2a40] Weighted P-Frames: Y:27.3% UV:0.8%
[libx264 @ 0x5640041c2a40] ref P L0: 60.5% 16.2% 14.6%  6.8%  1.9%
[libx264 @ 0x5640041c2a40] ref B L0: 86.7% 11.1%  2.1%
[libx264 @ 0x5640041c2a40] ref B L1: 96.7%  3.3%
[libx264 @ 0x5640041c2a40] kb/s:1559.22
[chuck@lizum Season 1930.2028]$ 

Please observe:

  1. No forced transcode on everything
  2. When forcing transcode, B&W is preserved.


Screenshot from 2023-07-30 13-17-15

I’m writing this up for Engineering to review and schedule.
I don’t know when they will ultimately resolve it

From one of my B&W files, using “file”:
RIFF (little-endian) data, AVI, 576 x 432, 23.98 fps, video: XviD, audio: MPEG-1 Layer 3 (mono, 48000 Hz)

Look XviD =o Looks right on the nose here, I guess.

I also have trouble with some color files using DivX 5:
RIFF (little-endian) data, AVI, 512 x 368, 29.97 fps, video: DivX 5, audio: MPEG-1 Layer 3 (stereo, 44100 Hz)

I think DivX is also an old codec. I think DivX went the way of the dodo in the early 00’s. I guess I’ll inventory my files to see what’s DivX and XviD (I think one is a variant of the other anyhow) and transcode them all to something that doesn’t suck. I’ll probably save myself a bunch of space, too. :wink:

Thanks!

DivX and XVID are indeed variants of each other.

If you use mediainfo you can parse out the video bitrate
From there, launch the FFMPEG encode and replace the original file.

1 Like

I’ve tested re-encodes, and they work fine. :slight_smile:

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