[FFmpeg-user] x265 encoded with yuvj444p plays back as yuvj420p

‍小太 nospam at kota.moe
Thu Feb 3 23:29:38 EET 2022


On Fri, 4 Feb 2022 at 08:23, Ferdi Scholten <ferdi at sttc-nlp.nl> wrote:
> You are encoding with the main profile. That only supports 4:2:0 chroma
> sampling. Use another profile.

I tried with -profile:v main444, and it results in the same problem
(full command below): https://0x0.st/oHna.mkv
Is there another profile I should be using?

And regardless of what profile I chose, shouldn't ffmpeg be
downsampling the chroma channels if 4:4:4 isn't supported instead of
just outputting garbage?

$ ffmpeg -i oHn-.mkv -codec:v libx265 -profile:v main444-8 -preset
fast -crf 22 -codec:a copy a.mkv
ffmpeg version 4.4.1-3 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11 (Debian 11.2.0-14)
  configuration: --prefix=/usr --extra-version=3 --toolchain=hardened
--libdir=/usr/lib/x86_64-linux-gnu
--incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl
--disable-stripping --enable-gnutls --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libcodec2 --enable-libdav1d
--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-librabbitmq --enable-librubberband --enable-libshine
--enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt
--enable-libssh --enable-libtheora --enable-libtwolame
--enable-libvidstab --enable-libvorbis --enable-libvpx
--enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid
--enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2
--enable-omx --enable-openal --enable-opencl --enable-opengl
--enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx
--enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  WARNING: library configuration mismatch
  avcodec     configuration: --prefix=/usr --extra-version=3
--toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
--incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl
--disable-stripping --enable-gnutls --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libcodec2 --enable-libdav1d
--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-librabbitmq --enable-librubberband --enable-libshine
--enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt
--enable-libssh --enable-libtheora --enable-libtwolame
--enable-libvidstab --enable-libvorbis --enable-libvpx
--enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid
--enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2
--enable-omx --enable-openal --enable-opencl --enable-opengl
--enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx
--enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
--enable-version3 --disable-doc --disable-programs --enable-libaribb24
--enable-libopencore_amrnb --enable-libopencore_amrwb
--enable-libtesseract --enable-libvo_amrwbenc --enable-libsmbclient
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, matroska,webm, from 'oHn-.mkv':
  Metadata:
    ENCODER         : Lavf58.76.100
  Duration: 00:00:02.02, start: 0.000000, bitrate: 1908 kb/s
  Stream #0:0: Video: h264 (High 4:4:4 Predictive), yuvj444p(pc,
bt709/bt709/iec61966-2-1, progressive), 2560x1440 [SAR 1:1 DAR 16:9],
60 fps, 60 tbr, 1k tbn, 120 tbc (default)
    Metadata:
      DURATION        : 00:00:02.017000000
  Stream #0:1: Audio: aac (LC), 48000 Hz, 5.1, fltp (default)
    Metadata:
      title           : Track1
      DURATION        : 00:00:02.005000000
File 'a.mkv' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
x265 [info]: HEVC encoder version 3.5+1-f0c1022b6
x265 [info]: build info [Linux][GCC 10.3.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2
AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-5 (Main tier)
x265 [info]: Thread pool 0 using 48 threads on numa nodes 0,1,2,3
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 5 / wpp(23 rows)
libnuma: Warning: node 0 not allowed
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut / bias  : 25 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 15 / 4 / 0
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-22.0 / 0.60
x265 [info]: tools: rd=2 psy-rd=2.00 rskip mode=1 signhide tmvp fast-intra
x265 [info]: tools: strong-intra-smoothing lslices=8 deblock sao
Output #0, matroska, to 'a.mkv':
  Metadata:
    encoder         : Lavf58.76.100
  Stream #0:0: Video: hevc, yuvj444p(pc, bt709/bt709/iec61966-2-1,
progressive), 2560x1440 [SAR 1:1 DAR 16:9], q=2-31, 60 fps, 1k tbn
(default)
    Metadata:
      DURATION        : 00:00:02.017000000
      encoder         : Lavc58.134.100 libx265
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
  Stream #0:1: Audio: aac (LC) ([255][0][0][0] / 0x00FF), 48000 Hz,
5.1, fltp (default)
    Metadata:
      title           : Track1
      DURATION        : 00:00:02.005000000
frame=  121 fps=109 q=32.9 Lsize=     144kB time=00:00:02.00 bitrate=
587.2kbits/s speed= 1.8x
video:137kB audio:2kB subtitle:0kB other streams:0kB global
headers:2kB muxing overhead: 3.229585%
x265 [info]: frame I:      1, Avg QP:25.28  kb/s: 52256.64
x265 [info]: frame P:     24, Avg QP:29.55  kb/s: 172.86
x265 [info]: frame B:     96, Avg QP:32.69  kb/s: 113.78
x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x265 [info]: consecutive B-frames: 4.0% 0.0% 0.0% 0.0% 96.0%

encoded 121 frames in 1.05s (114.80 fps), 556.44 kb/s, Avg QP:32.00



$ ffplay a.mkv
ffplay version 4.4.1-3 Copyright (c) 2003-2021 the FFmpeg developers
  built with gcc 11 (Debian 11.2.0-14)
  configuration: --prefix=/usr --extra-version=3 --toolchain=hardened
--libdir=/usr/lib/x86_64-linux-gnu
--incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl
--disable-stripping --enable-gnutls --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libcodec2 --enable-libdav1d
--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-librabbitmq --enable-librubberband --enable-libshine
--enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt
--enable-libssh --enable-libtheora --enable-libtwolame
--enable-libvidstab --enable-libvorbis --enable-libvpx
--enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid
--enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2
--enable-omx --enable-openal --enable-opencl --enable-opengl
--enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx
--enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  WARNING: library configuration mismatch
  avcodec     configuration: --prefix=/usr --extra-version=3
--toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
--incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl
--disable-stripping --enable-gnutls --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libcodec2 --enable-libdav1d
--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-librabbitmq --enable-librubberband --enable-libshine
--enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt
--enable-libssh --enable-libtheora --enable-libtwolame
--enable-libvidstab --enable-libvorbis --enable-libvpx
--enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid
--enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2
--enable-omx --enable-openal --enable-opencl --enable-opengl
--enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx
--enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
--enable-version3 --disable-doc --disable-programs --enable-libaribb24
--enable-libopencore_amrnb --enable-libopencore_amrwb
--enable-libtesseract --enable-libvo_amrwbenc --enable-libsmbclient
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, matroska,webm, from 'a.mkv': vq=    0KB sq=    0B f=0/0
  Metadata:
    ENCODER         : Lavf58.76.100
  Duration: 00:00:02.03, start: 0.000000, bitrate: 581 kb/s
  Stream #0:0: Video: hevc (Main), yuvj420p(pc,
bt709/bt709/iec61966-2-1, progressive), 2560x1440 [SAR 1:1 DAR 16:9],
60 fps, 60 tbr, 1k tbn, 60 tbc (default)
    Metadata:
      ENCODER         : Lavc58.134.100 libx265
      DURATION        : 00:00:02.017000000
  Stream #0:1: Audio: aac (LC), 48000 Hz, 5.1, fltp (default)
    Metadata:
      title           : Track1
      DURATION        : 00:00:02.026000000
[swscaler @ 0x7fa6bdf2fcc0] deprecated pixel format used, make sure
you did set range correctly
   4.55 A-V: -0.021 fd=   6 aq=    0KB vq=    0KB sq=    0B f=0/0


More information about the ffmpeg-user mailing list