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

Ferdi Scholten ferdi at sttc-nlp.nl
Fri Feb 4 00:38:01 EET 2022



On 03-02-2022 23:01, 小太 wrote:
> On Fri, 4 Feb 2022 at 08:58, Ferdi Scholten <ferdi at sttc-nlp.nl> wrote:
>> What happens if you use this commandline?
>>    ffmpeg -i oHn-.mkv -codec:v libx265 -x265-params
>> profile=main444:preset=fast:crf=22 -codec:a copy a.mkv
> libx265 complains that profile and preset options don't exist:
>> [libx265 @ 0x55a964637b80] Unknown option: profile.
>> [libx265 @ 0x55a964637b80] Unknown option: preset.
> And I still end up getting the same problem as before
>
> $ ffmpeg -i oHn-.mkv -codec:v libx265 -x265-params
> profile=main444: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
> Stream mapping:
>    Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265))
>    Stream #0:1 -> #0:1 (copy)
> Press [q] to stop, [?] for help
> [libx265 @ 0x55a964637b80] Unknown option: profile.
> [libx265 @ 0x55a964637b80] Unknown option: preset.
> 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 / 3
> x265 [info]: Keyframe min / max / scenecut / bias  : 25 / 250 / 40 / 5.00
> x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
> x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
> x265 [info]: References / ref-limit  cu / depth  : 3 / off / 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=3 psy-rd=2.00 early-skip rskip mode=1 signhide tmvp
> x265 [info]: tools: b-intra 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= 73 q=32.9 Lsize=     144kB time=00:00:02.00 bitrate=
> 587.4kbits/s speed=1.21x
> video:138kB audio:2kB subtitle:0kB other streams:0kB global
> headers:2kB muxing overhead: 3.225897%
> x265 [info]: frame I:      1, Avg QP:24.14  kb/s: 55649.76
> x265 [info]: frame P:     26, Avg QP:29.74  kb/s: 117.42
> x265 [info]: frame B:     94, Avg QP:32.68  kb/s: 92.12
> x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
> x265 [info]: consecutive B-frames: 7.4% 3.7% 0.0% 11.1% 77.8%
>
> encoded 121 frames in 1.60s (75.63 fps), 556.71 kb/s, Avg QP:31.98
>
>
>
> $ 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 @ 0x7fb7a5f30540] deprecated pixel format used, make sure
> you did set range correctly
>     2.95 A-V: -0.021 fd=   6 aq=    0KB vq=    0KB sq=    0B f=0/0
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
Just glanced over the X265 build documentation and there appear to be 
some limitations in the way applications like ffmpeg use libx265. This 
might be appliccable to this problem. Just tried om my build where both 
libx265 as well as ffmpeg are the newest version and it is impossible to 
set the profile. It remains only on main.

There are two options is you need to use x265, try piping the raw video 
output of ffmpeg through the x265 application. I have no experience with 
this but that should work.
The other option is to use another video codec for example av1 with 
libaom or libsvtav1.


More information about the ffmpeg-user mailing list