Ffmpeg tools libx264 and libx265

So I’ve installed ffmpeg tools with view to converting some of my recordings into a smaller file size using libx265.

Unfortunately, the ffmpeg tools that I can install appears to be missing encodes?

When I try to run command

ffmpeg -i input -c:v libx265 -crf 28 -c:a aac -b:a 128k output.mp4

I get the error unknown encoder. Same problem with libx264. How do I go about fixing this.

Thanks

Same problem here. N2 with CE 9.2.1

  1. Not posting any samples for us to take a look at will usually result in the post being ignored.
  2. Try latest nightly, as much has changed since 9.2.1, and it’s possible your problem is now fixed. In such a case, next stable release will fix it.

I think the issue might be that the version of FFmpeg Tools in the CoreELEC nightly addons Repo just hasn’t been built with the --enable-libx265 flag, or even the --enable-libx264 flag as that encoder also does not work.

https://trac.ffmpeg.org/wiki/Encode/H.265

ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8.3.0 (GCC)
  configuration: --enable-ffmpeg --disable-ffplay --enable-ffprobe --enable-static --disable-shared --enable-gpl --disable-doc --enable-avresample --disable-lzma --disable-alsa --arch=arm --cpu=cortex-a53 --cross-prefix=/var/corebuild/CoreELEC/build.CoreELEC-Amlogic.arm-9.2-devel/toolchain/bin/armv8a-libreelec-linux-gnueabi- --enable-cross-compile --sysroot=/var/corebuild/CoreELEC/build.CoreELEC-Amlogic.arm-9.2-devel/toolchain/armv8a-libreelec-linux-gnueabi/sysroot --sysinclude=/var/corebuild/CoreELEC/build.CoreELEC-Amlogic.arm-9.2-devel/toolchain/armv8a-libreelec-linux-gnueabi/sysroot/usr/include --target-os=linux --nm=/var/corebuild/CoreELEC/build.CoreELEC-Amlogic.arm-9.2-devel/toolchain/bin/armv8a-libreelec-linux-gnueabi-nm --ar=/var/corebuild/CoreELEC/build.CoreELEC-Amlogic.arm-9.2-devel/toolchain/bin/armv8a-libreelec-linux-gnueabi-ar --as=/var/corebuild/CoreELEC/build.CoreELEC-Amlogic.arm-9.2-devel/toolchain/bin/armv8a-libreelec-linux-gnueabi-gcc --cc=/var/corebuild/CoreELEC/build.CoreELEC-Amlogic.arm-9.2-devel/toolchain/bin/armv8a-libreelec-linux-gnueabi-gcc --ld=/var/corebuild/CoreELEC/build.CoreELEC-Amlogic.arm-9.2-devel/toolchain/bin/armv8a-libreelec-linux-gnueabi-gcc --pkg-config=/var/corebuild/CoreELEC/build.CoreELEC-Amlogic.arm-9.2-devel/toolchain/bin/pkg-config --host-cc=/var/corebuild/CoreELEC/build.CoreELEC-Amlogic.arm-9.2-devel/toolchain/bin/host-gcc --host-cflags='-march=native -O2 -Wall -pipe -I/var/corebuild/CoreELEC/build.CoreELEC-Amlogic.arm-9.2-devel/toolchain/include -Wno-format-security' --host-ldflags='-Wl,-rpath,/var/corebuild/CoreELEC/build.CoreELEC-Amlogic.arm-9.2-devel/toolchain/lib -L/var/corebuild/CoreELEC/build.CoreELEC-Amlogic.arm-9.2-devel/toolchain/lib' --host-extralibs=-lm --extra-cflags='-march=armv8-a+crc -mtune=cortex-a53 -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -fomit-frame-pointer -Wall -pipe -Os -I/var/corebuild/CoreELEC/build.CoreELEC-Amlogic.arm-9.2-devel/gnutls-3.6.10/.INSTALL_PKG/usr/include' --extra-ldflags='-march=armv8-a+crc -mtune=cortex-a53 -Wl,--as-needed -L/var/corebuild/CoreELEC/build.CoreELEC-Amlogic.arm-9.2-devel/gnutls-3.6.10/.INSTALL_PKG/usr/lib' --extra-libs= --enable-pic --enable-gnutls --disable-openssl --disable-hardcoded-tables
  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
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

libx264 disabled, x265 flag not present.

I think you need to look this


and this

?

Guys guys guys!

This thread may be dead, but let me have some comments.

For me (someone who doesn’t really speak makefile and coreelec, and who just dropped in here seeking answers) #5 and #6 are better confusing than being an actual help. #5 suggests “libx264 disabled, x265 flag not present” and #6 says none of them is achievable for ARM… which conclusion may be true and also false.
So my point is that the replies don’t clearly answer the original question - if x264 and x265 are present, however a short and clear answer would have taken similar effort. Ah, and neither attempts answering “How do I go about fixing this.” either.

So, my best bets to resolve my problem (re-encoding Easter recordings) are these:

  • keep doing re-encoding on my ubuntu (which is of course a waste of my coreelec box)
  • try ffmpeg for entware (no x264/x265 support either)
  • experiment with docker + ubuntu + ffmpeg (has a learning curve for docker)
  • experiment with tailoring all the above configs to natively support x265 on ARM (most probably involves coreelec-builder, so pretty much an endless project)

Most ARM processors will simply choke when asked to transcode and this is why little attention has been applied to getting it working. You answered your own question - keep doing it with your ubuntu machine which presumably has an x86 chip.

Shoog

@Shoog Thank you for your answer - x86 is indeed the solution. I’ll leave here some additional info for others walking in my shoes, and with that this case is closed from my side.

For the experiment, I’ve searched for docker images with ARM support; the first working match was linuxserver/ffmpeg:arm64v8-latest for my Amlogic S905x3 based box. It transcodes a short H.264 video to H.265 really really slow: 0.1fps, system load constantly beyond 4. I assume ffmpeg can’t show less than 0.1fps so the actual figures are even worse.

Amlogic devices have HW-based Decoder OR Encoder, but for transcoding you need both. Therefore it can only processed via SW, which gives poor results (even on x86 w/o GPU HW-support)